SunToo
1st June 2007 10:14 UTC
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?
demiller9
1st June 2007 23:59 UTC
$CMDLINE
SunToo
4th June 2007 09:08 UTC
Thanks demiller9, but $CMDLINE contains the command line of the installer application. What I need is the command line of makensis.
Afrow UK
4th June 2007 13:44 UTC
What do you use the CL define for in your script?
Stu
SunToo
19th June 2007 07:53 UTC
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 ;-)
Afrow UK
19th June 2007 10:12 UTC
I see. You could post a feature request on the NSIS SourceForge page.
Stu
Afrow UK
19th June 2007 10:14 UTC
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
SunToo
19th June 2007 10:40 UTC
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.