Archive: rebootok: bug, gotcha or error on my part?


rebootok: bug, gotcha or error on my part?
I noticed this while testing an installer...

In the uninstall section, I use "rmdir /r /rebootok"
I tested the uninstall
Whoops... I had one of the EXE's running so it couldn't
be deleted and so the delete was saved in windows magic
"delete on next reboot" registry keys
I went and manually deleted the EXE after stopping it
Then I ran the installer... all seems well and good,
everything is installed as I wished

[Sometime later that day]

I reboot
Whoops... the EXE that had been queued for deletion is
actually deleted (surprise) but it is the newly installed
EXE, not the original EXE

------

So, would this be considered a bug? Should NSIS check to
see if a file being installed is queued for deletion at
the next boot and fixup the registry so it does not get
deleted?

Or... is this something that everyone else using NSIS knows
and I am just dumb?

Is there a way to avoid this scenario?


This is not a bug, as everything is behaving as it has been designed: the file gets deleted after reboot. That's what you told it to do, after all.

The scenario you describe would be a typical case of 'pebkac' for which, if you happen to want to prevent it, you'll have to create your own checks in your own installer. Not sure how you should go about doing this, though, as I don't know how NSIS executes the deletion after reboot.