Archive: Uninstall and reboot


Uninstall and reboot
Hello!

I have two questions:

1) Is there a limit on the stack size of NSIS? I would like to write a plugin which during uninstall finds some dynamically generated files to be deleted and puts them on the stack. I will then delete the files from my script with the /REBOOTOK parameter. But is there a limit on the stack size which may give a problem?

2) Consider the following situation: A user uninstalls a program. Some files cannot be removed and are then registed for removal on system reboot (because the /REBOOTOK parameter is used). The user selects not to reboot the system at this point. Next, the user reinstalls the program. When the system reboots the newly installed files are removed. Is there any good solution to this problem? One way is not to allow the user to reinstall until the system reboot. What is the good way to ensure this?


1) Stack elements are dynamically allocated so there should be no limit but your computer's memory limit.

2) There was a forum thread about this, you might find some useful information there.


Thank you very much for your promptly reply!

2) I managed to find the old thread (subject: Files get Deleted on Reboot after Uninstall / Install). The suggestion there is to write a "key/file" so that the uninstaller can determine that an old uninstallation has not completed.

Inspired by this I see one solution:

On uninstall:
* By using GetTickCount, approximate when the system was last rebooted.
* Create a file and write this information to it.
* Make the file read-only
* Delete the file with /REBOOTOK
* Make the file writeable
* On reinstallation, read the file. If it is there, use the time information in it to determine if the system has rebooted. If the system has not rebooted, refuse to install.

The reason it needs to be this complicated is, that we can not count on files to actually be removed on reboot. For example the files may be on a network drive. Or the user may not have sufficient permissions to schedule file removal on reboot.

Any other suggestions will be appreciated.