Archive: deny all operating systems except for a few


deny all operating systems except for a few
Hello,

I recently wrote asking how do I deny OS's. However, after talking with a few people and more scenarios occurred to us. All these what-ifs.

So I would like the installer to FAIL for EVERY OS, but ALLOW a few...

my pseudo code is as follows: (this is be rather phpish/crap)

Function .onInit

switch ($operatingSystem)
{
case "Windows 2000"; // all editions
goto success;
break;

case "Windows XP" // only pro version
GetVersion::WindowsType
if $R0 == "Home"
goto failure;
else;
goto success;
break;
case "Windows 2003"; // all editions
goto success;
break;
default:
goto failure;

...

function failure
msgbox "your $os is not supported. please call 1-800-555-5555 for additional support."

... pretty much 95,98,me should fail...so should vista all editions, and i dont know but XP 64-bit should fail too.

thanks for any help you can offer me :-)


this may help
dunno what api you were using to figure out the windows but i know HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion shows the operating system on XP and win2000

-Solwolf

**also i dunno why you would restrict Home Edition from XP it is the same program with less security features. program wise i don't see a difference of how it would run different.

i could understand not supporting 95,98,ME but i don't see why you can't just note where you download the software that it is ONLY tested and developed in the Windows 2k XP enviornment.


Well because my manager hates XP Home. So I told him I would do so. Currently the way I have it, i allow all but deny a few. we now want it deny all allow a few.

Pretty much 2000 is fully supported, XP Pro is, not home, not media center, not tablet, not CE, and not 64 bit

and all of vista is denied.

i am just following instructions from the above.

i am not sure if this works, it hasnt been tested yet


${If} ${IsWinXP}
# use afrow's plug-in here
GetVersion::WindowsType
Pop $R0
StrCmp $R0 "Home" xp_home_error go_away
${EndIf}

xp_home_error:
MessageBox MB_OK|MB_ICONSTOP "Windows XP Home Edition is not supported " IDOK
Quit

${If} ${IsWin95}
MessageBox MB_OK|MB_ICONSTOP "Windows 95 is not supported " IDOK
Quit
${EndIf}

${If} ${IsWin98}
MessageBox MB_OK|MB_ICONSTOP "Windows 98 is not supported" IDOK
Quit
${EndIf}

${If} ${IsWinMe}
MessageBox MB_OK|MB_ICONSTOP "Windows Millennium Edition is not supported " IDOK
Quit
${EndIf}

${If} ${IsWinNT4}
MessageBox MB_OK|MB_ICONSTOP "Windows NT is not supported " IDOK
Quit
${EndIf}


but i want to reverse the idea. this way i can allow operating systems one at a time as we support them. and some obscure one wont get through.

i am unsure how i can go by doing this

update to my question
The way I was tackling this was all wrong.
I still rather deny all OS's but allow a few easily.

I like to do soemthing like this

GetVersion::WindowsName
Pop $R0
StrCmp $R0 "XP" allow
StrCmp $R0 "2000" allow
StrCmp $R0 "Server 2003" allow
...
else deny

i dont see any ways like how i would do it in C to get this done.

the problem is, my prior code seemed not work work.

;${If} ${IsWinXP}
; # use afrow's plug-in here
; GetVersion::WindowsType
; Pop $R0
; StrCmp $R0 "Home" xp_home_error go_away
;${EndIf}

;xp_home_error:
; MessageBox MB_OK|MB_ICONSTOP "Windows XP Home Edition is not supported" IDOK
; Quit

;${If} ${IsWin95}
; MessageBox MB_OK|MB_ICONSTOP "Windows 95 is not supported" IDOK
; Quit
;${EndIf}

;${If} ${IsWin98}
; MessageBox MB_OK|MB_ICONSTOP "Windows 98 is not supported" IDOK
; Quit
;${EndIf}

;${If} ${IsWinMe}
; MessageBox MB_OK|MB_ICONSTOP "Windows Millennium Edition is not supported" IDOK
; Quit
;${EndIf}

;${If} ${IsWinNT4}
; MessageBox MB_OK|MB_ICONSTOP "Windows NT is not supported" IDOK
; Quit
;${EndIf}

;go_away:

and go away simply went with the rest of the prog.

what is happening is, win2k it seems is being detected as XP Home so it gets the error and quits.

i thought it would be easier to deny all but allow a few so some weird versions of windows cant slip through.

any ideas how to improve/change this?? i know ive asked this in hte past but i really am desperate in getting help right now onm htis! thanks so much!