Archive: Rename does not work every time


Rename does not work every time
Hi,

I have a problem with RENAME.
When installing at the first time the Rename of bin_x64 works well.

But when I install the next time without uninstalling the software before the rename does not work. I remove the directory /bin when it already exists. The strange think is that the compiler goes in the else-part every time. Only the Rename does not work when Reinstalling the software.
Can someone tell me what the error could be and how to solve it?


IfFileExists $INSTDIR\bin dir_exists dir_not_exists #when not uninstalled before
dir_exists:
RMDIR /r $INSTDIR\bin
dir_not_exists: #else

${If} $PLATFORM == "x86"
File /r "..\distrib\bin"
${Else}
File /r "..\distrib\bin_x64"
Rename "$INSTDIR\bin_x64" "$INSTDIR\bin"
${EndIf}

You don't need to use Rename at all:
SetOutPath $INSTDIR\bin
File /r "..\distrib\bin_x64\*.*"

Stu


Hi Stu,

that works :)

Thank you again