Archive: File /oname=foo.tmp issue


File /oname=foo.tmp issue
I found that the following scenario skipped my file extraction if that file did not exist on the destination machine:

SetOverWrite ifnewer
GetTempFileName $1 $OUTDIR
File "/oname=$1" "poo.exe"
Rename /REBOOTOK "$1" "poo.exe"

My guess was that since $1 here is a .tmp file, the File command didn't like trying to extract version information from it to compare to poo.exe, since SetOverWrite was set to ifnewer. So I tried the following workaround, which works for me:

SetOverWrite ifnewer
GetTempFileName $1 $OUTDIR
Rename $1 "$1.exe"
File "/oname=$1" "poo.exe"
Rename /REBOOTOK "$1" "poo.exe"
Delete "$1.exe"

Am I correct as to why this happened? If so, are there other commands that will not work as expected with .tmp files?


I now realize that the File command won't perform the overwrite comparison correclty here (since it's comparing the bogus $1.exe file with poo.exe). Guess I'll have to use an extra step for version comparison.