Archive: Path comparison


Path comparison
Under certain conditions I need to copy my installer to a temporary directory and relaunch it from there. This is currently done by the installer itself with:

CopyFiles /SILENT "$EXEPATH" "$TEMP"
Exec '"$TEMP\$EXEFILE"'

Another section of the installer tests to see if it is running from the TEMP directory:

StrCmp $TEMP $EXEDIR X Y

Here's the problem. On my XP machine,

$TEMP is C:\Docume~1\UserName\Local~1\Temp

but depending on what directory you launch the installer from, $EXEDIR is either

C:\Docume~1\UserName\Local~1\Temp
or
C:\Documements and Settings\UserName\Local Settings\Temp

In the latter case my string compare fails even though the paths are pointing to the same location. Is there a function or method to convert the path to 8.3 format so that the comarison will work?

Is there a better way to accomplish the same thing?


GetFullPathName /SHORT


Thanks!