Old 6th November 2004, 23:12   #1
Olaf van der Spek
Junior Member
 
Join Date: Jul 2000
Posts: 34
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?
Quote:
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.
Olaf van der Spek is offline   Reply With Quote
Old 6th November 2004, 23:26   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
http://forums.winamp.com/showthread.php?threadid=197671

Please use the search feature of the forums.

-Stu
Afrow UK is offline   Reply With Quote
Old 6th November 2004, 23:32   #3
Olaf van der Spek
Junior Member
 
Join Date: Jul 2000
Posts: 34
Oops. However, that example includes files and subfolders, while I only want to include a folder and it's files, but no subfolders.
Olaf van der Spek is offline   Reply With Quote
Old 6th November 2004, 23:44   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Use "folder\*.*" without the /r switch.

-Stu
Afrow UK is offline   Reply With Quote
Old 7th November 2004, 01:30   #5
Olaf van der Spek
Junior Member
 
Join Date: Jul 2000
Posts: 34
But then the files end up in the install dir, while I want them to be put in a subdir of it.
Olaf van der Spek is offline   Reply With Quote
Old 7th November 2004, 10:49   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
SetOutPath "$INSTDIR\subdir"
File "local_folder\*.*"

-Stu
Afrow UK is offline   Reply With Quote
Old 7th November 2004, 11:36   #7
Olaf van der Spek
Junior Member
 
Join Date: Jul 2000
Posts: 34
Thanks.
But a cleaner way would be to be able to do that via /oname=subdir.
Olaf van der Spek is offline   Reply With Quote
Old 7th November 2004, 12:29   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
/oname is used for single files only. It specifies the 'output name' for a single file.

-Stu
Afrow UK is offline   Reply With Quote
Old 7th November 2004, 12:41   #9
Olaf van der Spek
Junior Member
 
Join Date: Jul 2000
Posts: 34
Yes, I understand. But why can't it be used (if this feature is implemented) to specify the directory name for multiple files?
Olaf van der Spek is offline   Reply With Quote
Old 7th November 2004, 14:31   #10
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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:

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

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



-Stu
Afrow UK is offline   Reply With Quote
Old 7th November 2004, 14:35   #11
Olaf van der Spek
Junior Member
 
Join Date: Jul 2000
Posts: 34
You'd need to restore OutPath too in the macro.
Olaf van der Spek is offline   Reply With Quote
Old 7th November 2004, 14:37   #12
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Quote:
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

-Stu
Afrow UK is offline   Reply With Quote
Old 7th November 2004, 16:30   #13
Olaf van der Spek
Junior Member
 
Join Date: Jul 2000
Posts: 34
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).
Olaf van der Spek is offline   Reply With Quote
Old 7th November 2004, 19:04   #14
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
That's why for all files you'd use the macro
Or just another SetOutPath to use for lots of files.

-Stu
Afrow UK 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