用InstallShield创建Custom Action,调用exe,出现Error 1722
安装包工程描述:
用InstallShield实现的安装包工程中,创建了一个Custom Action, 这个Action调用一个用C#编写的exe。
这个exe执行后会弹出一个窗口,包含两个控件,OK按钮,Cancel按钮。
点击Ok,安装继续执行;点击Cancel,安装停止。
c#程序实现描述:
如果点击Ok,程序就会返回0;点击Cancel就会返回-1;
前提:
由于InstallShield的Custom Action在调用可执行程序(有返回值)时,如果接收到数值零,认为执行正常,而如果接收到非零值,就认为安装失败;
问题:
当点击Cancel时,程序返回-1,InstallShield接收到非零值后,认为安装失败,弹出 ERROR 1722:
“There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.”
有什么办法能解决这种问题?