关于如何使用wix's new ability to run an elevated process through the engine的当前样本集非常稀疏,如果它存在的话。从WIP和schema docs,我可以看到我至少需要以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="..." Version="1.0.0.0" Manufacturer="..." UpgradeCode="*">
<BootstrapperApplicationRef
Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication
LaunchTargetElevatedId="LaunchElevatedInstallProc"
LaunchArguments="/myarg=1"
LicenseFile="license.rtf" />
</BootstrapperApplicationRef>
<ApprovedExeForElevation
Id="LaunchElevatedInstallProc"
Key="SOFTWARE\Company\Product"
Value="PathToExeDeliveredByMSI" />
<Chain>
<MsiPackage SourceFile="Setup.msi" Compressed="yes" />
</Chain>
</Bundle>
</Wix>
Key
的{{1}}属性有意义;它是我的msi中创建的条目的注册表路径。 <ApprovedExeForElevation>
属性是我创建的注册表中的ValueName,包含我在安装中提供的.exe的路径:
Value
然而,这似乎并没有起作用。我的.exe永远不会启动,.log文件也没有提供它甚至试图启动它的信息。
这段代码缺少什么?
修改
日志提供的唯一信息是它设置变量:
将字符串变量'LaunchTargetElevatedId'初始化为值'LaunchElevatedInstallProc' 将字符串变量'LaunchArguments'初始化为值'/ s'
答案 0 :(得分:3)
根据documentation,还必须设置TargetPath
上的WixStandardBootstrapperApplication
属性。 WixStdBA回归到在这条路径上启动exe,如果出现任何问题,试图将其提升为高架。
Id of the target ApprovedExeForElevation element.
If set with LaunchTarget, WixStdBA will launch the application
through the Engine's LaunchApprovedExe method instead of through ShellExecute.
您还需要Success
页面上的一个按钮,主题中的名称为LaunchButton
。