|
|
#1 |
|
Member
Join Date: May 2005
Location: U.S.A.
Posts: 91
|
Installer Checks for update using XML
How do I use NSIS to Check for an Update using a XML File?
code: Lets just say I am Checking something that is Version 5.403 And I use the XML file above Located at a URL Link. It Tells the Installer that the Most Recent Version is Higher than the Version Being Installed... How would I go about this? -MichaelFlya- |
|
|
|
|
|
#2 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,896
|
At this moment there isn't a *official* XML parser plugin for nsis, here, here, are some un-official plugins.
Search the forum and you find other ways to parse a XML, although if your tree only has version as element, try a loop until you find it. * PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4. |
|
|
|
|
|
#3 |
|
Member
Join Date: May 2005
Location: U.S.A.
Posts: 91
|
Thanks Joel,
Ok to start off how do I call your XML.dll Properly to Parse it on Node (Version) And Ask if What is Under the Node is Greater than a Given Number, In this Case Greater than 5.403 is 5.405, Then Take Action one way or the other depending on if it ends up Greater or Lesser. Lets start at a Line like this... Unless otherwise. code: --- Possibly if OldValue<NewValue Activate "FunctionName" Other wise Some other Function Gets Activated. Might be A Type of Fork in the Road for me to Take an Action. Not that any of my Examples mean anything in the way that you do it for XML.dll. ------- I had Read those Links Already actually, I had been Searching for a while and finally Decided to post ... -MichaelFlya- Last edited by MichaelFlya; 19th May 2005 at 17:30. |
|
|
|
|
|
#4 |
|
Member
Join Date: May 2005
Location: U.S.A.
Posts: 91
|
Ok well If it Can't than Perhaps Maybe It can be Done With
the one Called nsXML.dll. How would that be Done? And if not than Where can I get the thing I am Looking for? -MichaelFlya- |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
I used this to get text between two tags in an HTML file, so it should work here too:
http://nsis.sourceforge.net/archive/...ances=0,11,311 -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#6 |
|
Member
Join Date: May 2005
Location: U.S.A.
Posts: 91
|
Afrow Uk, (About your Link)
I Have no idea what to do with this... What to change I mean. Also When I Get it Going to where it Grabs in this Case in Between <version> & </version> Which Should return 5.405, How would I say 5.403 is Less than The text Returned. Than say if Text Returned is Greater than 5.403 (Call FunctionNameUPDATE) If 5.403 is just Equal to the text Returned it will than (Call FunctionNameNOUPDATE) -MichaelFlya- |
|
|
|
|
|
#7 |
|
Member
Join Date: May 2005
Location: U.S.A.
Posts: 91
|
Please Help me Get the Text... And if you want, Also
Please Add how to Check Version Number by Less and Greater. That would be the next Question Anyway lol. Attached a Script. Thanks !!! -MichaelFlya- Last edited by MichaelFlya; 19th May 2005 at 21:56. |
|
|
|
|
|
#8 |
|
Member
Join Date: May 2005
Location: U.S.A.
Posts: 91
|
Here is the XML to go along with the NSI Script.
-MichaelFlya- |
|
|
|
|
|
#9 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
code: VersionCompare: http://nsis.sourceforge.net/archive/...s=0,11,122,754 Edit: Make sure you put functions code (from archive pages) in the script before you actually use them. -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#10 |
|
Member
Join Date: May 2005
Location: U.S.A.
Posts: 91
|
Thanks Afrow UK, I am Starting to Get somewhere....
I am Still having Problems... I don't know, I have attached what I made and Theres still a few bugs. It seems to Never Retrieve The Value of the XML File Correctly. So I Changed one of the Lines to test it. Function VersionCompare is Working Fine Using this. ${VersionCompare} "5.405" "5.403" "$R0" It also I Guess is only Checking the Last two Digits. All I know is it Makes 5.405 More than 5.403, But if I change 5.403 to 5.8 it is less than 5.405 For Some Reason. What can be done to make it work with all Digits? Why Isn't it Grabbing the XML Value Correctly? -MichaelFlya- |
|
|
|
|
|
#11 | |
|
Major Dude
Join Date: Jul 2004
Posts: 665
|
Quote:
It's correct. Becausecode: Right comparison (in your case):code: code: Last edited by Instructor; 21st May 2005 at 07:41. |
|
|
|
|
|
|
#12 |
|
Member
Join Date: May 2005
Location: U.S.A.
Posts: 91
|
I need to add a Decimal every Time after the first Decimal?
When using this Method I must Make my Versions like: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 -MichaelFlya- |
|
|
|
|
|
#13 |
|
Member
Join Date: May 2005
Location: U.S.A.
Posts: 91
|
As far as Function GetBetween Goes, Using Detail
Print like this: code: It Should Return The Version Number of the XML. But it turns up Blank. I figure once the Code for that Function is Working Properly I will get a Result from the XML. This is what I need to have worked out at the Moment. Oh and After Function VersionCompare I see it Is used to say 1 or 2. -MichaelFlya- |
|
|
|
|
|
#14 |
|
Member
Join Date: May 2005
Location: U.S.A.
Posts: 91
|
Ahh Something Small I have now Figured it out....
code: That helped on Returning the Value Found in XML. I must have not Set the Install Directory. Instead I set OutFile. But now For Function VersionCompare. Making the Number in the XML file 5.1 Instead of 5.405 and Doing this with the Line of Code: Code: code: Everything works When I change 5.0 in the Script to a more Higher Version than 5.1 it works as I want. Plus when I change 5.1 in the XML to what ever. So now I can Work With this. A good Explanation on why it's best to do 0.0.0.0.0 Decimals is needed but ok to Use. Both Afrow Uk And Instructor, All I can say is Thanks !!!! And Joel When ever I need to Write a XML With the Installer I am sure those Links will Come in handy, Thanks !!!! -MichaelFlya- |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|