[英]Reference files in .msi in Wix installer
I have an .MSI that I created using WIX. 我有一个使用WIX创建的.MSI。 It is for a C# project I developed in VS2012. 它用于我在VS2012中开发的C#项目。 When I give a client my MSI file, I expect to have the MSI reference itself, and "place/deploy" a set of files to a location that the customer specifies. 当我向客户提供我的MSI文件时,我希望自己拥有MSI参考,并将一组文件“放置/部署”到客户指定的位置。
I set the location of all these files to 我将所有这些文件的位置设置为
$(sys.CURRENTDIR)Build\etc\etc
However, this variable is resolved on build, so it is hard-coded to MY directory on my dev machine. 但是,此变量在构建时已解析,因此将其硬编码到我的开发机上的MY目录中。 It is now getting set during run-time and using the current MSI's location to pull the files. 现在在运行时进行设置,并使用当前MSI的位置提取文件。
This has got to be possible...but I can't find the solution anywhere, any help? 这一定有可能...但是我在任何地方都找不到解决方案,有什么帮助吗?
Your xml should be structured some what like this: 您的xml应该是这样的:
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="COMPANYDIR" Name="MyCompany">
<Directory Id="PRODUCTDIR" Name="MyProduct">
<Component Id="C.AppExe" Guid="SOME GUID" >
<File Id="AppExe" Name="MyApp.exe"
Source="$(sys.CURRENTDIR)Build\etc\etc"/>
</Component>
</<Directory>
</<Directory>
</<Directory>
</<Directory>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.