我正在尝试将默认安装路径更改为用户的主目录/ProductName。
下面是我的代码(它不是整个代码)
<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),添加注册表值等。现在我想将默认安装路径设置为用户主目录,用户可以将其更改为其他任何内容而不会破坏这些功能。请帮我。
任何帮助表示赞赏。
谢谢