View Full Version : Executing TU client exe from the command line
Hi,
In TUv1 there is a command line option, /S:#, which can be used to run true update client through the command line where # signifies the screens that will be shown.
Is there any equivalent for this command line option in TUv2? The help file shows only 2 options, the /DATFILE:<<Filename>> and /T:<<FilePath>>.
thanks,
Ninj
Steven Carr
03-14-2005, 05:09 AM
You can parse the command line yourself.
I made it so that i have the option "/HIDE" on the command line to not show the screens unless there is an update available.
Then when the update.exe is called implictly I execute it with a /HIDE parameter and does not display unless an update is available. When it is called say from the menu option it has no additional parameter and displays all the screens.
Here are some sections of the Client Script (basically merged from the silent install example and the code that was already there)
g_SilentUntilUpdateAvailable = false;
for idx, sArg in _CommandLineArgs do
if( sArg == "/HIDE" ) then
g_SilentUntilUpdateAvailable = true;
end
end
followed by
if(g_SilentUntilUpdateAvailable) then
-- Get the list of TrueUpdate Servers
tableTrueUpdateServers = TrueUpdate.GetUpdateServerList();
if(tableTrueUpdateServers) then
-- Loop through the list of TrueUpdate Servers
for index, ServerName in tableTrueUpdateServers do
-- Attempt to download the server configuration files
GotServerFiles = TrueUpdate.GetServerFile(ServerName, false);
-- If the download was successful, run the server script
if(GotServerFiles) then
TrueUpdate.RunScript("Server Script");
break;
end
end
end
else
if( not _ClientRestarted ) then
Result = Screen.Show("Startup");
end
if(Screen.Show("Connect to Server") == SR_SUCCESS) then
TrueUpdate.RunScript("Server Script");
end
end
There is one additional area you may want to add in the Server script in the case of an error in the confuration. Basically is is along the lines of
if(not g_SilentUntilUpdateAvailable) then
Screen.Show("Update Actions Failed");
end
Of course there is nothing limiting the arguments you use or the effect they have. I just used this to emulate the way i used the command line argument /S:# from TU1.
Hope this helps
Hi Steven,
It does make a lot of sense. Thanks! :)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.