Archive: eXtract different files depending on the OS


eXtract different files depending on the OS
Hi all,

I want to extract different files depending on the OS version.

So in the installing section I would like to use something like:


File $actualOS\myDirectory\myOSspecificFile.ext

but this files on compiling as theres no such file.


What would be the right way to do this?

gracias

R :)


Use WinVer.nsh to determine the OS and extract the appropriate files.

${If} ${IsWin98}
File win98.txt
${Else} ${If} ${IsWinNT4}
File nt4.txt
${EndIf}

More detailed help
Hi,

I need the same solution to "Windows XP + 2000" (first option) and for Vista (second option). I don't know how to apply this code:


${If} ${IsWin98}
File win98.txt
${Else} ${If} ${IsWinNT4}
File nt4.txt
${EndIf}


in my nsis installer script.

Thanks in advance!

I assume based on your post that you DON'T want to install if they are on Windows 98 or ME? If so, this might be more appropriate:

${If} ${AtMostWinME}
MessageBox MB_OK "Windows too old"
${Else}
${If} ${IsAtMostWinXP}
; code for windows 2000/XP
${Else}
; code for Windows Vista
${EndIf}
${EndIf}


(PS: If you had posted your question like this in your original thread, you may have already gotten an answer.)

Your message was wrong! Here is the correct one!

# Installer sections
Section -Main SEC0000
${If} ${IsWin2000}
;code for Windows 2000
${Else}
${If} ${IsWinXP}
;code for Windows XP
${Else}
${If} ${IsWin2003}
;code for Windows 2003
${If} ${IsWinVista}
;code for Windows Vista
${Else}
${If} ${AtLeastWin2000}
MessageBox MB_OK "Running on Windows 2000 or better!"
Abort
${EndIf}
${EndIf}
${EndIf}
${EndIf}
${EndIf}