No announcement yet.

TrueUpdate Servers use dynamic path

  • Filter
  • Time
  • Show
Clear All
new posts

  • TrueUpdate Servers use dynamic path

    I would like to specify the TrueUpdate Servers path based on a variable I get from _CommandLineArgs at runtime. For example, I'd like to have a base url of 'https://server/path/' stored in the Servers list as 'baseURL' then get a string 'var' from _CommandLineArgs and append this to form the actual location I wish to get the server files from as in 'https://server/path/%var%'. Is there any way to do this or is there a better way to achieve what I want? Basically I want the client to be able to determine where the download should come from at runtime but I may not know all possible paths to predefine in the TrueUpdate Servers list.

    Thanks for any advice on the matter,

  • #2
    You can do it this way:
    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

      GotServerFiles = TrueUpdate.GetServerFile(ServerName, true);

      you will have to set the contents of the session variable properly, using SessionVar.Set(). Fetch the info where to get the server files from, using the registry, command line arguments or wherever you expect them to be stored, and adjust the contents of the session variable.


    • #3
      Perfect! SessionVar.Set() is exactly what I need. Thanks for your prompt help as always!