Archive: Win64 and WinCE


Win64 and WinCE
Hi all,

1) Can one create with NSIS installers that run on Windows 64 bits?
2) What about Windows CE?

Thanks,
Viv


Windows x64 supports 32-bit executables, so any installer you create will run on Windows x64. Windows CE is a different story. There are pages in the Wiki explaining how to install files to a PDA. For example:

http://nsis.sourceforge.net/NSIS_for_Smartphone


For your first question, I will elaborate on what kichik said...
First off, Windows XP x64 does support using 32-bit installers, however, is unable to use NSIS to install 64-bit programs because the NSIS program itself must be 64-bit in order to identify correctly with Windows XP x64.... That can definitely be a problem, since programs that are 32-bit are redirected to "C:\Program Files (x86)" and 64-bit ones are directed to "C:\Program Files"... This means that if the installer is not 64-bit, it will identify the program wrong and install it in the wrong location. At the moment, NSIS is safe with very few people actually using x64. We need to be ready for Vista, which will start the x64 boom. If there are developers with Windows XP x64 machines, they need to start compiling 64-bit versions of NSIS and packaging them for distribution, or at least experimenting with it...
For your second question, all I can tell you is that you would have to be very careful, since the subset of Win32 can really hurt many different programs trying to port to WinCE or run toward WinCE.


I don't believe this to be true. There are quite a few 32bit installers, that correctly install x64 applications. The installer does itself not need to be 64bit.

Infact, there are major DISADVANTAGES to making NSIS 64bit.

If you make a 64bit NSIS install, it will only install on x64, wheras a 32bit NSIS can detect x64, and install the appropiate binaries, so you can have a single EXE that distributes x86 and x64 binaries.


You could build a single wrapper binary that is 32-bit that detects whether you are using a 32-bit or 64-bit OS, then extract the appropriate one (32-bit installer or 64-bit installer) and run it... Then when it completes installation, the wrapper deletes the install file... I believe this is better, because you will not require code to override Windows XP x64's capability to detect 32-bit/64-bit installers and redirect to appropriate install points.... I am not quite sure, but if you compile the compiler and the NSIS system to x64, then it will produce 64-bit installers.... I am not sure though....


what about 32-bit progs in 64-bit win
I have a 32-bit program but would like to test it in a 64-bit environment. However, the installer won't let me get that far. How can I install this in 64-bit. I rather not go to InstallShield route.


Windows x64 should be able to run 32-bit installers without any problem. What's exactly your problem?


Before the installer starts I get an error message complaining about not meeting requirements. I do not have the error verbatim I was given a summary by somebody that uses our software out of the office.


NSIS has no built-in check for any requirements. It's probably your code that does that check.


My code does check for operating systems but I only deny Windows 95, 98, and Me.

2000 and above are approved. i read the string is the same as 2003 server and i have no problems installing on 32-bit Win2k3 server.

i googled around and i read somebody else having the same exact error...though i cant find the article now.


Your code might not have the proper check. Upload the code for a review. If you can't, my only suggestion is that you use WinVer.nsh instead of whatever you have their right now.


You could update to NSIS v2.21 at least.


Oh, before I forget, I might be good for you to know I CAN install on Win64 via my NSIS Win32 installer script.

So at least you know it CAN be done, now only you have to find your defect in your script.... mybe it is a little reassuring to you.


i use:
Function GetWindowsVersion

Push $R0
Push $R1

ClearErrors

ReadRegStr $R0 HKLM \
"SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion

IfErrors 0 lbl_winnt

; we are not NT
ReadRegStr $R0 HKLM \
"SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber

StrCpy $R1 $R0 1
StrCmp $R1 '4' 0 lbl_error

StrCpy $R1 $R0 3

StrCmp $R1 '4.0' lbl_win32_95
StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98

lbl_win32_95:
StrCpy $R0 '95'
MessageBox MB_OK|MB_ICONSTOP "Windows 95 is not supported by the " IDOK
Quit
Goto lbl_done

lbl_win32_98:
StrCpy $R0 '98'
MessageBox MB_OK|MB_ICONSTOP "Windows 98 is not supported by the " IDOK
Quit
Goto lbl_done

lbl_win32_ME:
StrCpy $R0 'ME'
MessageBox MB_OK|MB_ICONSTOP "Windows Millennium Edition " IDOK
Quit
Goto lbl_done

lbl_winnt:

StrCpy $R1 $R0 1

StrCmp $R1 '3' lbl_winnt_x
StrCmp $R1 '4' lbl_winnt_x

StrCpy $R1 $R0 3

StrCmp $R1 '5.0' lbl_winnt_2000
StrCmp $R1 '5.1' lbl_winnt_XP
StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error

lbl_winnt_x:
StrCpy $R0 "NT $R0" 6
MessageBox MB_OK|MB_ICONSTOP "Windows NT is not supported by " IDOK
Quit
Goto lbl_done

lbl_winnt_2000:
Strcpy $R0 '2000'
Goto lbl_done

lbl_winnt_XP:
ReadRegDWORD $R5 HKLM "SYSTEM\ControlSet001\Control\ProductOptions" ProductSuite
StrCmp $R5 'Personal' home_error lbl_done

lbl_winnt_2003:
Strcpy $R0 '2003'
Goto lbl_done

home_error:
MessageBox MB_OK|MB_ICONSTOP "Windows XP Home Edition is not supported (this doesnt seem to work at all)" IDOK
Quit
Goto lbl_done

lbl_error:
Strcpy $R0 ''

lbl_done:
Pop $R1
Exch $R0
FunctionEnd


thsi is called here:
Function .onInit
Call GetWindowsVersion


i have not received the error from the end-user that is having this problems. thats why i wanted to see if it was the script, not sure.


when i say it doesnt work at all for home i mean home detection doesnt work....


If it can be useful to somebody i have compiled nsis with the x64 compiler of the PSDK for Windows Server 2003 R2.

Here the link to the x64 installer:
http://cedric.arnault.free.fr/nsis/n...uild-setup.exe

The system plugin isn't fully operationnal, because of the new calling convention used in win64.


Afrow's version plug-in can tell you if you're using Home or not. Use it along with WinVer.nsh instead of the current test you have. It calls a defined API that is documented to return exactly that.


how do i include winver.nsh. i just downloaded the latest version of NSIS compiler. i betcha that is why it wasnt working on the 64-bit systems. i was using 2.16 i believe.


it seems i can just do strcmp by using afrow's function right?

or i use afrows function to detect if it is xp and if it is xp detect if it is pro/home, so i can deny/allow it to install.


To include WinVer.nsh, simply use !include. 2.16 should have been working with Windows x64, that's not the reason. It just didn't have WinVer.nsh which is a better way to detect the Windows version.

!include WinVer.nsh
# ...
${If} ${IsWinXP}
# use afrow's plug-in here
${EndIf}

And I imagine i can use the same idea for denying 95, 98, and Me?


Yes.


I currently don't have access to all the OS's right now to test, but did i use this correctly?



Function .onInit


${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}

..... rest of install code....

....then diff files copy....

${If} ${IsWinXP}
Goto section_xp
${EndIf}

${If} ${IsWin2000}
Goto section_2000
${EndIf}

...then the rest of the code and wraps up


Yes, it seems correct.


thanks very much kichik for all your help and patience. :-)