Archive: Frustrating problem with uninstaller


Frustrating problem with uninstaller
Im trying to make so only the installed files gets uninstalled.CODE
But something makes the uninstaller freeze then only one file is left. The uninstall.log.

Here is a image that shows were the uninstallers stops/freeze.
Its show that its trying to remove fgd/counter-strike but that folder is removed. The only file left is uninstall.log.

And here are a image of the only file left. (in the red circle). Files with a balck line over are not going to be uninstalled.
I took this screen after I had stoped the uninstaller by CTRL+ALT+DEL.

I have two ideas why it doesent work but I dont know how to solve it.

1. The uninstall.log is in use by the uninstaller so it cant delete it

2. The code for the uninstaller just loop and loop and never stops.

And I dont think it has something to do with that the uninstaller copy its self to temp. And the installdir sems to be right.

So what can be wrong with the code?

I have attached the nsi so you can take a look at it.

// Sorry for my bad english


Just looking at your code, I think you are getting into an endless loop at the very end just before you delete the log file.

Just swap the last 2 lines so that this:

StrCmp $R1 0 LoopDone
IntOp $R1 $R1 - 1

becomes this:
IntOp $R1 $R1 - 1
StrCmp $R1 0 LoopDone
.

The original problem happens when $R1 gets assinged a value of zero and then starts the loop again. When $R1 is zero, $R2 will never be able to equal $R1 and therefore you get into an endless loop. By checking the value of $R1 AFTER you change it's value, you can exit the loop at the proper time.

Thanks but just before I was going to bed I got it to work.
So the problem is solved :)