quote:
Originally posted by CookieRevised
This said, I still think it is wrong for a script to reload itself or another script though. It shouldn't be needed. Not even to update (updating should be left to Plus! and its updating system).
True, but sometimes reloading the script is needed. When script files become obsolete in newer versions, you might need to remove those before the updated script is started to prevent duplicate functions definitions. For example, the main script file in Countdown Live 1.0 was named "Countdown Live.js" but I changed this to "Main.js" for 2.0. Therefore, I needed a way to remove this old file. You could argue that I shouldn't have changed the file name but I believe developers should have the possibility to restructure their script.
A slightly better solution could be to keep a "Countdown Live.js" file in the script package and make it completely empty. This way, the obsolete file would be replaced by this empty file and could be safely deleted without restarting the script. The downside is that these obsolete files will still clutter your script package for all versions to come...
I agree that such upgrade procedures should be handled by Plus! but as long as Plus! doesn't provide such support, we're stuck with nasty workarounds. We could really use some sort of <RemoveFiles> block in ScriptInfo.xml for these things.