自定义操作配置如下:
Custom Action Name: MyCustomAction
VBScript Filename:
<PathVar01
>\MyFolder\MyVBSfile.vbsScriptFunction: MyFunction
Return Processing: Synchronous (Check exit code)
In-Script Execution: Immediate Execution
它通过以下 InstallScript 代码执行:
result = MsiDoAction(ISMSI_HANDLE,"MyCustomAction");
当安装程序到达 InstallScript 中的那一行时,安装程序会显示错误警报,说明:
"Error 1720.There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor."
MsiDoAction返回的结果码是'1603',according to winerror.h , 是:
//
// MessageId: ERROR_INSTALL_FAILURE
//
// MessageText:
//
// Fatal error during installation.
//
#define ERROR_INSTALL_FAILURE 1603L
为什么会这样?我开始怀疑该文件是否包含正确。然而,我指向了正确的文件,并且我尝试通过 InstallShield 支持文件包含 VBS,认为这将确保该文件存在于安装程序中,但结果相同。
最佳答案
在启用日志记录的情况下运行设置揭示了问题:
Action 13:29:19: MyCustomAction.
Action start 13:29:19: MyCustomAction.Error 1720.There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action MyCustomAction script error -2146827278, Microsoft VBScript compilation error: Expected identifier Line 163, Column 37,
blnExample,)
在启用日志记录的情况下运行设置:
"C:\SetupFolder\setup.exe" /V"/l*v c:\Install.log"
This forum thread很有帮助。
关于vbscript - 当我的 InstallShield 安装程序尝试运行我的 VBS 自定义操作时,为什么会出现 1720 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/278999/