我是 WiX 的新手,我试图让我的 Bootstrapper 在完成后启动我安装的应用程序。为了实现这一点,我正在使用
<Variable Name="LaunchTarget" Value="path_to_exe"/>
然而,获取可执行文件的路径对我来说并不容易。原因是我使用 安装一些先决条件,然后使用 msi 实际安装我的 exe。
为此,msi 将路径写入注册表中的已知位置,然后引导程序读取并使用它。
问题在于,当引导程序读取注册表时,msi 尚未运行,因此它最终无法运行可执行文件。
这是我的 WiX,如果有帮助的话:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="My Installation" UpgradeCode="a8964402-f3fc-4878-aafd-31ecda6b685e" Version="1.0.0.0">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication LicenseFile="EULA.rtf"
ThemeFile="theme.xml"
SuppressOptionsUI="yes" />
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="NetFx40Redist"/>
<ExePackage Id="OpenSSL" SourceFile="pre-requesite.exe" />
<MsiPackage Id="myInstall" SourceFile="mySetup.msi" />
</Chain>
<util:RegistrySearch Root="HKLM"
Key="Software\myProgram"
Value="myEXEPath"
Variable="myEXEPath"
Result="value"
Format="raw" />
<Variable Name="LaunchTarget" Value="[myEXEPath]"/>
</Bundle>
</Wix>
所以,简而言之,我正在尝试运行RegistrySearchAFTERMsiPackage 安装。这可以做到吗?如果没有,我还有哪些选择?
正如我附注的那样,如果我在安装之前手动填写注册表值,一切都会正常工作。这意味着除了运行的顺序之外,一切都工作正常。
注册表搜索在检测操作期间运行。自定义 BA 可以在应用后运行检测,但这并不是一个真正的选项,因为您使用的是 WixStandardBootstrapperApplication。
幸运的是,WiX v3.9 添加了对运行已提升的 LaunchTarget 的支持,并要求目标 .exe 的路径位于 HKLM 下的注册表中。所以你会这样做:
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication LicenseFile="EULA.rtf"
ThemeFile="theme.xml"
SuppressOptionsUI="yes"
LaunchTargetElevatedId="MyAEEId" />
</BootstrapperApplicationRef>
<ApprovedExeForElevation Id="MyAEEId"
Key="Software\myProgram" Value="myEXEPath" />
Edit:
看起来你需要设置LaunchTarget
以及。为什么你的包不知道它会在哪里?你可以直接输入乱码LaunchTarget
(WixStdBA会先尝试注册表位置),但是你不能使用内置变量 http://wixtoolset.org/documentation/manual/v3/bundle/bundle_built_in_variables.html and/or MsiProperty http://wixtoolset.org/documentation/manual/v3/xsd/wix/msiproperty.html元素来定位exe?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)