添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Bugs item #1556907, was opened at 2006-09-12 10:58
Message generated for change (Comment added) made by kichik
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=373085&aid=1556907&group_id=22049
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: Scripting
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Amir Szekely (kichik)
Summary: File /r doesn't work with paths as variables
Initial Comment:
NSIS version 2.20
If it's used the instruction "file /r" with a path
absolute or relative writen as a constant (that is
between '"'), it works propperly but if it's used with
a variable with value the path used previously the
compiler fails, a "no files found" error is sent. 
An excerpt of the code I been using and the error it
produces is written next:
StrCpy $COMPONENT_DIR "F:\Utiles\NSIS\pruebas\pru\*.*"
DetailPrint "$COMPONENT_DIR"
#the next line fails
File /r $COMPONENT_DIR
#if discommented the next line works properly
#File /r "F:\Utiles\NSIS\pruebas\pru\*.*"
Error:
File: "$COMPONENT_DIR" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]]
filespec [...] |
   /oname=outfile one_file_only)
Error in script
"F:\Utiles\NSIS\pruebas\InstaladorSimple.nsi" on line
25 -- aborting creation process
edu...@am...
----------------------------------------------------------------------
>Comment By: Amir Szekely (kichik)
Date: 2006-09-15 09:59
Message:
Logged In: YES 
user_id=584402
Of course it doesn't work... Think about it, $COMPONENT_DIR
only gets its value on runtime. The code runs on the user
computer. You can, for example, copy $INSTDIR into
$COMPONENT_DIR. $INSTDIR, as you know, can be changed by the
user. The compiler can't predict what the user will choose.
You probably want to use !define.
!define COMPONENT_DIR F:\Utils\...
File /r "${COMPONENT_DIR}"
----------------------------------------------------------------------
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=373085&aid=1556907&group_id=22049
Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads) More information about our ad policies

Ad destination/click URL: