Debug registry key... - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: WLM Plus! Bug Reports (/forumdisplay.php?fid=7) +----- Thread: Debug registry key... (/showthread.php?tid=96899) Debug registry key... by whiz on 02-20-2011 at 03:28 PM
Not something that important, but I'd thought I'd point it out anyway. RE: Debug registry key... by pollolibredegrasa on 02-20-2011 at 07:25 PM I've tried enabling/disabling the debug options a few times but I can't get the key to reappear. However, I know there are one or two scripts out there that will write this to key and most likely have the old path hard-coded, is it possible you have one of these? Could be worth a look, just to rule those out as a cause... RE: Debug registry key... by whiz on 02-22-2011 at 11:37 AM
quote:You're right - looks like a few scripts seems to write to this key. Just did a file search for the key in Notepad++... code:Countdown Live, Fake media and Video Converter Plus! all seem to reference the old key at some point. RE: Debug registry key... by Matti on 02-22-2011 at 12:41 PM
Most of these scripts use the ReloadScript function created by CookieRevised in order to reload the script on demand. See CookieRevised's reply to Restart script through code for the details. RE: Debug registry key... by CookieRevised on 02-22-2011 at 03:40 PM
Note: I have updated that snippet in that post to include a version check for Plus! 4 and 5. RE: Debug registry key... by Matti on 02-22-2011 at 05:45 PM
quote: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. RE: Debug registry key... by Spunky on 02-22-2011 at 09:00 PM
quote: Even better, an instruction in ScriptInfo.xml to remove a file in the existing script's folder as you try to import over it RE: Debug registry key... by Matti on 02-22-2011 at 11:27 PM
quote:Well, yeah... quote:Of course, this is just a suggestion. I'm not saying it's the best or only way to do it but that's open for discussion. RE: Debug registry key... by CookieRevised on 02-23-2011 at 01:13 AM
quote:Nope though... it is not needed to restart scripts for that. There is realy no reason why you should revert to something like your own routine to restart a script to clean up old files. That was not the reason why I showed that method to restart a script programmatically. You should not be using it for that since there is absolute no benefit in restarting a script compared to what you could otherwise do which would have the very same effect and in a much much safer, cleaner and shorter way, especially in case of just renamed files. Moreover, using a routine to restart the script yourself in order to update files will not always work (I'm not talking about the ScriptEnableDebug key now though). The reason for this is that you have no control what files will be started first by Plus! after you've updated. As such, it is not certain that you new file will be run before the old, to be removed, files. To make sure your old files with the old events aren't started, you need to overwrite them _before_ they have a chance to get started. Thus after your update is imported, but before the script is restarted by Plus!. And that can only be done by the use of 'empty' files: quote:That's hardly a downside imho, compared to using a method which can have unpredicted results and, as shown above, which completely depends on a registry key and all the issues it causes (because now, in all your subsequent updates you also must start cleaning out the registry because of it). Not to mention that if your main script file containing the Plus! events has been renamed, the update might now have failed in Plus! 5 (because of duplicated event functions, because the old files weren't removed, because Plus! did not detect a file change, because that ScriptEnableDebug key was not properly set, etc). And who knows how that ScriptEnableDebug key is going to be used in the futur. As explained above, you need 'empty' files anyways if you want to make sure you don't run into troubles. You can not get the same effect by restarting the script yourself. Anyways, the user doesn't even see these 'empty' files, and your new code will not be cluttered with cleanup code, if you use the method below: -- Simple add this snippet in the file you want to be removed in your next update: js code: In other words, in case of the Countdown Live script: copy the above snippet in 'Countdown Live.js' so that it is the only thing it contains, and replace "\\todelete.js" with "\\Countdown Live.js". That's all, nothing more needs to be done. When you pack this in a new update, and when you install that update, 'Countdown Live.js' will be removed, without cluttering your new code with cleanup code and without the user ever knowing there were 'empty' files or files containing such cleanup code (unless he explicitly unzips the script pack). And on top of that, because the cleanup code isn't there anymore after it has done its job, it isn't run each time the user starts Messenger or logs in or whatever.... quote:Absolutely. QFT! RE: Debug registry key... by Matti on 02-23-2011 at 02:14 PM
I get it, I'll pack some script files which replace the obsolete files and delete themselves when they're run. For other files such as interface definitions or images, I'll just delete them after initialization. js code:In the new version, I'll use a minified version of this code like: js code:which is only 412 bytes long in UCS-2 LE. My point still stands though, this really should be done by Plus!. Back on topic perhaps? The registry value being read by some scripts doesn't matter that much (although they shouldn't actually be reloading the script). Also, it appears that the latest version of Video Converter Plus! (2.60.016) doesn't write to this registry value any longer. Simply update Video Converter Plus!, remove the registry value and it won't come back. Problem solved! RE: Debug registry key... by CookieRevised on 02-23-2011 at 02:44 PM
quote:I absolutely 500% agree with this... |