|
|
#1 |
|
Junior Member
Join Date: Jan 2009
Posts: 7
|
Check for Windows 7 / Seven
Hi,
is there any way to check if user is running Windows 7 ? Thanks and greets kando |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
|
WinVer.nsh will give you the version number, so check for >=6.1
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2009
Posts: 7
|
How to do that with WinVer.nsh ?
It offers me only the following functions and not getting the version number to compare it ? code: |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
It's slightly hidden away / not documented. Near the bottom of WinVer.nsh are the bits you'll want to peek at. Example:
code: |
|
|
|
|
|
#5 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Windows 7 has settled on 6.1? If so, we should add it to WinVer.nsh.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#6 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
The Release Candidate, Build 7100, is version 6.1, yes.
For confirmation.. download and install, or poke at a number of websites who have done so and peruse screenshots of the 'about screen' ![]() There was some talk of that 6.1 not being the case if they ever got around to implementing minwin but.. yeah |
|
|
|
|
|
#7 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
|
minwin was never a product, closest you get is server core
We don't know the build number until RTM, but using 6.1.0000 for now would probably work IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#8 | |
|
Moderator
|
Quote:
-Pawel My Website | NSIS PL | Winamp PL | Polish Winamp Online Help| Donate (Wsparcie) Winamp translations: Official Polish Language Pack | Official Polish Language Pack Extended Version Other Winamp projects: Winamp Color Themes | Winamp Icon Packs | Winamp Tools |
|
|
|
|
|
|
#9 | |
|
Junior Member
Join Date: Sep 2005
Location: Germany
Posts: 35
|
Quote:
http://msdn.microsoft.com/en-us/libr...33(VS.85).aspx (MSDN documentation "OSVERSIONINFOEX Structure" of function "GetVersionEx") Even if this piece of software is called "Windows Seven" the internal version number is "6.1"
This signature is currently on vacation! |
|
|
|
|
|
|
#10 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
That MSDN page also says Windows 2008 R2 has the same version number. Need to work around that one like we worked around Vista and 2008. Anders, care to handle this?
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#11 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
|
for those that can't wait for the next release, get it from http://nsis.svn.sourceforge.net/view...ude/WinVer.nsh
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#12 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Also, if anyone has Windows 7 and/or Windows Server 2008 R2, please add it to the WinVer test thread.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#13 | |
|
Moderator
|
Quote:
I want to test it, but what tool should I use? Should I use WinVer, from that thread? Is it updated to support win7? -Pawel My Website | NSIS PL | Winamp PL | Polish Winamp Online Help| Donate (Wsparcie) Winamp translations: Official Polish Language Pack | Official Polish Language Pack Extended Version Other Winamp projects: Winamp Color Themes | Winamp Icon Packs | Winamp Tools |
|
|
|
|
|
|
#14 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
The tool from the thread is version independent. The version attached there should work fine on Windows 7 as well.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#15 |
|
Senior Member
|
I can't seem to get Windows 7 to even show up with I pop the variable. I am using the latest WinVer.nsh that includes Win7 routines.
Any help is greatly appreciated. Please see my code. code: |
|
|
|
|
|
#16 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
You are using GetVersion plug-in and not WinVer.nsh. Use:
code: NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#17 |
|
Senior Member
|
oops,
thanks! (i think i used winver at one point in my life but switched i guess, i think my old codebase has it). |
|
|
|
|
|
#18 |
|
Senior Member
|
Okay.. I got a couple of more questions.
In GetVersion they have the ability to find home edition detection (probably why i used it to begin with), is WinVer.nsh going to detect the different SKUs of Home/Vista/7 (Home/Pro/Home Basic/Ultimate/...) Is there a way to detect that? Also, I like to detect anything below Win 95 (Windows 1.0 - 3.11). is there a way to detect < 95? (I know GetVersion does for example) Since I know GetVersion more, is my logic below correct? How do I get the version to display in the second message? code: Thanks so much! |
|
|
|
|
|
#19 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
|
lol, Win v1.
AFAIK, NSIS does not work on anything below v4 IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#20 |
|
Senior Member
|
I thought nsis did work with < 4.
I thought it can with 3.1 at least, though i never verified it. i thought i saw it in some forum. |
|
|
|
|
|
#21 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
|
Win 3.1 is 16bit, you would have to install Win32s on there
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#22 |
|
Senior Member
|
Okay but how do I determine the windows version using winver in the output?
code: That is generic code, so do i need to make an if for each version? I can't say : MessageBox MB_OK|MB_ICONSTOP "Windows ${WINVER} is .. " .. ? |
|
|
|
|
|
#23 |
|
Senior Member
|
My above code doeswnt seem to work. I tried changing And to AndIf and made no difference other than it allowed me to compile it.
I am unable to execute the installer. |
|
|
|
|
|
#24 |
|
Forum King
|
it would be lovely, if WinVer could make a check if the user is running a 64-bit system (whether its xp, vista or win7 etc.). something like ${Is64bit}/${Is32bit} would be very helpful!
|
|
|
|
|
|
#25 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
|
Quote:
IntOp $PostCount $PostCount + 1 |
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|