[suggestion] Remove all files before import option in ScriptInfo.xml |
Author: |
Message: |
roflmao456
Skinning Contest Winner
Posts: 955 Reputation: 24
30 / /
Joined: Nov 2006
Status: Away
|
O.P. [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 |
|
|
-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
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*
Happy Birthday, WDZ
|
|
04-07-2008 04:20 AM |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
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...
|
|
04-07-2008 11:18 AM |
|
|
-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
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...
but what happens if the script is imported :/ MessengerStart wouldnt be true then since messenger has already started
Happy Birthday, WDZ
|
|
04-07-2008 11:29 AM |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
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.
|
|
04-07-2008 11:35 AM |
|
|
roflmao456
Skinning Contest Winner
Posts: 955 Reputation: 24
30 / /
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 |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
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"
|
|
04-08-2008 11:30 AM |
|
|
roflmao456
Skinning Contest Winner
Posts: 955 Reputation: 24
30 / /
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...
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 |
|
|
mynetx
Skinning Contest Winner
Microsoft insider
Posts: 1175 Reputation: 33
37 / /
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.
|
|
04-08-2008 03:46 PM |
|
|
L. Coyote
Senior Member
Captain Obvious
Posts: 981 Reputation: 49
39 / /
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!
|
|
04-08-2008 06:46 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|