PDA

View Full Version : copy fails on 2nd section


burn_mame
22nd September 2003, 13:38
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

Joost Verburg
22nd September 2003, 13:46
Can you give more details and attach a script?

burn_mame
22nd September 2003, 13:54
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

kichik
22nd September 2003, 13:57
Rename doesn't work if the destination file/directory exists. Delete it first.

burn_mame
22nd September 2003, 14:53
thanks, but problem is that copyfile fails.
Ryland

kichik
22nd September 2003, 14:58
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.

burn_mame
22nd September 2003, 15:44
Thanks...All working now....
added $ENEDIR in front of CHDs\area51mx

Ryland

burn_mame
22nd September 2003, 16:23
opps spelling sucks.... added $EXEDIR
Ryland