|
|
#1 |
|
Junior Member
Join Date: Oct 2005
Posts: 9
|
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 |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
!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 |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2005
Posts: 9
|
-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 |
|
|
|
|
|
#4 |
|
NSIS Dev
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
|
code: Then when you invoke makensis, provide /DparentDir=c:\foo\bar as a command line argument. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Oct 2005
Posts: 9
|
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 Last edited by jcao; 14th October 2005 at 13:57. |
|
|
|
|
|
#6 |
|
NSIS Dev
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
|
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. |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Oct 2005
Posts: 9
|
exec and execwait didn't work for me either same problem as !system.
|
|
|
|
|
|
#8 |
|
NSIS Dev
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
|
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. Last edited by iceman_k; 14th October 2005 at 16:29. |
|
|
|
|
|
#9 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Do you want to compile this script at compile time or at run time!??
-Stu |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Oct 2005
Posts: 9
|
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.
|
|
|
|
|
|
#11 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
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 |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Oct 2005
Posts: 9
|
Nice! Afrow that worked finally!
No more need for a function to find the $parentDir. thank you -JC |
|
|
|
|
|
#13 |
|
NSIS Dev
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
|
You still seem to be confused about runtime vs compiletime.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|