64,682
社区成员
发帖
与我相关
我的任务
分享
function OnBegin()
NUMBER nResult;
STRING dir;
begin
dir = SRCDIR;
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
nResult = RegDBKeyExist ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{{9A25302D-30C0-39D9-BD6F-21E6EC160475}}");
if (nResult < 0) then
LaunchAppAndWait (SRCDIR^"soft\\vcredist_x86.exe","", LAAW_OPTION_WAIT);
endif;
// TO DO: you may change default non-UI setting, for example
//
// You may also perform your custom initialization steps, check requirements, etc.
end;
bool
InstallPage::checkCADInstalled(LPCTSTR pszProductCode)
{
bool found = false;
if (pszProductCode && pszProductCode[0]) {
MSIHANDLE hProduct = 0;
UINT iRet = MsiOpenProduct(pszProductCode, &hProduct);
bool flag = false;
switch (iRet)
{
case ERROR_SUCCESS:
flag = true;
break;
case ERROR_UNKNOWN_PRODUCT:
case ERROR_INVALID_PARAMETER:
case ERROR_INSTALL_SOURCE_ABSENT:
case ERROR_INSTALL_FAILURE:
case ERROR_BAD_CONFIGURATION:
default:
break;
}
if (flag) {
found = true;
MsiCloseHandle(hProduct);
} else {
GetManager()->ErrorBox(_T("检测失败"), _T("产品没有安装"));
}
}
return found;
}