Old 19th May 2011, 13:35   #1
franz.reitner
Junior Member
 
Join Date: Feb 2010
Posts: 14
File command

Since the name file is very common it's very hard to find an answer to my question. In case there is a double post now, please forgive me. Searching for 'file' and 'variable' gives me 700 pages to read...

Is it possible to do something like:
StrCpy $R0 "file.txt"
File $R0

I want to use the File command with a variable as parameter.
franz.reitner is offline   Reply With Quote
Old 19th May 2011, 13:42   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Someone asked this a couple of days ago: http://forums.winamp.com/showthread.php?t=330582

Stu
Afrow UK is offline   Reply With Quote
Old 19th May 2011, 13:56   #3
franz.reitner
Junior Member
 
Join Date: Feb 2010
Posts: 14
..hmm, yes, sorry. Very basic question.
Compile time versus runtime.

Thanks!
franz.reitner is offline   Reply With Quote
Old 19th May 2011, 14:38   #4
franz.reitner
Junior Member
 
Join Date: Feb 2010
Posts: 14
Maybe someone places a chapter into the documentation 'Compile time versus runtime', since it is not really obvious (at least to me). Both command types are listed in the same script file, e.g.
SetOutPath "$Target" ; where Target can be a define or a variable
File "$OutFile" ; and with the file command it must not be a variable
It would be good to pinpoint the difference for both command types.
franz.reitner is offline   Reply With Quote
Old 20th May 2011, 05:56   #5
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
File is a special case since it's both a compile time and runtime command. That's why it's in the command list.

The compile-time functionality of File should be pretty obvious: You cannot compress into the installer .exe what doesn't exist on the developer's PC. That's why you cannot do File $Variable, because the compiler has no idea what $Variable is supposed to contain.
MSG is offline   Reply With Quote
Old 25th May 2011, 00:29   #6
Zinthose
Senior Member
 
Join Date: May 2009
Posts: 152
If I want to process a lot of files I create a macro then create an external AutoIt, VB, perl, or whatever script to preprocess the files and create a "MyFiles.nsh" file that calls the macro for each file. I then !include the "MyFiles.nsh" after I run the AutoIt Script.
Zinthose is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
file, variable

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