Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible for 32 bit NSIS to launch a 64 bit program?

I'm porting a windows program from 32 -> 64 bit. It has a 32 bit installer which is written using NSIS. Can I launch one of my new 64 bit exes using the 32 bit NSIS installer? I don't think there is a 64 bit version of NSIS...

like image 737
Benj Avatar asked Nov 09 '09 11:11

Benj


People also ask

Can 32-bit computer run 64-bit programs?

Basically, due to the limit of 32-bit and 64-bit Windows operating systems, you can't run software, applications, and programs on Windows 10/8/7, even Vista, XP that doesn't match its version. In a word, you can't install and run 64-bit software on a 32-bit computer, or vice versa.

What does Nsis do?

NSIS (Nullsoft Scriptable Install System) is a tool that allows programmers to create such installers for Windows. It is released under an open source license and is completely free for any use. NSIS creates installers that are capable of installing, uninstalling, setting system settings, extracting files, etc.

How do you compile NSIS?

nsi file by simply right-clicking on it in Explorer and selecting 'compile'. If you want to use MakeNSIS on the command line, the syntax of makensis is: makensis [ option | script.


2 Answers

Sure you can, NSIS doesn't impose any restrictions and what's really nifty about NSIS is if you have both 32 and 64 bit versions of your app, you can do a combined installer, and install the required files on a per-architecture basis. e.g.

!include "x64.nsh"

${If} ${RunningX64}
    File ..\x64\blah.exe
${Else}
    File ..\x86\blah.exe
${EndIf}
like image 54
saschabeaumont Avatar answered Oct 21 '22 05:10

saschabeaumont


NSIS uses two Win32 APIs to execute processes ShellExecute (thru ExecShell) and CreateProcess (thru Exec and ExecWait), both of them can run 64 bit process (x64) from NSIS 32 bit process (as long as you're running on 64 bit OS).

like image 44
Shay Erlichmen Avatar answered Oct 21 '22 03:10

Shay Erlichmen