Tolwyn
28th May 2003 22:23 UTC
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:
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?
:weird:
Joel
28th May 2003 22:44 UTC
copy them.... :)
look the instruction "CopyFiles" in the manual
Tolwyn
28th May 2003 22:46 UTC
I was going off of Kichik's example/suggestion.
Tolwyn
28th May 2003 22:50 UTC
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?
Joel
28th May 2003 22:57 UTC
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?
Tolwyn
28th May 2003 23:04 UTC
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.
Afrow UK
28th May 2003 23:06 UTC
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
Tolwyn
28th May 2003 23:14 UTC
Afrow UK. Right on the money. My script looks just like that and it did work fine.
kichik
29th May 2003 10:00 UTC
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.
Tolwyn
29th May 2003 16:29 UTC
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!