View Full Version : How to set the TrueUpdate servers at loading time
mfcpro
06-01-2005, 11:36 AM
:huh :huh :huh :huh Hello,
I was trying to find out how can I set the TrueUpdate servers in TU2 client at the loading time.
I've looked on the TU2 help, but wasn't able to find it.
I'd like to set the location of my TrueUpdate servers by reading from the registry.
for example,
--GotServerFiles = TrueUpdate.GetServerFile(ServerName, false);
GotServerFiles = TrueUpdate.GetServerFileEx("mydomain.com/trueupdate/myproduct/", false);
I would appreciate your help.
Thanks.
Brett
06-01-2005, 12:49 PM
You can download the server file using HTTP.Download (http://www.indigorose.com/webhelp/tu20/Program_Reference/Actions/HTTP.Download.htm) and then TrueUpdate.LoadServerFile (http://www.indigorose.com/webhelp/tu20/Program_Reference/Actions/TrueUpdate.LoadServerFile.htm) to load and execute it. The downside to this is that it will miss out on the automatic exe/dat file updating. Although you could roll that youself too.
EDIT:
Another idea would be to use a Session Variable in the TrueUpdate Server properties dialog. So, instead of using:
www.yourserver.com/whatever/myproduct
as the Folder URL (http://www.indigorose.com/webhelp/tu20/Program_Reference/Project_Settings/TrueUpdate_Servers/TrueUpdate_Server_HTTP.htm) field, you could use:
%RegServerURL%
Then use SessionVar.Set (http://www.indigorose.com/webhelp/tu20/Program_Reference/Actions/SessionVar.Set.htm) to set %RegServerURL% to a value that you read using Registry.GetValue (http://www.indigorose.com/webhelp/tu20/Program_Reference/Actions/Registry.SetValue.htm).
mfcpro
06-01-2005, 01:53 PM
:yes Thanks a lot...
NickT
08-22-2005, 10:58 AM
You can download the server file [...] The downside to this is that it will miss out on the automatic exe/dat file updating.
Hi, I am trying to implement something that seems very similar to this question. I want to read the location of the server script files from an XML file, and then run that script. Can someone please explain what is meant by missing out on the automatic exe/dat file updating please?
you could use:
%RegServerURL%
Then use SessionVar.Set (http://www.indigorose.com/webhelp/tu20/Program_Reference/Actions/SessionVar.Set.htm) to set %RegServerURL% to a value that you read using Registry.GetValue (http://www.indigorose.com/webhelp/tu20/Program_Reference/Actions/Registry.SetValue.htm).
Can someone explain this solution in a bit more detail too please? After you have set the session variable, what do you need to do to load the server script?
Thanks!
NickT
08-23-2005, 10:28 AM
Another questions I have is: can you add servers to True Update during run time?
Is there a way to add an update server to True Update, so that it would be retrieved by the "GetUpdateServerList" action?
Thanks!
Desmond
08-23-2005, 10:45 AM
Can someone explain this solution in a bit more detail too please? After you have set the session variable, what do you need to do to load the server script?
The first thing you need to do is to set the URL of an update server to a session variable (see attachment). Choose Project > TrueUpdate Servers to get to that dialog.
Once you've set that session variable, on your Client Script tab, use one action to pull a value from the registry, and a second to assign that value's contents to the session variable:
sServerURL = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Application", "UpdateServerURL", true);
SessionVar.Set("%RegServerURL%", sServerURL);
Desmond
08-23-2005, 12:08 PM
Can someone please explain what is meant by missing out on the automatic exe/dat file updating please?
Basically, by default, TrueUpdate will try to get three files (ts1, ts2, and ts3), and if necessiary (if you change somethign in the client), will update the client on the user's system.
If you use the TrueUpdate.LoadServerFile action, you are only loading the server file (and won't be updating the client, etc).
Another questions I have is: can you add servers to True Update during run time?
The short answer is no. THere is no action to add servers at runtime. You can modify the list of servers in the design environment and, on the next update, your users client will update with teh latest servers . . . but no, not at runtime through script.
Does that make sense?
Can someone explain this solution in a bit more detail too please? After you have set the session variable, what do you need to do to load the server script?
Thanks![/QUOTE]
NickT
08-23-2005, 03:17 PM
Basically, by default, TrueUpdate will try to get three files (ts1, ts2, and ts3), and if necessary (if you change something in the client), will update the client on the user's system.
If you use the TrueUpdate.LoadServerFile action, you are only loading the server file (and won't be updating the client, etc).
[...]
Does that make sense?
Desmond, thanks for the reply - this does make sense. I found that I not only need to "load" the script, but also "run" it :)
I am taking the route of downloading the files, and then running them (as opposed to the session variable solution.)
As far as telling when the updater exe and dat files need to be updated, is that something that can be discovered by comparing their file sizes?
Also, I am thinking it may not be necessary because I can just release a patch (with Visual Patch) that could update both of those files if need be, right?
Desmond
08-23-2005, 04:35 PM
As far as telling when the updater exe and dat files need to be updated, is that something that can be discovered by comparing their file sizes?
I suppose that'd work . . . you'd have better luck checking the file's CRC value to see if it had changed, or combine both techniques to be oober safe!
Also, I am thinking it may not be necessary because I can just release a patch (with Visual Patch) that could update both of those files if need be, right?
Yes, that is definitely a way around it. :)
Good luck with the project!
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.