Archive: File /oname and /r?


File /oname and /r?
I'd like to include an entire directory, but not any subdirectories and I'd like the files to be put in a directory of the install dir and not in the install dir itself.

How should I do this?

If the /oname=X switch is used, the output name becomes $OUTDIR\X. When using the /oname= switch, only one file can be specified, and the file name can contain variables (or a fully qualified path, e.g. $SYSDIR\whatever.dll).
I'd basically like to use /oname=dir.
A /d for directory, but not recursive would be nice too.

http://forums.winamp.com/showthread.php?threadid=197671

Please use the search feature of the forums.

-Stu


Oops. However, that example includes files and subfolders, while I only want to include a folder and it's files, but no subfolders.


Use "folder\*.*" without the /r switch.

-Stu


But then the files end up in the install dir, while I want them to be put in a subdir of it.


SetOutPath "$INSTDIR\subdir"
File "local_folder\*.*"

-Stu


Thanks.
But a cleaner way would be to be able to do that via /oname=subdir.


/oname is used for single files only. It specifies the 'output name' for a single file.

-Stu


Yes, I understand. But why can't it be used (if this feature is implemented) to specify the directory name for multiple files?


To save 1 line of code? There wouldn't be any point.

You could just make a macro to save 1 line of code like so:

!macro File Outpath File
SetOutPath "${Outpath}"
File "${File}"
!macroend
!define File "!insertmacro File"

Section -blah
${File} "$INSTDIR\subdir" "local_dir\*.*"
SectionEnd


-Stu

You'd need to restore OutPath too in the macro.


Originally posted by Olaf van der Spek
You'd need to restore OutPath too in the macro.
Sorry I do not understand what you mean :p

-Stu

The call to SetOutPath might affect other File calls after this macro call. With /oname=dir, this wouldn't happen, so you'd need to restore the OutPath to what it was before you called the macro (to achieve the same effect as /oname).


That's why for all files you'd use the macro ;)
Or just another SetOutPath to use for lots of files.

-Stu :o