What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [suggestion] Remove all files before import option in ScriptInfo.xml

Pages: (2): « First « 1 [ 2 ] Last »
[suggestion] Remove all files before import option in ScriptInfo.xml
Author: Message:
mynetx
Skinning Contest Winner
*****

Avatar
Microsoft insider

Posts: 1175
Reputation: 33
37 / Male / Flag
Joined: Jul 2007
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
Thanks for that idea, indeed it's a good one. As long as the list is able to be extended on runtime, in case that a script (such as WLMStatus) stores runtime config files or temp files in the script folder...
mynetx - Microsoft, enhanced.

You have a problem or issue with Windows, Internet
Explorer or Office?
Send a tweet!
04-08-2008 10:15 PM
Profile E-Mail PM Web Find Quote Report
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
maybe Patchou have to delete all js files (*.js) or rename them (as .txt for example) before importing the new ones, that could be easier :P
04-08-2008 10:49 PM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
I think a solution like mynetx made is best as a temporary fix, include blank .js files, delete them and also the .js file that deletes them also gets removed (this can be made through a try/catch statement globally so that initialize doesn't look for a non-existant function in the future).

As for deleting files, well I think we need to be able to make lists of some kind.  My scripts (like many others) need to keep text files and xml files, however some other xml files or text files should be updated/removed.  The same thing goes for folders.

Maybe a better solution would be something like the following...
code:
<ScriptInfo>
<Information>
<Description>lol.</Description>
<Version>1</Version>
<Name>testscript</Name>
</Information>
<Import>
    <RemoveFolder>folder1\subfolder</RemoveFolder> <!-- Removes the folder "subfolder" -->
    <RemoveFile>folder2\*.png</RemoveFile> <!-- Removes all .PNG files from folder1 -->
    <RemoveFile>old_ui.xml</RemoveFile> <!-- Removes the file "old_ui.xml" from the script's root directory -->
    <RemoveFolder>folder*\*< RemoveFolder> <!-- Removes all subfolders in "folder1" and "folder2" and any other folder that starts with "folder" -->
</Import>
</ScriptInfo>

If I was asking for a lot then I would want regex compatibility, but * as a wildcard is good enough i guess....

This post was edited on 04-09-2008 at 09:04 AM by markee.
[Image: markee.png]
04-09-2008 09:03 AM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
I have to agree here.

I had an awful hard time to make such system for Countdown Live 2.0, since the script structure completely changed. Removing files in the Images folder is very easy, but script files are lots harder. Even with the actions taken, a script restart is still required in order to unload the obsolete script files. Luckily this should only be done once. :P

Patchou really needs to implement something so we can control what should be removed. :)
* Matti thinks this thread should be in the Scripts forum rather than the General Talk... 8-)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
04-09-2008 01:31 PM
Profile E-Mail PM Web Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
O.P. RE: [suggestion] Remove all files before import option in ScriptInfo.xml
*revives my old thread*
Perhaps this should be in Plus! 5? :P
[quote]
Ultimatess6
: What a noob mod
07-23-2010 07:00 PM
Profile PM Web Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
My workaround is a list of files that should be there, and then everything else is removed.

But having a proper way of specifying obsolete files would be great for Plus! 5.
07-23-2010 07:32 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: [suggestion] Remove all files before import option in ScriptInfo.xml
quote:
Originally posted by L. Coyote
I suggested this months ago, and since I don't think it got a good response (I can't really remember), I made my own extra script for that.
It has in fact been suggested years ago, and again when the new update system was created.

The response back then, IIRC, was something in the line of "you're not supposed to change your script file names, so choose the file names wisely".


* CookieRevised slaps himself for not reading the posting date....


-------

quote:
Originally posted by L. Coyote
Instead of setting a "RemoveFile", I think the idea is to have a flag tag like "RemoveNonListed" (or some similar name, to express that the engine must remove all files that are not listed in the package being imported). That way, you don't have to write down each filename, you won't miss one and you won't misspell one.
quote:
Originally posted by whiz
My workaround is a list of files that should be there, and then everything else is removed.

Which will also delete any user generated file, (or script generated file), which is a major big no-no.... That would be a realy bad choice imo. I don't want any script to remove any files I have put in the scripting directory (like comment files, backups, a link to the thread, the actual plsc, etc).

A "RemoveFile" is far safer and better than "RemoveNonListed".

Also, I'm personaly not a fan of using wildcards, like markee suggested, in the "RemoveFile" attribute, for the same reasons above.

If you want to remove files you, as the script creater, knows what exact files were created/needed by the previous version. So no need for wildcards. Yes, it makes the "RemoveFile" list a bit longer, but it is far more safer and the user will not accidently loose any files because the script developper thinks he needed to remove all the existing files with <RemoveFile>*</RemoveFile>.

;)

---------------

PS: in fact, I have no trouble manually deleting script files from scripts which are currently running though. The only thing you need to look out for when doing it manually is that the scripting editor isn't opened with the script you want to delete files from (goes only for JS files).

You can include the files you want to remove as null files (0 bytes long), and in the initialization of the script remove them (if they exist).
This even works when the scripting editor is opened (as long as you press "ok" to let Plus! close and re-open Messenger).

This post was edited on 07-26-2010 at 09:00 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-26-2010 08:17 AM
Profile PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On