how to create INSTALLLOCATION folder in D drive using WIX?

旧巷老猫 提交于 2019-12-31 01:52:53

问题


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>

回答1:


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>


来源:https://stackoverflow.com/questions/14339814/how-to-create-installlocation-folder-in-d-drive-using-wix

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!