Our installer which is created using installshield as installscript MSI project type will install SQL Express 2014 SP(x64) as a prerequisite. However, when the system has a pending reboot, SQL express installation will fail. We would like the installer to check if the system has a pending reboot before installing SQL express. Currently, SQL express is defined as setup prerequisite.
what is the best way to make this checking to happen before SQL Express installation?
The following code checks the system pending reboot condition and it works as expected.
function CheckSystemReboot(hMSI)
OBJECT objSysInfo;
string szMsg;
NUMBER nReturn;
begin
// TODO: Perform custom initialization steps, check requirements, etc.
set objSysInfo = GetObject("");
set objSysInfo = CreateObject("Microsoft.Update.SystemInfo");
if IsObject(objSysInfo) then
if objSysInfo.RebootRequired then
szMsg ="A system reboot is pending. Please reboot your system before
installing this product";
MessageBox ( szMsg , SEVERE );
return ERROR_INSTALL_FAILURE;
else //test only
szMsg = "A system reboot is not needed";
MessageBox ( szMsg , SEVERE );
return ERROR_SUCCESS ;
endif;
endif;
end;