Old 23rd September 2010, 07:06   #1
nv_rajanikanth
Junior Member
 
Join Date: Jun 2010
Posts: 20
Help me in fixing the compilation error.

.
.
.
Var /GLOBAL srcpath
StrCpy $srcpath_ado "C:\Official\myproject\myproject\Release"

File /oname=temp\ $srcpath\rk.exe
.
.
.
getting the following error during compilation
File: "$srcpath\rk.exe" -> no files found.

if i give exact path instead of variable $srcpath it is working fine. But i want to use a variable for that...coz i need to us this at multiple times in the file & also want to get this path using 'Locate'

Thanks.
nv_rajanikanth is offline   Reply With Quote
Old 23rd September 2010, 07:19   #2
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
First of all, you use $srcpath_ado as a variable in the StrCpy command, while you use $srcpath in the File command.

But the real problem is that a variable is for runtime, while the File command is a compiletime command (at least the filesource parameter).

You should use a define instead, like
code:
!define SRCPATH "C:\Official\myproject\myproject\Release"
...
File /oname=temp\ ${SRCPATH}\rk.exe

jpderuiter is offline   Reply With Quote
Old 23rd September 2010, 08:51   #3
nv_rajanikanth
Junior Member
 
Join Date: Jun 2010
Posts: 20
Thanks Jpderuiter for the quick response.

but in some cases I am getting this srcpath from 'Locate' vai $R0 copying from $R9
so in that case how can i use this 'File' command
nv_rajanikanth is offline   Reply With Quote
Old 23rd September 2010, 09:11   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You're still confusing run time and compile time. How can the compiler compress a file at compile time when the path is only known at run time? If you need to specify the path to extract to use SetOutPath or use the File /oname= switch (read the ... manual).

Stu
Afrow UK is offline   Reply With Quote
Old 23rd September 2010, 09:27   #5
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
If you think about it: Locate will give you a location on the PC of the client who is running your installer (Runtime), while you want to include files with the File command from your development PC (Compiletime).
That's obviously not going to work together.
jpderuiter is offline   Reply With Quote
Old 23rd September 2010, 09:42   #6
nv_rajanikanth
Junior Member
 
Join Date: Jun 2010
Posts: 20
thank you.
How to add an empty folder to $INSTDIR. coz i want to copy few of the files/folders in it during compile time.

File /oname=temp\ ${SRCPATH}\rk.exe
it seems in the above example installer is not creating 'temp' folder.
getting runtime error & asking for aborting.

Last edited by nv_rajanikanth; 23rd September 2010 at 10:19.
nv_rajanikanth is offline   Reply With Quote
Old 23rd September 2010, 10:23   #7
nv_rajanikanth
Junior Member
 
Join Date: Jun 2010
Posts: 20
i tried as follows & is working fine.

SetOutPath $INSTDIR\temp
File ${SRCPATH}\rk.exe
nv_rajanikanth is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump