0

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;   
user981848
  • 295
  • 2
  • 4
  • 14

1 Answers1

1

The Installscript MSI project type is riddled with bugs and problems - just so that has been communicated. Particularly relating to upgrade scenarios in my experience. I would never use this project type.

Apart from that it is not clear what you are asking if that script works? I suppose you could have a look at what these scripts are doing (the registry locations they check):

Maybe update your question if this is not what you are asking?

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • I am new to installshield. Here is my understanding: Because SQL Express is defined as a setup prerequisite, it will be installed first before any custom actions defined in the script. My question is how to inject the checking before running the prerequisite? I have tried to chain two .msi and let the first one to check the system condition and the second one to install the product. If the check passes, it will call the second installer. However, my test shows that the prerequisite defined in the second .msi is ignored during the chained execution. – user981848 Feb 21 '18 at 14:45