Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 12th May 2012, 19:01   #1
howzer
Junior Member
 
Join Date: Oct 2011
Posts: 7
MakeNsis with values

Hi,
When compiling a script through the command line, can you also pass values into the script, such as version number or target directory of the .exe?
Thanks,
Howard
howzer is offline   Reply With Quote
Old 12th May 2012, 20:12   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
Create defines with /D or execute commands with /X

It's all in the manual

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 15th May 2012, 12:46   #3
BreezeUADN
Junior Member
 
Join Date: Dec 2011
Posts: 13
Well I just had to do the same thing some time ago and here is an easy to modify example:
In a .bat -
SET STPNAME=test1
SET BASENSIS=%SOME_ROOT%\installMaker\config\installerBase.nsi
SET SETUPNAME=%SOME_ROOT%\installMaker\setup\%STPNAME%
makensis /DSectionsPath="%SETUPNAME%.nsh" /DOutFile="%SETUPNAME%" /V4 /PAUSE %BASENSIS%
(don't forget the "" thingies oherwise it won't work... sometimes)

then at the top of your nsi script put

!ifndef SectionsPath
!define SectionsPath "installerSections.nsh"
!endif
!include "${SectionsPath}"

!ifndef OutFile
!define OutFile "setup.exe"
!endif
OutFile "${OutFile}_${PRODUCT_VERSION}.exe"

you got the idea
BreezeUADN is offline   Reply With Quote
Old 16th May 2012, 08:04   #4
T.Slappy
Senior Member
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 365
Send a message via ICQ to T.Slappy
Maybe you could try my tool - Visual & Installer if you are using Visual Studio 2010.

You can set many MakeNsis options via Project Properties:



Download here: http://www.unsigned-softworks.sk/visual-installer/

Create cool looking Graphical Installers in NSIS: www.graphical-installer.com -see below
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned-softworks.sk
Develop NSIS projects directly in Visual Studio 2005-2012: www.unsigned-softworks.sk/visual-installer/
T.Slappy is offline   Reply With Quote
Reply
Go Back   Winamp 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