Archive: VARIABLE PROBLEM plz HELP


VARIABLE PROBLEM plz HELP
Can anyone tell me how to allow variables within !system?

currently the following line of script doesn't work:
-------------------------------------------------------
!system '""${NSISDIR}\makensis.exe" "$parentDir\NSIS Install Scripts\CreateUIServerEXE.nsi""'
-------------------------------------------------------

The error output is the following:
-------------------------------------------------------
Can't open script "$parentDir\NSIS Install Scripts\CreateUIServerEXE.nsi"
!system: returned 1
-------------------------------------------------------

I have checked using Message boxes that the variable "parentDir" actually contains "C:/installer" however when inserted as an argument for !system, only the variable name appears! But, this is not true for the variable NSISDIR!

If I change the line to NOT include variables then I get NO complaints from the compiler, however I need a variable path and NOT a static path.

can anyone help?

-JC


!system is a compile-time instruction. Variables like $parentDir is for run-time. Hopefully you can now see the problem without me having to explain it.

-Stu


-Gotcha, thanks!

So, what would be the solution to my problem? I would like to use the windows command.exe to execute the makefile.exe and compile a certain script on a directory that varies.

*Is there another way to compile the external *.nsi script within the current *.nsi script?

-JC



!system '""${NSISDIR}\makensis.exe" "${parentDir}\NSIS Install Scripts\CreateUIServerEXE.nsi""'


Then when you invoke makensis, provide /DparentDir=c:\foo\bar as a command line argument.

That doesn't work because /DparentDir=$VARIABLE is not possible. What happens is that the name of the $VARIABLE [not the contents] will be displayed when executing the !system command :S
The following code should demonstrate what I'm trying to do. However it doesn't work, !system will not make use of runtime variables and compiler time variables will NOT be set to runtime variables...

;----------------- CREATE UISERVER.EXE

push $EXEDIR
call GetParentDir
pop $R0 ;parent directory now stored in $R0
var /global parentDir
strcpy $parentDir $R0
!system '""${NSISDIR}\makensis.exe" "$parentDir\NSIS_Install_Scripts\CreateUIServerEXE.nsi""'
;----------------- END CREATION OF UISERVER.EXE


You are mixing runtime and compiletime commands.
$VARIABLE is only available at runtime.
!system is only available at compiletime.
If you really need $VARIABLE, use Exec, ExecWait or the nsExec plugin instead of !system.


exec and execwait didn't work for me either same problem as !system.


Works for me. See attached example of Exec working with $parentDir.

p.s. You may have too many quotes in your command line. Try simplifying it.


Do you want to compile this script at compile time or at run time!??

-Stu


It doesn't matter wether I compile the script at compile time or run time. I just want to create the UIServer.exe before I package it into an installer becaue currently the launcher is a *.bat file and I need it to be a *.exe file.


Are you sure it doesn't matter? Run time is when the user runs your installer! I don't think the average user will have makensis (NSIS) installed on his computer!

If you want it done on your system then you want it done on compile time with !system. If $parentDir is just the parent directory of the NSIS script location, then just use .. instead of $parentDir.

-Stu


Nice! Afrow that worked finally!
No more need for a function to find the $parentDir.

thank you

-JC


You still seem to be confused about runtime vs compiletime.