Old 18th February 2010, 15:31   #1
deanbayley
Junior Member
 
Join Date: Dec 2006
Posts: 10
Creating Multiple Installers At Compile Time

Hi guys..

Can NSIS create multiple installers at compile time, i want it to create:

  • Product_Name_2000-XP_SP2.exe
  • Product_Name_XP_SP3_Vista-7.exe

The 2000 XP one will have 2 sections missing, one section checks if the windows installer is up to date and the second installs the .NET framework v2..

My installer is 35mb and about 24mb is for the framework and windows installer v3..

I know i could make the installer download the files only if required but where my application is deployed customers often download on 1 machine and install on another...

D.
deanbayley is offline   Reply With Quote
Old 19th February 2010, 07:56   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
It's not really clear to me what it is you want. Do you want to make two installers? Just use two .nsi files, then.
MSG is offline   Reply With Quote
Old 19th February 2010, 12:35   #3
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
I suppose you want to create two installers with one script.
As far as I know this is not possible.

What you can do is to put all shared code in a nsh header, and include this header into two seperate scripts with the OS specific code.
jpderuiter is offline   Reply With Quote
Old 19th February 2010, 13:22   #4
rsvargas
Junior Member
 
Join Date: Apr 2008
Location: Florianópolis, SC - Brazil
Posts: 16
Send a message via ICQ to rsvargas
I've asked the same question once (here), and as far as I know, it is not possible.

I still needed to create two installers with one script this is what I did:

I've put the sections I needed to be on one installer but not in the other inside "!if" clauses, like this:

PHP Code:
!if INSTALL_TYPE == "TYPE_FULL"
Section OnlyInFull
 
... ; the files that go in this section
SectionEnd
!endif 
then in the beginning of the file, I create a "!define" that can be defined optionally by the command line compiler

PHP Code:
!ifndef INSTALL_TYPE
  
!define INSTALL_TYPE "TYPE_FULL"
!endif 
finally I've created a .bat file that executes the compiler two times:

code:

makensis.exe /DINSTALL_TYPE="TYPE_FULL" script.nsi
makensis.exe /DINSTALL_TYPE="TYPE_NOT_FULL" script.nsi



actually you can call the second time without the /D option, but I've put there for clarity.
rsvargas is offline   Reply With Quote
Old 11th March 2010, 08:44   #5
ssssss
Junior Member
 
Join Date: Mar 2010
Posts: 4
rsvargas
It's a good solution, but there's one mistake (misprint). Must be:
code:
!if ${INSTALL_TYPE} == "TYPE_FULL"
...
!endif

ssssss is offline   Reply With Quote
Old 11th March 2010, 11:00   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
In fact it really should be:
code:
!if `${INSTALL_TYPE}` == `TYPE_FULL`
...
!endif


Notice the quotes around ${INSTALL_TYPE}. Without them, and if INSTALL_TYPE is undefined or empty, your script will not compile.

(FYI I use `` as primary quotes followed by ' and ").

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump