Archive: getting makensis options within nsi-script


getting makensis options within nsi-script
Hi,
if I want to get the used makensis options within the nsi-script that is currently compiled I could use an additional define /D that contains this makensis command line. E.g.:

makensis.exe /DDef1 /DDef2 /DCL="/DDef1 /DDef2" myscript.nsi

But if the command line changes I have to ensure that this additional define is adapted too.

Is there another way to get the makensis command line within the script?


$CMDLINE


Thanks demiller9, but $CMDLINE contains the command line of the installer application. What I need is the command line of makensis.


What do you use the CL define for in your script?

Stu


Hi Afrow UK,
sorry for the late response. I hadn't much time last weeks.

The reason to get the makensis command line is the following:
I had to implement an installer that just should install/uninstall some files. The definition of these files should be done with wildcards which is not a problem. But to uninstall only that files that actually has been installed wildcards cannot be used.

As recommended in another thread of this forum I created a auxiliary exe (just a second nsi-script) that creates a text file with the list of all files to install/uninstall from the list containing wildcards. But the file list containing wildcards depends on defines like DEBUG that control which files to install. The same defines are used by the installer itself. So the auxiliary exe has to be compiled with the same makensis command line parameters (i.e. /D et cetera) like the installer itself. Than it will be called to create the text file and after that the installer is compiled using this created file.

Sure, I can use a batch file to perform this steps but I wanted to hide this process. I wanted to compile the auxiliary exe from within the installer during compilation by means of !system using the same command line parameters (at least the /D parameters). Another !system call is than used to run the auxiliary exe ...

Hope it's not too confusing ;-)


I see. You could post a feature request on the NSIS SourceForge page.

Stu


However, really you should pass those defines yourself. You won't be referencing defines in your script that haven't had their names hard-coded in...

Stu


Unknown defines could be ignored. But actually only hard-coded defines are passed. The problem is that I have to pass them twice.

But it's only a minor problem overall. I was only interested whether there is a NSIS feature that I doesn't know.
Thanks for your help.