We have our TrueUpdate files in the same server/directory as the actual payloads. Is there a way to retrieve that location in a script rather than a separate SessionVar? It would be safer to maintain just one location in the code.
Announcement
Collapse
No announcement yet.
Retrieve TrueUpdate server Url as a SessionVar
Collapse
X
-
You can try this:
1) Create a session variable, like "%MyLocation%", under Project > Session Variables. You can leave the contents blank, just define the session variable.
2) Open the TrueUpdate Server list, and create a server from where you want to download the files from. But instead of writing down the location as a complete URL or LAN address, place the session variable %MyLocation% there.
3) At some moment before the line with
Code:GotServerFiles = TrueUpdate.GetServerFile(ServerName, true);
Ulrich
-
Hello, I am trying to do something similar as we execute updates to many client with the same folder structure. I would like to create 1 update process that utilizes an XML file for all the paths. I have the XML working for all the comparison files, but I am trying to get it to work with the server itself. So far I have the following
-- LOAD THE XML FILE
XML.Load(_SourceFolder.."\\ClientConfig.xml");
-- Check whether an error occurred
error = Application.GetLastError();
-- If no errors occurred...
if (error == XML.OK) then
-- SET THE SERVER VALUE
SessionVar.Set("%ClientServer%", XML.GetValue("ClientConfig/Servers/ServerName"));
else
--Dialog.Message("Error", _tblErrorMessages[error]);
TrueUpdate.WriteToLogFile ("Error : ".._tblErrorMessages[error].."\r\n", true);
end
-- result = TrueUpdate.GetServerFile("JCS Server", false, nil);
-- lsTmpServerName = SessionVar.Expand("%ClientServer%");
result = TrueUpdate.GetServerFile(SessionVar.Expand("%Clien tServer%"), false, nil);
if (result) then
TrueUpdate.RunScript("Server Script");
else
Dialog.Message("Message", "This is bad", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
error = Application.GetLastError();
if (error ~= 0) then
TrueUpdate.WriteToLogFile ("Error : ".._tblErrorMessages[error].."\r\n", true);
end
end
I have tried a couple different things in defining what the value used in the GetServerFile command, but I always end up at the 'This is bad' line.
Am I doing something incorrectly?
Thank you
Comment
Comment