catch从shellexecuteex中取消click nsis安装程序

catch cancel click nsis installer from shellexecuteex

本文关键字:nsis 安装 程序 click 取消 shellexecuteex catch      更新时间:2023-10-16

嗨,我正试图使用c++应用程序中的ShellExecuteEx运行安装程序。我可以运行我的安装程序。如果我随时点击NSIS安装程序上的"取消",我该如何从C++应用程序中获取信息并打印安装失败。

我试过像这个

if((UINT)ShExecInfo.hInstApp <= SE_ERR_DDETIMEOUT ) 
{
    fprintf(fp, "Failed to start the installer n");
    exit(-1);   
}

但运气不好,我试着在ShExecInfo.hInstApp中打印whats,结果是数字42。有什么想法吗?

hInstApp保存启动期间发生的错误(如果有)。它与应用程序关闭无关。

您希望查看带有GetExitCodeProcess的安装程序进程的退出代码,如果您在ShExecInfo.fMask中设置了SEE_MASK_NOCLOSEPROCESS标志,则该代码将存储在ShExecInfo.hProcess中。

当用户点击取消时,您必须查看NSIS文档中返回的退出代码。