cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wm3866
Level 2

Check for XP Service Pack 2

I have looked through the online resources and have worked on this problem for an entire day and cannot figure out how I can get my install to find out if Windows XP Service Pack 2 is installed and then indicate to the user if it is not and abort the install. I have installshield 2009 Pro and have tried several things including writing script code (it is actually borrowed from one of the forums). The following is the code that I have placed in a custom action. I have registered that event with the install exec sequence as “”. It never gets executed (another issue). I have to say that for something that seems it should be relatively straight forward and very common it should not take this long or be this difficult. So I am figuring that I have missed something very basic. I wouldn’t have thought having to write a bunch of code for this ‘simple’ function would be the way to go. Any help would be greatly appreciated.

function CheckForXPSP2()
BOOL bAbort;
begin
bAbort = FALSE;
if (bAbort = FALSE) then
// WinXP SP2 or higher only
if ( SYSINFO.nWinMajor < 5 || (SYSINFO.nWinMajor = 5 && SYSINFO.nWinMinor < 1)) then
MessageBox("Windows XP Professional Service Pack 2 or above required.", SEVERE);
bAbort = TRUE;
endif;
endif;

if (bAbort = FALSE) then
if ( SYSINFO.nWinMajor = 5 && SYSINFO.nWinMinor = 1) then
if (SYSINFO.WINNT.nServicePack < 2) then
MessageBox("Windows XP Professional Service Pack 2 or above required.", SEVERE);
bAbort = TRUE;
endif;
endif;
endif;

if (bAbort = FALSE) then
// Ensure we are on XP Professional
if (SYSINFO.nSuites & ISOS_ST_XP_HOME) then
MessageBox("Installation of this product is not possible on systems running Windows XP Home Edition", SEVERE);
bAbort = TRUE;
endif;
endif;

if (bAbort = TRUE) then
abort;
endif;
return 0;
end;
Labels (1)
0 Kudos

(1) Reply
DebbieL
Level 17

Maybe you could try using the Windows Installer properties VersionNT and ServicePackLevel in a launch condition. You can specify launch conditions (plus the error message that's displayed if the conditions aren't met) in the Install Condition setting, which is in the Prroduct Properties grid in the General Information view.

I hope that helps.
0 Kudos