Archive: NSIS Uninstaller Bug


NSIS Uninstaller Bug
Hey guys! I've got a QA team beating on our installer built with NSIS, and have got the first (of probably many) bugs rolling in:

When running the UNinstaller, if it cannot remove a file (say, because the program is still running), it just silently fails and reports "uninstallation completed successfully" at the end, leaving the files on the disk, but removing the Uninstaller, the user's only recourse for removing these now orphaned files.

Anyway, is there a way for the uninstaller to do the same thing the installer does: if a file exists and is use, it gives a "rety/cancel" dialog?

Alternatively, I guess I coule probably make the uninstaller detect if the game is still running, and if so, just don't let it uninstall?


Ne'er mind, I guess I should read better before posting... I can do this by checking the error flag after any delete call, and if they say retry, looping back to the beginning of the uninstaller. If anyone knows a cleaner way, let me know!


You can also use Delete /REBOOTOK which will set the reboot flag and queue the files for deletion on the next reboot. But it's still a good idea to check if the game is running to prevent unnecessary reboots.