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:
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
29 / Male / Flag
Joined: Nov 2006
Status: Away
O.P. Happy  [suggestion] Remove all files before import option in ScriptInfo.xml
right now i have a script that installs into the same folder.

i recoded the script and changed the JS file names..
when someone that has a lower version of the script imports the new version, the older version's files are still there and they conflict with each other (using same functions, etc)

i'm wondering if there could be an extra option in the ScriptInfo.xml such as <RemoveFiles> instead of
quote:
Originally posted by MeEtc
just put in an empty file with same name


you can see what i mean if you install WLMini Music Player 2.1.7a and then the beta after.

This post was edited on 04-07-2008 at 03:35 AM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
04-07-2008 03:34 AM
Profile PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
quote:
Originally posted by roflmao456
right now i have a script that installs into the same folder.

i recoded the script and changed the JS file names..
when someone that has a lower version of the script imports the new version, the older version's files are still there and they conflict with each other (using same functions, etc)

i'm wondering if there could be an extra option in the ScriptInfo.xml such as <RemoveFiles> instead of
quote:
Originally posted by MeEtc
just put in an empty file with same name


you can see what i mean if you install WLMini Music Player 2.1.7a and then the beta after.


Music Now playing does

code:
    //uninstalls the old players 
    var OldFiles = [
        "iTunesClass.js",
        "WinampClass.js",
        "wmpClass.js",
        "jetAudioClass.js",
        "players\\MusicMonkey.player.js",
        "showConfig.txt"
    ];
   
   
    for(file in OldFiles){
        var name = MsgPlus.ScriptFilesPath + "\\" + OldFiles[file];
        if(fso.FileExists(name)){ fso.GetFile(name).Delete(true);}
    }


to delete old files

currently it does that on every OnEvent_Initialize though :( *wishes there was a onimport event*
[Image: dt2.0v2.png]      Happy Birthday, WDZ
04-07-2008 04:20 AM
Profile PM Web Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
quote:
Originally posted by -dt-
currently it does that on every OnEvent_Initialize though (Smilie) *wishes there was a onimport event*


quote:
Originally posted by scripting documentation
MessengerStart
[boolean] Specifies the reason for the event to occur. If this parameter is true, the event was generated during the startup of Messenger. If it is false, the event was generated after the script was imported, enabled, or restarted.

That would at least cut it down to when the script is initialised while messenger is running... 8-)
[Image: markee.png]
04-07-2008 11:18 AM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
quote:
Originally posted by markee
quote:
Originally posted by -dt-
currently it does that on every OnEvent_Initialize though (Smilie) *wishes there was a onimport event*


quote:
Originally posted by scripting documentation
MessengerStart
[boolean] Specifies the reason for the event to occur. If this parameter is true, the event was generated during the startup of Messenger. If it is false, the event was generated after the script was imported, enabled, or restarted.

That would at least cut it down to when the script is initialised while messenger is running... 8-)
but what happens if the script is imported :/ MessengerStart wouldnt be true then since messenger has already started
[Image: dt2.0v2.png]      Happy Birthday, WDZ
04-07-2008 11:29 AM
Profile PM Web Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
code:
if(!MessengerStart){

//code that first only on an import as messenger has already been started
//it is possible to import a script without being logged in, but who really does that?

}

EDIT: You could also just check if the first one exists, if it does thn it will cycle through the rest (unless they relate to different versions, and then you need one from each version).

This post was edited on 04-07-2008 at 11:37 AM by markee.
[Image: markee.png]
04-07-2008 11:35 AM
Profile PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
29 / Male / Flag
Joined: Nov 2006
Status: Away
O.P. RE: [suggestion] Remove all files before import option in ScriptInfo.xml
the code that -dt- posted doesn't unload the file unfortunately.

plus the files are loaded in alphabetical order so errors might come first and stop/intercept the script
[quote]
Ultimatess6
: What a noob mod
04-08-2008 02:11 AM
Profile PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
Maybe an option to put in xml which files are to be replaced with what or deleted etc...
<Eljay> "Problems encountered: shit blew up" :zippy:
04-08-2008 11:30 AM
Profile PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
29 / Male / Flag
Joined: Nov 2006
Status: Away
O.P. RE: [suggestion] Remove all files before import option in ScriptInfo.xml
quote:
Originally posted by SpunkyLoveMuff
Maybe an option to put in xml which files are to be replaced with what or deleted etc...
(Y)
maybe something like
code:
<ScriptInfo>
<Information>
<Description>lol.</Description>
<Version>1</Version>
<Name>testscript</Name>
</Information>
<Import>
<RemoveFile>blah.js</RemoveFile>
<RemoveFile>lol.js</RemoveFile>
</Import>

</ScriptInfo>


or
code:
<ScriptInfo>
<Information>
<Description>lol.</Description>
<Version>1</Version>
<Name>testscript</Name>
</Information>
<Import>
<RemoveScript>testscript</RemoveScript>
</Import>

</ScriptInfo>


This post was edited on 04-08-2008 at 12:45 PM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
04-08-2008 12:44 PM
Profile PM Web Find Quote Report
mynetx
Skinning Contest Winner
*****

Avatar
Microsoft insider

Posts: 1175
Reputation: 33
36 / Male / Flag
Joined: Jul 2007
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
WLMStatus did change some file names as well from 1.1.7 to 1.1.8. In fact, I'm using a combined solution:
For JS files, the new plsc pack contains the files to be deleted, but with blank content (empty files). This causes the old JS code not to be run upon initialize, but there are still the empty JS files. Then the code does contain a list of obsolete files which are deleted in a Cleanup helper function.
mynetx - Microsoft, enhanced.

You have a problem or issue with Windows, Internet
Explorer or Office?
Send a tweet!
04-08-2008 03:46 PM
Profile E-Mail PM Web Find Quote Report
L. Coyote
Senior Member
****

Avatar
Captain Obvious

Posts: 981
Reputation: 49
38 / Male / Flag
Joined: Aug 2004
Status: Away
RE: [suggestion] Remove all files before import option in ScriptInfo.xml
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.

Basically, I remove all files and sub-folders that are not in two lists (one for files another for folders), plus I use a "lock" file for Polygamy compatibility.

The problem with the XML file, which I can now see, is that you have to think of all version upgrades. If you changed files in version 1.0, then in version 2.0 and finally settled for another file in version 3.0, you have to make sure the commands in the XML file don't mess different upgrades.

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.

Hack, hack, hack!
Finally became a Systems Analyst! :spam:

04-08-2008 06:46 PM
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