- NSIS Discussion
- give a variable to script and build it automaticly
Archive: give a variable to script and build it automaticly
ssam
28th May 2008 11:25 UTC
give a variable to script and build it automaticly
i copy my files every night to a specific folder and than i want to build the installer. filenames and directory names and filestructure are the same.
now i want to give the installerscript the specific path where my files are and then i want to start the script to build the installer.
how i can give the path to the script to use them?
pospec
28th May 2008 11:35 UTC
Try this:
!define MY_PATH "C:\My Path"
...
File ${MY_PATH}\*.*
(Still not interested in my replies? ;))
Afrow UK
28th May 2008 12:04 UTC
Make sure ${MY_PATH}\*.* is in quotes or you will get a compile error (assuming the path contains spaces).
Stu
ssam
29th May 2008 07:51 UTC
automatic.bat
Java My_copytool.jar "Path where my Files be copied"
NSIS installer.nsi "Path where my Files be copied"
installer.nsi
!define MY_PATH "here i want to use 'Path where my Files be copied'"
i dont want to change my installer.nsi, if i change the path, where my files are.
pospec
29th May 2008 08:04 UTC
You don't need to change your script, use parameter /D when calling makensis command. Reading documentation is a good idea before posting here on forum - http://nsis.sourceforge.net/Docs/Chapter3.html#3.1
ssam
29th May 2008 09:05 UTC
so is this correct?
Java My_copytool.jar "c:\example\copy"
makensis.exe /D !define MY_PATH "c:\example\copy" myscript.nsi
myscript.nsi
SetOutPath '$INSTDIR$\bin'
File '${MY_PATH}\bin\test.cfg'
pospec
29th May 2008 09:09 UTC
No, it isn't.
ssam
29th May 2008 09:21 UTC
makensis.exe /DUSE_UPX /DVERSION=1.337 /DNO_IMAGES myscript.nsi
this is the example
but what means this?
1 !define USE_UPX VERSION=1.337 NO_IMAGES
or
2 !define USE_UPX
!define VERSION=1.337
!define NO_IMAGES
pospec
29th May 2008 09:59 UTC
1. It produces compiler error, it is wrong.
2. These three lines are equivalent to your (correct) makensis syntax on first line of your last post.
ssam
29th May 2008 10:27 UTC
so is this correct?
Java My_copytool.jar "c:\example\copy"
makensis.exe /DMY_PATH "c:\example\copy" myscript.nsi
myscript.nsi
SetOutPath '$INSTDIR$\bin'
File '${MY_PATH}\bin\test.cfg'
pospec
29th May 2008 11:03 UTC
It seems to be so.
ssam
13th June 2008 09:56 UTC
so prospec, it is not correct
c:\programme\nsis\makensis.exe /DMy_Var="myPath" "my_script.nsi"
Afrow UK
13th June 2008 10:49 UTC
Yes you need the =. This is all documented!!
Stu
Afrow UK
13th June 2008 16:53 UTC
Posts deleted. Please don't argue chaps!
Stu
LoRd_MuldeR
13th June 2008 17:00 UTC
I think if your path contains spaces, you must do it like this:
makensis.exe /DMYVAR="C:\Some Folder\Some File.foo" Installer.nsi
However when passing arguments to the installer itself, you must do it like this:
Installer.exe "/MYARG=C:\Some Folder\Some File.foo"