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.

4

1 回答 1

8
makensis "/XOutFile $%temp%\test.exe" setup.nsi

(运行Makensis /?会显示类似的例子,/X可以用来执行任何NSIS命令)

makensis.nsi 示例使用另一种策略,在命令行上指定输出文件是可选的 ( /DOutFile=foo.exe makensis.nsi) 并且脚本使用带有硬编码后备的 !ifdef...

于 2013-07-23T23:50:51.250 回答