如何使用WIX在D盘创建INSTALLLOCATION文件夹?

3

下面的xml将在C:\Programfiles下创建指定的文件夹,但我想在D:\MySetupFolder下创建(SomeFolder\MyApp)文件夹,如何使用WIX创建这个文件夹?

<Directory Id="TARGETDIR" Name="SourceDir">
**<Directory Id="$(var.PlatformProgramFilesFolder)">**      
        <Directory Id="INSTALLFOLDERLOCATION" Name="SomeFolder">
                <Directory Id="INSTALLLOCATION" Name="MyApp">
</Directory>
</Directory>
</Directory>
1个回答

2

将rootdrive的值设置为您想要的驱动器

<CustomAction Id='SetRootDrive' Property='ROOTDRIVE' Value='[%SystemDrive]\'/>

系统驱动器将默认成为操作系统使用的默认驱动器。

添加了调用“SetRootDrive”操作的代码:您需要从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>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接