Old 28th May 2003, 22:23   #1
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Same file being compressed twice with /oname... ?

Trying to compress a file ONCE and then output that ONE file to multiple folders with different file names.

Examples of syntax tried is:

code:

SetOutPath "$INSTDIR\folder1"
File /oname=bitmap1.bmp mybitmap1.bmp
File /oname=bitmap2.bmp mybitmap2.bmp
File /oname=bitmap3.bmp mybitmap3.bmp

SetOutPath "$INSTDIR\folder2"
File /oname=bitmap4.bmp mybitmap1.bmp
File /oname=bitmap5.bmp mybitmap2.bmp
File /oname=bitmap6.bmp mybitmap3.bmp



Now, looking at this, you'd think that 6 bitmap files would be created using only 3 source files. However, my problem is that mybitmap1 through mybitmap3.bmp are being compressed twice (and doubling the archive size), thus making the whole concept of why I want to do this moot.

Am I missing something, or can I not do what I want to do?

I want 3 files compressed and added to the archive, but I want those 3 files to be extracted 6 times. 3 to one folder with a certain name, and 3 to another folder with a different name.

?

Not possible?
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 22:44   #2
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
copy them....
look the instruction "CopyFiles" in the manual


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 28th May 2003, 22:46   #3
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
I was going off of Kichik's example/suggestion.
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 22:50   #4
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Ok. The instructions aren't ample enough to explain to me explicitly the syntax or location of the command in my script to accomplish my goal.

The CopyFiles also does not "rename" source files, unless I'm missing something.

Care to let me know how to use it in the above-posted example? Also need to know where in the script this needs to go?

Can wildcards be used?
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 22:57   #5
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
code:

Section "Ghost"
CreateDirectory "$INSTDIR\folder1"
SetOutPath "$INSTDIR\folder1"
File "C:\1.bmp"
File "C:\2.bmp"
CreateDirectory "$INSTDIR\folder2"
SetOutPath "$INSTDIR\folder2"
CopyFiles "$INSTDIR\folder1\1.bmp" "$INSTDIR\folder2" ; or "$INSTDIR\folder2\1.bmp"
SectionEnd


The wildcards, like "*.bmp"? I don't know, never try.
Helps?


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 28th May 2003, 23:04   #6
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Yes. Actually, after furthing testing, I now am no longer certain that the files are being compressed and stored twice, as I originally suspected.

Man oh man.
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 23:06   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
code:

File /oname=$INSTDIR\folder1\bitmap1.bmp mybitmap1.bmp
File /oname=$INSTDIR\folder1\bitmap2.bmp mybitmap2.bmp
File /oname=$INSTDIR\folder1\bitmap3.bmp mybitmap3.bmp
CreateDirectory "$INSTDIR\folder2"
CopyFiles "$INSTDIR\folder1\*.bmp" "$INSTDIR\folder2"



-Stu
Afrow UK is offline   Reply With Quote
Old 28th May 2003, 23:14   #8
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Afrow UK. Right on the money. My script looks just like that and it did work fine.
Tolwyn is offline   Reply With Quote
Old 29th May 2003, 10:00   #9
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
If it's really included twice and the installer size grows and not just the size it displays in the components/directory page you've probably used SetDatablockOptimize off. This is not a good idea because the datablock optimizer is fast and makes sure files won't be included twice, just like in this case.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 29th May 2003, 16:29   #10
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Thumbs up Great!

Perfect. I have a great working installer that does everything as I expect it to.

Thanks again for all the work and time, everyone, in the effort to assist the ignorant!
Tolwyn 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