WiX Project VS 2015目录未创建
问题描述:
我遵循一个简单的YouTube指令视频介绍如何进行非常基本的WiX设置以创建msi文件。 目的是将某些文件放入特定目录并创建4个注册表项。我在VS 2015内置的安装项目中做到了这一点,并取得了很好的效果。然而,WiX项目不起作用。这是我第一次使用XML。WiX Project VS 2015目录未创建
例如,我在这里所定义的目录:
<Fragment>
<Directory Id="ProgramFilesFolder" Name="Programfiles">
<Directory Id="MSOFFICEFOLDER" Name="Microsoft Office">
<Directory Id="OFFICE14FOLDER" Name="Office14" />
<Directory Id="LIBRARY" Name="Library">
<Directory Id="MAKRO" Name="Makro">
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
在这里,我把文件放进文件夹:
<!-- Adding files to Office14 folders -->
<Fragment>
<DirectoryRef Id="OFFICE14FOLDER">
<Component Id="umrch.hlp" Guid="*">
<File Id="umrch.hlp" Source="MySourceFiles\UMRCH.HLP" KeyPath="yes"
Checksum="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="LIBRARY">
<Component Id="umrch.xla" Guid="*">
<File Id="umrch.xla" Source="MySourceFiles\umrch.xla" KeyPath="yes"
Checksum="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="MAKRO">
<Component Id="umrch.xla" Guid="*">
<File Id="umrch.xla" Source="MySourceFiles\umrch.xla" KeyPath="yes"
Checksum="yes"/>
</Component>
</DirectoryRef>
<!-- Adding files to Company folders-->
<DirectoryRef Id="DATA">
<Component Id="DATAfiles" Guid="*">
<File Id="defumrch.dat" Source="MySourceFiles\defumrch.dat"
KeyPath="yes" Checksum="yes"/>
<File Id="LL_UMRCH.DAT" Source="MySourceFiles\LL_UMRCH.DAT"
KeyPath="no" Checksum="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="VERSION">
<Component Id="VERSIONfiles" Guid="*">
<File Id="umrch_Readme.doc" Source="MySourceFiles\umrch_Readme.doc"
KeyPath="yes" Checksum="yes"/>
<File Id="umrch_Version.txt" Source="MySourceFiles\umrch_Version.txt"
KeyPath="no" Checksum="yes"/>
</Component>
</DirectoryRef>
<!-- Adding files to Windows folder-->
<DirectoryRef Id="WindowsFolder">
<Component Id="WINDOWSfiles" Guid="">
<File Id="umrch.dll" Source="MySourceFiles\umrch.dll" KeyPath="yes"
Checksum="yes"/>
<File Id="umrch.lib" Source="MySourceFiles\umrch.lib" KeyPath="no"
Checksum="yes"/>
<File Id="umrch.mif" Source="MySourceFiles\umrch.mif" KeyPath="no"
Checksum="yes"/>
</Component>
</DirectoryRef>
</Fragment>
在这里,他们应该安装:
<Fragment>
<!-- Tell WiX to install the files -->
<Feature Id="xlahelp" Title="XLA and help files" Level="1">
<ComponentRef Id="umrch.hlp" />
<ComponentRef Id="umrch.xla" />
</Feature>
<Feature Id="COMPANYfiles" Title="Company files" Level="1">
<ComponentRef Id="DATAfiles" />
<ComponentRef Id="VERSIONfiles" />
</Feature>
<Feature Id="WindowsFiles" Title="Windows files" Level="1">
<ComponentRef Id="WINDOWSfiles" />
</Feature>
<Feature Id="Registry" Title="umrch" Level="1">
<ComponentGroupRef Id="Registry"/>
</Feature>
</Fragment>
是否有一些引用丢失或者我错误地使用了XML?
编辑:这是产品威克斯
<Product Id="*" Name="UMRCH" Language="1033" Version="1.0.0.0" Manufacturer="Sample" UpgradeCode="ee45fb60-6741-4424-8136-dfc0d679629a">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
</Product>
编辑为斯坦Åsmul:
DATA和版本应该是这里定义:
<Fragment>
<Directory Id="WindowsVolume" Name="WindowsVolume">
<Directory Id="!(bind.property.Manufacturer)" Name="!(bind.property.Manufacturer)">
<Directory Id="UMRCH" Name="!(bind.property.ProductName)" />
<Directory Id="DATA" Name="data">
<Directory Id="VERSION" Name="version" />
</Directory>
</Directory>
</Directory>
它也不会编译当使用WiX时。 .msi文件的构建没有发生任何错误。 当用SuperOrca打开它时,它显示一个选项卡_Validation,因为我对此很新,我不知道如何阅读Orca中的.msi。
我现在还添加了github以获得更好的可见性。
答
是否使用维克斯时,该文件编译呢?它看起来像你还没有定义你安装到的一些目录。例如DATA和VERSION。如果你得到一个输出MSI文件,当你用Orca打开它时,它看起来是什么样的?你有没有在MSI上运行验证?
一旦你更新了你的问题和更多的细节,我会“发展”这个答案。让我们尽量减少评论的使用“讨论”。
+0
我更新了我原来的帖子! – coltfinger
你能提供定义你的''的wxs吗?如果你没有正确地引用你所做的这些片段(最终在''中被引用),所有的东西都会在编译时被丢弃。 –
我更新了我的原始帖子! – coltfinger
最好只显示整个WiX源代码,以便它可以简单地复制和粘贴以供其他人重现。 – PhilDW