dwenco
08-15-2008, 05:37 PM
Hi,
Can I use TrueUpdate to send an XML message? I see that there are a number of XML functions available, but from the description none of them seems to create and send out an xml message. Any suggestion really appreciated.
Thank you.
upeters
08-15-2008, 09:43 PM
Hello,
what do you mean with "sending out" a XML message? Could you explain a bit further what you are trying to achieve?
Ulrich
dwenco
08-15-2008, 10:02 PM
Hi uPeter,
To tell you the truth I have extremely limited knowledge on XML messages so maybe that's not the correct way to phrase it. What I need is a way to get an XML message from my client machine (where the update takes place) to the administrator who publishes the updates so that the administrator will know whether the update has happened successfully, without having to manually go check. XML messages would be best because it looks like that's how the other applications in my company do.
If that's not possible, anything that the trueupdate client can send back to the administrator to report a success/failure etc. status would help.
Many thanks for your help.
upeters
08-15-2008, 11:00 PM
Ok, I hope I understood what you are trying to do. Please excuse any errors, it is past midnight here. :lol
I would approach your situation in the following way. First of all, I would include a "skeleton" XML file in the initial setup or in the next update, so you won't have to recreate the whole file from scratch on each update in TrueUpdate. For my example, I made the following skeleton.xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<UpdateStatus>
<Computer>
Name
</Computer>
<InstalledVersion>
0.0.0.0
</InstalledVersion>
<LastUpdate>
2000-01-01
</LastUpdate>
</UpdateStatus>
This is just an example file, where I have placeholders for three fields of information: the computer name, the version currently installed of the application being updated, and the date.
Now I would proceed in the following way: In the last screen of the updater shown on a successful run of TrueUpdate ("Update Finished"), I would include some XML actions to update the skeleton XML, like this:
-- point this to the location of your skeleton file (current folder?)
skeleton = XML.Load("D:\\TEMP\\skeleton.xml");
-- get the computer name or some other info
computerinfo = System.GetLANInfo();
XML.SetValue("UpdateStatus/Computer", computerinfo.Host);
-- the installed version, according to the mechanism used in your update(registry, file version)
XML.SetValue("UpdateStatus/InstalledVersion", tableVerInfo.FileVersion);
-- current date
XML.SetValue("UpdateStatus/LastUpdate", System.GetDate(DATE_FMT_ISO));
-- where to save the modified XML file
XML.Save(SessionVar.Expand("%TempFolder%\\updateinfo.xml"));
You should include error checks, to make this more robust, but I am not showing them here to keep the code as short as possible.
You see that I am updating the values in the skeleton XML with the real info corresponding to the current instalation. After executing the code above, you should find in the temporary folder a file named "updateinfo.xml" with the current info. On my notebook I just got this result:
<?xml version="1.0" encoding="ISO-8859-1"?>
<UpdateStatus>
<Computer>SATURN</Computer>
<InstalledVersion>2.0.0.0</InstalledVersion>
<LastUpdate>2008-08-16</LastUpdate>
</UpdateStatus>
Now all that remains (if I understood your problem correctly) is the task to upload this file to the server somehow, which you can do with ease with FTP actions (you will need the plugin for this). You should rename the file to something else, like "SATURN.xml" in my example, so one update won't overwrite the XML file created by another update (unless you have several computers with the same network name, so take some other unique information). If you don't have any means to get the FTP plugin (it is included in AutoPlay Media Studio, but can be purchased separately), you can still use HTTP actions to upload the file to the server, which can be done through CGI, ASP or PHP forms.
Independently on the mechanism used to upload the modified XML files, eventually you should have some files on your server, one for each update performed successfully. There should be no problem to parse these files with another application, to point out which computer still wasn't updated to the most recent version, etc.
I hope that you can make sense of what I wrote here. ;)
Ulrich
dwenco
08-16-2008, 09:31 PM
Hi uPeter. Thanks SO MUCH for your help! Really appreciate you spending the time to help me past mid-night :D
I think you've solved my problem. Although I just realized that I am not able to try it out because my TrueUpdate trial version has expired (I need my boss' approval before I can make the purchase), but I will be able to mention this approach when I talk to my boss and other engineers.
Thank you!!
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.