Archive: copy fails on 2nd section


copy fails on 2nd section
Hello all,

Ok I have a cool installer at this point but it does not
work correctly...yet.

I have acouple of sections
each section copies files from 1 source to another
I use copyfile, I also use setoutpath.

Each section does work when tested by themselfs.
When I try to install more then 1 section at a time the
1st section run works fine, but when the next section
attempts to copyfiles it fails.

Starting to drive me crazy.

Ryland


Can you give more details and attach a script?


Each section works when I run the installer and only select
1 section at a time. When I select 2 sections to install the 1st section works and the section section the copyfile seems to always fail.



Section "Area51"
CreateDirectory "$INSTDIR\roms\area51"
CreateDirectory "$INSTDIR\TEMP"
CopyFiles "needed\*.*" "$INSTDIR\TEMP" 0
CopyFiles "CHDs\area51\*.*" "$INSTDIR\TEMP" 534000
SetOutPath $INSTDIR\TEMP
ExecWait '"$INSTDIR\TEMP\RAR32.exe" e area51.rar'
Rename $INSTDIR\TEMP\area51.chd $INSTDIR\roms\area51\area51.chd
RMDir /r $INSTDIR\TEMP
SectionEnd

Section "Area51mx"
CreateDirectory "$INSTDIR\roms\area51mx"
CreateDirectory "$INSTDIR\TEMP"
CopyFiles "needed\*.*" "$INSTDIR\TEMP" 0
CopyFiles "CHDs\area51mx\*.*" "$INSTDIR\TEMP" 1660000
SetOutPath $INSTDIR\TEMP
ExecWait '"$INSTDIR\TEMP\RAR32.exe" e area51mx.rar'
Rename $INSTDIR\TEMP\area51mx.chd $INSTDIR\roms\area51mx\area51mx.chd
RMDir /r $INSTDIR\TEMP
SectionEnd



Thanks
Ryland


Rename doesn't work if the destination file/directory exists. Delete it first.


thanks, but problem is that copyfile fails.
Ryland


Is CHDs\area51mx in $INSTDIR\Temp? If it isn't then that's your problem. You should specify a full path. Once you call SetOutPath the working directory and if that directory is not in the working directory then Windows can't find it and copy it.


Thanks...All working now....
added $ENEDIR in front of CHDs\area51mx

Ryland


opps spelling sucks.... added $EXEDIR
Ryland