- NSIS Discussion
- Concatenation for OutFile
Archive: Concatenation for OutFile
Larsen
15th February 2006 15:54 UTC
Concatenation for OutFile
Hello,
I want to create the outfile in a directory that contains the version, e.g. "c:\output\${version}\setup.exe"
I guess I can create that directory with a !system call. The main problem is that I cannot use StrCpy to set the value:
strcpy $var1 "c:\output\${version}"
#enter system call to create the directory here =)
outfile "$var1\setup.exe"
This is not possible as strcpy is not allowed outside a section.
Is there anyone who would like to create a patch that the outfile directory is created if non-existent?
How can I solve this problem?
Lars
dienjd
15th February 2006 16:04 UTC
I'm a little confused. Couldn't you do:
CreateDirectory "${version}"
SetOutPath "${version}"
Larsen
15th February 2006 16:08 UTC
Hello dienjd,
it´s not about the system, where the program is to be installed, but about the system, where I create the setup.
I want to keep a history of recent setups and don´t want to have them all in just one directory.
dienjd
15th February 2006 16:15 UTC
Ah, sorry about that. I completely misunderstood your original post :)
A quick suggestion would be to make a batch file that creates your ${version} directory and then compiles your NSI script to output your EXE into your newly created directory.
Another option would be to just append your ${version} value to your EXE's filename--that would leave all your builds in 1 directory though.
Larsen
15th February 2006 16:46 UTC
Originally posted by dienjd
Ah, sorry about that. I completely misunderstood your original post :)
Nevermind, it seems like I´m not good in explaining things :)
A quick suggestion would be to make a batch file that creates your ${version} directory and then compiles your NSI script to output your EXE into your newly created directory.
So, I have to create a batch file that accepts the version number as a parameter, creates the directory and starts the compile script. The compile script also accepts the version number as a parameter.
Is this what you thought of?
Another option would be to just append your ${version} value to your EXE's filename--that would leave all your builds in 1 directory though.
That´s the way I already have it :)
dienjd
15th February 2006 16:54 UTC
So, I have to create a batch file that accepts the version number as a parameter, creates the directory and starts the compile script. The compile script also accepts the version number as a parameter.
Is this what you thought of?
Exactly. That should work. You can also look into automated building tools that are a little more user-friendly than batch files (e.g.,
http://finalbuilder.com, http://ant.apache.org/), but that may be overkill if all you want to automate is creating a new directory and having your EXE go there.
Larsen
15th February 2006 17:30 UTC
Thanks for your help!
I´ll have a look into those building tools.
Lars
kichik
24th February 2006 11:58 UTC
You can create the directory from within the script using:
!system "mkdir ${version}"
dienjd
24th February 2006 15:40 UTC
Originally posted by kichik
You can create the directory from within the script using:
!system "mkdir ${version}"
Nice, I didn't know about that command. Using it with 'subst' lets you create directories even on unmapped network shares. Very handy.
Larsen
28th February 2006 11:10 UTC
Originally posted by kichik
You can create the directory from within the script using:
!system "mkdir ${version}"
Yeah, great! Exactly what I was looking for.
Thank you very much!
Lars