Archive: GetWindowsVer


GetWindowsVer
  hello!

i have a small problem. i tried to fix this, but i don't know what to do. in my script i use GetWindowsVer for my shortcuts. if it is win9x platform i use rundll32 from WINDIR, else from SYSDIR. the problem is that the shortcut is created always with WINDIR path. a part from the script is attached. i do not understand this. i tested on WinXP, Win2000, and WinMe.

thanks.


Maybe it's related to LogicLib, try using standard commands.

Does rundll32 only exist in WINDIR on Win9x?


i will try and see the results.
rundll32 exists in:

windir - win9x
and
sysdir - winnt/2000/xp

thanks.

edit:

i modified the code to look like this :

Call GetWindowsVersion

MessageBox MB_OK "= $R0 ="
>Pop $R0
MessageBox MB_OK "= $R0 ="
the 1st message box show : "1"
and the second - nothing.

is this ok ?

The value of the first one has nothing to do with GetWindowsVersion.
The second one should show the version.

That means that the problem is related to GetWindowsVersion. Can you check the registry keys used by this function?


well, i got it - almost.

i changed $R0 to $R6 and it worked.

$R0 - i am using this a lot before this
$R6 - i am not using this in my script.

the funny thing is that after that, i changed back to $R0 and (surprise) it works. :igor: so at this point i can't make it to NOT work.

i revert my windows (system restore) and try again with $R6 or $R0 and it does NOT work. :igor: i don't get it.

if you want to investigate, i will attach the whole script.

thanks.

edit:

i tried with a messagebox inside the GetWindowsVersion function. i got the same result - nothing inside $R0.
maybe this is important - the function GetWindowsVersion is not in my script. i include it : " !include "include\WindowsVer.nsh"


Are you making a Codec Pack. If awnser yes
Then you arent the only one, me too

What do you really want.
Do you want to Detect the Windowd Version
and if it is Win98 then you want to create this
ShortCut

CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Matrix Mixer Configuration.lnk" "$WINDIR\rundll32.exe" '"$INSTDIR\MatrixMixer\matrix_mixer.ax",config'

Is this what you want?


Maybe at least you (o_owd) can answer Joost's question.

Can you check the registry keys used by this [GetWindowsVersion] function?

Just go to

http://nsis.sourceforge.net/archive/...31&instances=0

My Script :) :) :)


Originally posted by deguix
Maybe at least you (o_owd) can answer Joost's question.
i am working on it. i am checking. there's no need to jump up (deguix)...

Originally posted by VegetaSan
Just go to

http://nsis.sourceforge.net/archive/...31&instances=0

My Script :) :) :)
The link is wrong. Is going to NSIS Archive but not showing any page.

Just go to the NSIS Archive and search for
author "VegetaSan" and look for Windows Decection


There is already a Windows version detection function available. There is no need to create duplicate things.


Sorry didnt knew


I know it is not the same thing but I have a extrange problem with that function. I am trying to use the GetWindowsVersion updated by Joost:

I enclosed it to my install script and I have been trying it only in w2000. It runs ok. It returns '2000' correctly.

But now, I start to work in the links for my program for the start menu folder.

I added the registry key:
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${GROUP}\${APPNM}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
as it is shown in the startmenu.nsi example
and the GetWindowsVersion returns '' now!!

I have been doing some test and if I comment the last
!define the GetWindowsVersion returns again '2000'.

Can you tell me why?

Thanks.

Pedro


That should have nothing to do with this function.

Please attach a script that can be compiled on every system and reproduces this behavior.


well, i do not understand why it does not work.

a strange thing i noticed : i tested with my script (lets say "prog1") and it does not work. i created a new script that containes only GetWindowsVersion ("prog2"). i tested it (prog2) and, of course it works. but!!! after that i tested again my script (prog1) and it works too.

i don't know if you understand me, but i simply don't get it. maybe it's something that i don't see, something very simple. i run prog1 and it does not work. then i run prog2 - it works - and after that prog1 works too !?!

the whole script it's attached. :cry:
thanks.

PS: thanks Joost Verburg, pgpatron (i cannot reproduce that), VegetaSan, deguix, kichik, and all the others. thanks for your help and support, sorry for being sometimes a pain in the a.. .


Can you please attach a script that compiles on every system? I can't test this one.


Try to use dumpstate::debug before and after you call the function and after you pop a variable from stack (You can find that in the Archive -> Downloads section), and say the results it give.


thanks deguix! this really helped me.

i will attach a "smaller" script that should compile on every system. you only need dumpstate from the arhive. the link is above.

the first time i run it, it does not work.
if i run it again it works.

please tell me if you can reproduce this.

thanks.


What about a single GetWindowsVersion call? Does that work?

If it does the problem is related to something else.


SetOutPath "$INSTDIR\dataeasydeal"
File "dataeasydeal\data.mdb"
File "dataeasydeal\dealerinf.mdb"
File "dataeasydeal\rsharedveh.mdb"

;==================PARTAGE VÉRIF WIN==========================
StrCpy $1 "$windir"
IfFileExists "$1\winver.exe" +2
StrCpy $1 "$sysdir"
GetDllVersion "$1\winver.exe" $R0 $R1
IntOp $R2 $R0 / 0x00010000
IntOp $R3 $R0 & 0x0000FFFF
IntOp $R4 $R1 / 0x00010000
IntOp $R5 $R1 & 0x0000FFFF
StrCpy $0 "$R2.$R3.$R4.$R5"

StrCmp $0 '5.1.2600.0' WinXP NotWinXP
WinXP:
messagebox mb_ok "Ver = XP"
nsExec::Exec 'net share dataeasydeal=c:\dataeasydeal'
NotWinXP:

StrCmp $0 '4.0.1381.336' WinNT NotWinNT
WinNT:
messagebox mb_ok "Ver = NT"
NotWinNT:

StrCmp $0 '5.0.2195.6703' Win2000 NotWin2000
Win2000:
messagebox mb_ok "Ver = 2000"
NotWin2000:

StrCmp $0 '5.2.3790.0' Win2003 NotWin2003
Win2003:
messagebox mb_ok "Ver = 2003"
NotWin2003:

StrCmp $0 '4.10.0.2222' Win98 NotWin98
Win98:
messagebox mb_ok "Ver = 98"
NotWin98:

; 2003 = 5.2.3790.0
; XP = 5.1.2600.0
; 2K = 5.0.2195.6703
; NT = 4.0.1381.336
; ME = 4.90.0.3000
; 98SE = 4.10.0.2222
; 98 = 4.10.0.1998
; 95S2 = ???
; 95 = 4.00.950