how to create INSTALLLOCATION folder in D drive us

2020-04-10 06:34发布

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>

标签: wix
1条回答
2楼-- · 2020-04-10 06:55

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

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>
查看更多
登录 后发表回答