Page 1 of 1

detect xp and win7 and install files

Posted: Thu Aug 16, 2012 1:22 am
by kishorkk23
Hi,
We have a software which needs diff files to be installed based on the Operating system.
I would like to know the procedure that can be followed to do the same.
During installation it should select which files to be installed based on OS.

My problems:
1) How to detect xp or win 7 ?
2) Once detected how will IA install files based on that?

Re: detect xp and win7 and install files

Posted: Thu Aug 16, 2012 6:46 am
by Adam
Here's what I do:

Code: Select all

Comment: Set system settings for the rest of the installer
Get Exact OS Level into CURRENTOS
Get System Setting Windows in 64 bit Mode into OS64
 
Comment: Set the Kernel Version
if Variable CURRENTOS Equals XP
  Set Variable KERNEL to 5.2
end
if Variable CURRENTOS Equals 2003
  Set Variable KERNEL to 5.2
end
if Variable CURRENTOS Equals VISTA
  Set Variable KERNEL to 6.0
end
if Variable CURRENTOS Equals 2008
  Set Variable KERNEL to 6.0
end
if Variable CURRENTOS Equals SEVEN
  Set Variable KERNEL to 6.1
end
if Variable CURRENTOS Equals 2008R2
  Set Variable KERNEL to 6.1
end
if Variable CURRENTOS Equals METRO
  Set Variable KERNEL to 6.2
end
if Variable CURRENTOS Equals SERVER8
  Set Variable KERNEL to 6.2
end
Then I do:

Code: Select all

if Variable KERNEL not Greater Than (Version) 5.99
  XP/2003 stuff here
end

if Variable KERNEL Greater Than (Version) 5.99
  Vista or newer stuff here
end
Is there a command to get the actual Kernel version without having to do all my if's above? I couldn't find one, but might have over looked something.

Cheers
Adam

Re: detect xp and win7 and install files

Posted: Thu Aug 16, 2012 8:57 am
by FrancescoT
Dear Guys,

you can use "Get System Setting" command to obtain the OS edition (as Win XP, Vista, Win 7 and so on).
With the same you can get Service Pack Informations.

Otherwise, as Adam suggested, Get Exact OS Level.

Regards

Re: detect xp and win7 and install files

Posted: Tue Aug 21, 2012 7:12 am
by kishorkk23
Thanks Adam and Franc...
Get System Setting did work :)...