2017-10-04 202 views
1

我用下面的代碼構建我的* .msi與WiX工具集,我需要將其安裝到自定義文件夾(而不是ProgramFiles)。如何將應用程序安裝到自定義文件夾?

我可以從源文件或註冊表鍵中獲得安裝路徑嗎?

<Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="ProgramFilesFolder"> 
     <Directory Id="INSTALLFOLDER" Name="MySetup" /> 
     </Directory> 
    </Directory> 
    </Fragment> 

回答

0

[解決]

MyAppInstallationPath.ini文件

[Data] 
Path=V:\ 

* .wsx文件

<Fragment> 
    <Property Id="INSTALLPATH"> 
     <IniFileSearch Id="MyAppInstalationPath" Type="directory" Name="MyAppInstallationPath.ini" Section="State" Key="Data" /> 
    </Property> 
    </Fragment> 

    <Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="INTALLPATH" Name="MyApp"> 
     <Directory Id="INSTALLFOLDER" Name="MySetup" /> 
     </Directory> 
    </Directory> 
    </Fragment> 

    <Fragment> 
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
     <Component Id="ProductComponent" Guid="F49934B4-6DE4-4EF1-8CDF-A4C758378FD5"> 
     <File Id="Calc" DiskId="1" Source="C:\WINDOWS\system32\calc.exe" /> 
     </Component> 
    </ComponentGroup> 
    </Fragment> 
相關問題