Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   File command (http://forums.winamp.com/showthread.php?t=330724)

franz.reitner 19th May 2011 12:35

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.

Afrow UK 19th May 2011 12:42

Someone asked this a couple of days ago: http://forums.winamp.com/showthread.php?t=330582

Stu

franz.reitner 19th May 2011 12:56

..hmm, yes, sorry. Very basic question.
Compile time versus runtime.

Thanks!

franz.reitner 19th May 2011 13:38

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.

MSG 20th May 2011 04:56

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.

Zinthose 24th May 2011 23:29

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.


All times are GMT. The time now is 17:24.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.