关于如何使用wix通过引擎运行提升过程的新能力的当前示例集是非常稀疏的,如果它存在的话。从WIP和模式文档中,我可以看到我需要以下最低限度的内容:
<?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属性<ApprovedExeForElevation>是有意义的;它是在msi中创建的条目的注册表路径。Value属性是我创建的注册表中的ValueName,包含我在安装中传递的.exe路径:
<Component Id="Comp_Client_Service.exe" Guid="PUT-GUID-HERE">
<File Id="my.exe" Name="my.exe" Source="my.exe" KeyPath="yes" />
<RegistryValue
Root="HKLM"
Key="SOFTWARE\Company\Product"
Name="PathToExeDeliveredByMSI"
Value="[INSTALLFOLDER]my.exe"
Type="string"/>
</Component>然而,这似乎不起作用。我的.exe从未启动,.log文件也没有提供任何信息表明它正在尝试启动它。
这段代码少了什么?
编辑
日志提供的唯一信息是它正在设置变量:
将字符串变量'LaunchTargetElevatedId‘初始化为值'LaunchElevatedInstallProc’ 将字符串变量'LaunchArguments‘初始化为值'/s’
发布于 2014-12-13 00:30:14
根据文档,还必须设置WixStandardBootstrapperApplication上的TargetPath属性。如果有任何错误,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。
https://stackoverflow.com/questions/27451028
复制相似问题