|
|
#1 |
|
Guest
Posts: n/a
|
what's wrong here?
Hi,
I desperately try to create a string variable holding a path of my files. that works but when i try to use the File function with this path plus the filenames i get a compiler error "File: "$setupDir\ttrainer.exe" -> no files found." this means the string isn't concatenated correctly. but what's wrong, this is a simple concatenation like i viewed in other example files??? the script looks like this: Var setupDir Section "Install" ... StrCpy $setupDir "c:\projects\ttrainer\setup" File "$setupDir\ttrainer.exe" ... |
|
|
|
#2 |
|
Major Dude
|
that won't work.
if you use the file command like this, it will do the following: 1. Pack the file u've specified into the installer at compile time. in your case, it searched for the file "$setupDir\ttrainer.exe" which doesn't exist, because the (absolute, not relative) directory "$setupDir" doesn't exist on your system. thats what causes your error. 2. extract the file at runtime to the current path contained by $OUTDIR. please read the docs about correct usage of the file-command. hand by comm@nder21 ---------- WiKi pages:CreateInternetShortcut|Enhanced FindWindow|Parse CSV-Data|Open/Close CD-Drive|Installer without Icon|Vista application compatibility |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
StrCpy is a run-time command, and thus will set the value of $setupDir on run-time. And so, the compiler will look for the path "$setupDir\ttrainer.exe" not "c:\projects\ttrainer\setup\ttrainer.exe" on compile (it will ignore $setupDir as a variable).
You should be using !defines, rather than waste memory on new variables. E.g. code: -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
|
Finally they want to say that File (in your variant) command defines source location on your system of a file to be packed. ${setupDir} will be defined at a runtime, so compiller fails. To set file location on the user's system use File /oname parameter or SetOutPath runtime command.
SetOutPath $SYSDIR File "/oname=MerryGoRound.scr" "..\bin\mgr_en.scr" SetOutPath $INSTDIR File "/oname=MerryGoRound.exe" "..\bin\mgr_en.exe" File "..\en\Readme.htm" NSIS docs could be much better ![]() Have fun
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|