我正在嘗試將默認安裝路徑更改爲用戶的主目錄/ ProductName。WIX更改默認安裝路徑
下面是我的代碼(它不是整個代碼)
<Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" Description="desc" Comments="View Violations in APD" InstallPrivileges="elevated"/>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
<Property Id="ENVIRONMENT" Secure="yes" />
<UIRef Id="WixUI_InstallDir" />
<UIRef Id="WixUI_ErrorProgressText" />
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="InstallScripts" Guid="someGUID">
<File Id="file1.il" Source="$(var.ScriptsFolder)\file1.il"/>
<File Id="file2.il" Source="$(var.ScriptsFolder)\file2.il"/>
</Component>
</DirectoryRef>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ProgramMenuSubfolder" Name="CompanyName">
<Directory Id="ScriptsFolder" Name="SoftwareName" />
<Directory Id="INSTALLFOLDER" Name="SoftwareName" />
<Component Id="Registry_FriendlyName">
<RegistryValue Id="RegKey_FriendlyName" Root="HKCU"
Key="Software\Microsoft\Office\Excel\AddIns\AddIn1"
Name="FriendlyName"
Value="AddIn1"
Type="string" KeyPath="yes" />
</Component>
<Component Id="Registry_Manifest" Guid="SomeGUID">
<RegistryKey Root="HKCU" Key="Software\Microsoft\Office\Excel\AddIns\AddIn1" Action="create">
<RegistryValue Id="RegKey_Manifest" Name="Manifest" Type="string" Value="[INSTALLFOLDER]ViolationsAddIn.vsto|vstolocal" KeyPath="yes" />
</RegistryKey>
</Component>
<Directory Id="GAC" Name="GAC">
<Component Id="dll_gac_Component" DiskId="1" Guid="SomeGUID">
<File Id="Core_dll_gac" KeyPath="yes"
Name="Core.dll" Source="$(var.variable1)" Assembly=".net"></File>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
如果你看到上面的代碼..現在的默認路徑是InstallFolder這是SoftwareName文件夾。我在幾個更多的地方使用這個InstalFolder來複制幾個文件(DirectoryRef),添加註冊表值等。現在我想將默認安裝路徑設置爲用戶主目錄,用戶可以將其更改爲其他任何內容而不破壞這些功能。請幫幫我。
任何幫助表示讚賞。
感謝