Archive: BUG: DELETE not working in 2.0b0


BUG: DELETE not working in 2.0b0
I have the following piece of code in a my script file:

Section "My Section"
SetOutPath $INSTDIR
File AutoIt.exe
Delete AutoIt.exe
SectionEnd

Intuition tells me that this will copy the file AutoIt.exe into the destination directory, and then delete it again.

It extracts the file just fine, but never deletes the file.

Is this a bug?

Gerald.


Ahh I see.
My "mistake".

If I use "delete $INSTDIR\AutoIt.exe", then the command executes properly.

Which sort of begs the question of why the installer doesn't try to go to $OUTDIR or $INSTDIR by default to delete a file which doesn't have a full path specified.

Does this not make sense?


Re: Ahh I see.

Originally posted by pozix604
My "mistake".

If I use "delete $INSTDIR\AutoIt.exe", then the command executes properly.

Which sort of begs the question of why the installer doesn't try to go to $OUTDIR or $INSTDIR by default to delete a file which doesn't have a full path specified.

Does this not make sense?
Its a Windows API call, so NSIS doesn't really have a lot of control with the delete. I guess NSIS could attach directories to the files with no path, but then it would just be guessing as to what you really meant.

Rainwater, I agree with you, but I also agree with pozix604. Just like 'File AutoIt.exe' assumes that you mean the directory set with 'SetOutPath $INSTDIR', so should 'Delete AutoIt.exe' assume that eighter, I think :).


I actually pointed this problem out to KiCHiK on IRC about a week ago but to be honest there is a known workaround and there are more urgent things for him to be doing :) Rest assured he's aware and I'm sure if he gets a chance it will be addressed.


I think the best way will be making SetOutPath set the current directory. I will have to ponder on this one a bit, it can create quite a lot of problems. But, as Sunjammer said, it will be fixed sooner or later.


Pondering done:

- SetOutPath now sets the current directory (RegDLL no longer does)
Find it in the latest CVS version.