Can output file directory be specified via command-line?
Asked Answered
F

1

6

I have an .nsi file which I call via command-line to output the installer, like this:

makensis fullPathToNsiScript

This creates the installer in the folder where my nsi script is. I need to output it to a specific folder, say desktop. Is it possible to do that via command line?

I know the correct way is to specify it in the script itself, like

OutFile "outputFileFullPath"

But is it possible to do via command-line assuming I'm only providing the base-name of the output file in the nsi script? Something like:

In script,

OutFile "outputFilename"

and then in command-line,

makensis fullPathToNsiScript "outputFileFullPath"

? The above obviously doesn't work.

Fritzsche answered 23/7, 2013 at 16:16 Comment(0)
S
11
makensis "/XOutFile $%temp%\test.exe" setup.nsi

(Running Makensis /? will show a similar example, /X can be used to execute any NSIS command)

The makensis.nsi example uses another tactic, specifying the outfile on the commandline is optional (/DOutFile=foo.exe makensis.nsi) and the script uses a !ifdef with a hard-coded fallback...

Scrophulariaceous answered 23/7, 2013 at 23:50 Comment(1)
the first one worked for me, but I had to remove OutFile command from original script.Fritzsche

© 2022 - 2024 — McMap. All rights reserved.