我正在尝试根据安装和卸载应用程序的时间打开不同的URL。目前,此设置在卸载时打开两个 URL,但在安装时不打开任何内容。
<Property Id="InstallURL">$(var.HomepageURL)install?ver=$(var.VersionNumber)</Property>
<Property Id="UninstallURL">$(var.HomepageURL)uninstall?ver=$(var.VersionNumber)</Property>
<CustomAction Id="SetOpenInstallURL" Property="WixShellExecTarget" Value="[InstallURL]" />
<CustomAction Id="SetOpenUninstallURL" Property="WixShellExecTarget" Value="[UninstallURL]" />
<CustomAction Id="OpenInstallURL" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" Return="ignore" />
<CustomAction Id="OpenUninstallURL" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" Return="ignore" />
<InstallExecuteSequence>
<!-- Launch webpage during install -->
<Custom Action='SetOpenInstallURL' After='InstallFinalize'><![CDATA[Installed]]></Custom>
<Custom Action="OpenInstallURL" After="SetOpenInstallURL"></Custom>
</InstallExecuteSequence>
<InstallExecuteSequence>
<!-- Launch webpage during full uninstall, but not upgrade -->
<Custom Action="SetOpenUninstallURL" After="InstallFinalize"><![CDATA[REMOVE ~= "ALL" AND NOT UPGRADINGPRODUCTCODE]]></Custom>
<Custom Action="OpenUninstallURL" After="SetOpenUninstallURL"></Custom>
</InstallExecuteSequence>
在 https://gist.github.com/raspi/7072ecdb43d929901e3d228893cfa124 检查 msi 日志后的另一次尝试
<Property Id="InstallURL">$(var.HomepageURL)install?ver=$(var.VersionNumber)</Property>
<Property Id="UninstallURL">$(var.HomepageURL)uninstall?ver=$(var.VersionNumber)</Property>
<!-- Set value of WixShellExecTarget property to value of InstallURL if this is first time install -->
<SetProperty Id="WixShellExecTarget" Action="SetInstallURL" Value="[InstallURL]" Before="OpenURL" Sequence="execute">NOT Installed</SetProperty>
<!-- Set value of WixShellExecTarget property to value of UninstallURL if this is uninstall -->
<SetProperty Id="WixShellExecTarget" Action="SetUninstallURL" Value="[UninstallURL]" Before="OpenURL" Sequence="execute">REMOVE</SetProperty>
<CustomAction Id="OpenURL" BinaryKey="WixCA" DllEntry="WixShellExec" Return="ignore" />
<InstallExecuteSequence>
<Custom Action="OpenURL" After="InstallFinalize"/>
</InstallExecuteSequence>