问题描述
我有一个条件,如果是真的,MSi 安装/卸载应该终止.如何在自定义操作中通过 vbscript 实现.?
I have one condition , if it true MSi installation/Uninstallation should terminate. How can i implement through vbscript in custom action. ?
任何人都可以帮助我.
推荐答案
msiDoActionStatusNoAction 0 未执行操作.
msiDoActionStatusNoAction 0 Action not executed.
msiDoActionStatusSuccess IDOK = 1 操作成功完成.
msiDoActionStatusSuccess IDOK = 1 Action completed successfully.
msiDoActionStatusUserExit IDCANCEL = 2 用户提前终止.
msiDoActionStatusUserExit IDCANCEL = 2 Premature termination by user.
msiDoActionStatusFailure IDABORT = 3 不可恢复的错误.期间有错误返回解析或执行 JScript 或 VBScript.
msiDoActionStatusFailure IDABORT = 3 Unrecoverable error. Returned if there is an error duringparsing or execution of the JScript or VBScript.
msiDoActionStatusSuspend IDRETRY = 4 待稍后恢复的暂停序列.
msiDoActionStatusSuspend IDRETRY = 4 Suspended sequence to be resumed later.
msiDoActionStatusFinished IDIGNORE = 5 跳过剩余动作.不是错误.
msiDoActionStatusFinished IDIGNORE = 5 Skip remaining actions. Not an error.
Function MyVBScriptCA()
If Session.Property("CustomErrorStatus") <> "0" Then
'return error
MyVBScriptCA = 3
Exit Function
End If
' return success
MyVBScriptCA = 1
Exit Function
End Function
还可以考虑阅读 VBScript(和 Jscript)MSI CustomActions烂.
这篇关于如何使用 vbscript 自定义操作终止 msi 安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!