【发布时间】:2019-01-27 13:40:54
【问题描述】:
我无法使用 WIX 安装程序执行 VBScript。目前我有这部分 WiX 配置:
<Binary Id='KillThatProcessBinary' SourceFile='KillThatProcess.vbs' />
<CustomAction Id="KillThatProcessAction"
Execute="immediate"
BinaryKey='KillThatProcessBinary'
VBScriptCall='KillThatProcessFunction'
Return="check"/>
<InstallExecuteSequence>
<Custom Action='KillThatProcessAction' Before='InstallValidate'/>
<ScheduleReboot After="InstallFinalize"/>
</InstallExecuteSequence>
还有这个 VBS 脚本 (KillThatProcess.vbs):
Public Function KillThatProcessFunction()
Set oShell = WScript.CreateObject("WSCript.shell")
oShell.run "cmd /C wmic process where ""name like '%java%'"" delete"
Return 0
End Function
我已经尝试将此脚本插入CustomAction(作为innerText),并添加属性:Script="vbscript"。但没有任何效果,每次我收到错误消息 - “此 Windows Installer 程序包存在问题。无法运行完成此安装所需的脚本。请联系您的支持人员或程序包供应商。"
以及日志文件中的错误:
Error 0x80070643: Failed to install MSI package.
[1A88:2FA4][2018-08-21T14:11:17]e000: Error 0x80070643: Failed to configure per-user MSI package.
[1A88:2FA4][2018-08-21T14:11:17]i319: Applied execute package: LPGateway, result: 0x80070643, restart: None
[1A88:2FA4][2018-08-21T14:11:17]e000: Error 0x80070643: Failed to execute MSI package.
我已经执行了这个 vbs 脚本(不是来自安装程序)并且它可以工作。有人知道我做错了什么吗?
【问题讨论】:
标签: java wix windows-installer