如何使用 WIX 在 D 驱动器中创建 INSTALLLOCATION 文件夹? [英] how to create INSTALLLOCATION folder in D drive using WIX?
本文介绍了如何使用 WIX 在 D 驱动器中创建 INSTALLLOCATION 文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面的 xml 在 C:\Programfiles 下创建指定的文件夹,但我想在 D:\MySetupFolder\ 中创建 (SomeFolder\MyApp) 文件夹,我如何使用 WIX 创建它?
Below xml creates the specified folders under C:\Programfiles but I want to create (SomeFolder\MyApp) Folders in D:\MySetupFolder\, how can I create this using the WIX?
<Directory Id="TARGETDIR" Name="SourceDir">
**<Directory Id="$(var.PlatformProgramFilesFolder)">**
<Directory Id="INSTALLFOLDERLOCATION" Name="SomeFolder">
<Directory Id="INSTALLLOCATION" Name="MyApp">
</Directory>
</Directory>
</Directory>
推荐答案
将rootdrive的值设置为你想要的驱动器
Set the value of rootdrive to the drive you want
<CustomAction Id='SetRootDrive' Property='ROOTDRIVE' Value='[%SystemDrive]\'/>
系统驱动器将默认为操作系统使用的默认驱动器
System drive will be by default the default drive used by OS
添加了调用SetRootDrive"操作的代码:您需要从 InstallUISequence 调用它
Added code to call 'SetRootDrive' action: You need to call it from InstallUISequence
<InstallUISequence>
<Show Dialog="MyWelcomeDlg" Before="CostFinalize">NOT Installed</Show>
<!-- App search is what does FindInstallLocation, and it is dependent on FindRelatedProducts -->
<AppSearch After="FindRelatedProducts"/>
<Custom Action="SetRootDrive" Before="CostInitialize"></Custom>
</InstallUISequence>
这篇关于如何使用 WIX 在 D 驱动器中创建 INSTALLLOCATION 文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文