前提:更新程序使用NSIS打包后下载更新包
此处阻塞等待静默包安装覆盖原安装路径下的文件。
SHELLEXECUTEINFOA ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFOA);ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = pszPath;
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteExA(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
等静默安装完成后更新界面提示