Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

Trueupdate proxy / windows security problems

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trueupdate proxy / windows security problems

    Currently I have a program that tries to launch TrueUpdate to check for program updates. One of the PCs running my program requires a proxy server. When I manually run my program everything works great and TrueUpdate is able to work without any problems. However whenever I set my program to run as a service on this PC, TrueUpdate is able to start but is unable to download the ts1 file.

    Code:
    ------------------------------------------
    -- Download and run the Server Script
    ------------------------------------------
    
    -- Suppress the built-in error messages for script errors
    _SuppressErrorDialogs = true;
    
    -- Get the list of TrueUpdate Servers
    tableTrueUpdateServers = TrueUpdate.GetUpdateServerList();
    
    ----------------------------------------------------------
    --Rev 1.0.1
    --Set parameters URL parameters for HTTPS
    l_SourceURL = "https://www.****.com/trueupdate/****.ts1";
    l_HTTPTimeout = 200;
    l_HTTPPort = 443;
    l_HTTPUseBasicAuth = false;
    l_HTTPAuthUsername = "";
    l_HTTPAuthPassword = "";
    l_HTTPUseSSL = true;
    l_HTTPTransferType = MODE_BINARY;
    
    l_PatchFileDest = SessionVar.Expand("%SourceFolder%\\****.ts1");
    
    --Load parameters from the ini file
    l_ProxyServer = "";
    l_ProxyPort = "";
    l_ProxyUserName = "";
    l_ProxyPassword = "";
    l_UseProxyServer = false;
    
    iniFileTxt = TextFile.ReadToTable("%SourceFolder%\\****.ini");
    
    for index, line in iniFileTxt do
    	line = String.Left(line, String.Find(line, "'",1));
    	line = String.Replace(line, "'", "");
    	
    	if(String.Find(line, "ProxyServer", 1, false) > 0) then
    	
    		line = String.Mid(line, String.Find(line, "=",1) + 1, 100);
    		line = String.Replace(line, "\"", "");
    		line = String.TrimLeft(line)
    		line = String.TrimRight(line)
    	
    		l_ProxyServer = line;
    	end 
    	
    	if(String.Find(line, "ProxyPort", 1, false) > 0) then
    	
    		line = String.Mid(line, String.Find(line, "=",1) + 1, 100);
    		line = String.Replace(line, "\"", "");
    		line = String.TrimLeft(line)
    		line = String.TrimRight(line)
    	
    		l_ProxyPort = line;
    	end
    	
    	if(String.Find(line, "ProxyUserName", 1, false) > 0) then
    	
    		line = String.Mid(line, String.Find(line, "=",1) + 1, 100);
    		line = String.Replace(line, "\"", "");
    		line = String.TrimLeft(line)
    		line = String.TrimRight(line)
    	
    		l_ProxyUserName = line;
    	end
    	
    	if(String.Find(line, "ProxyPassword", 1, false) > 0) then
    	
    		line = String.Mid(line, String.Find(line, "=",1) + 1, 100);
    		line = String.Replace(line, "\"", "");
    		line = String.TrimLeft(line)
    		line = String.TrimRight(line)
    	
    		l_ProxyPassword = line;
    	end
    	
    end
    
    if (String.Length(l_ProxyServer) > 0) and (String.Length(l_ProxyPort) > 0) and (String.Length(l_ProxyUserName) > 0) and (String.Length(l_ProxyPassword) > 0) then
    	l_UseProxyServer = true;
    end
    ----------------------------------------------------------
    
    if(tableTrueUpdateServers) then
    
    	-- Loop through the list of TrueUpdate Servers
    	for index, ServerName in tableTrueUpdateServers do
    
    		-- Attempt to download the server configuration files
    		--Rev 1.0.1
    		--Make a HTTPS connection with the option of using a proxy server
    		--GotServerFiles = TrueUpdate.GetServerFile(ServerName, false);
    		tableBasicAuthData = nil;
    		if(l_HTTPUseBasicAuth) then
    			tableBasicAuthData = { UserName=l_HTTPAuthUsername, Password=l_HTTPAuthPassword };
    		end
    		
    		tableProxyData = nil;
    		if(l_UseProxyServer) then
    			tableProxyData = { PUserName=l_ProxyUserName, PPassword=l_ProxyPassword, PServerAddress=l_ProxyServer .. ":" .. l_ProxyPort };
    		end	
    		
    		-- Download the file using the appropriate protocal (HTTP or HTTPS)
    		if(l_HTTPUseSSL) then
    			HTTP.DownloadSecure(l_SourceURL, l_PatchFileDest, l_HTTPTransferType, l_HTTPTimeout, l_HTTPPort, tableBasicAuthData, tableProxyData);
    		else
    			HTTP.Download(l_SourceURL, l_PatchFileDest, l_HTTPTransferType, l_HTTPTimeout, l_HTTPPort, tableBasicAuthData, tableProxyData);
    		end
    		
    		GotServerFiles = TrueUpdate.LoadServerFile(_SourceFolder .. "\\fasremoteupdater.ts1", "40E4C71E-4679-4C76-932C-E8B5528CB772");
    		
    		-- If the download was successful, run the server script
    		if(GotServerFiles) then
    			TrueUpdate.RunScript("Server Script");
    			break;
    		end
    	end
    end
    My error :

    Code:
    [03/23/2012 09:12:24] Success	Update started: C:\Program Files\FAS_Remote\FasRemoteUpdater.exe
    [03/23/2012 09:12:24] Notice	Update engine version: 3.5.5.0
    [03/23/2012 09:12:24] Notice	Product: FASRemoteUpdater
    [03/23/2012 09:12:24] Success	Language set: Primary = 9, Secondary = 1
    [03/23/2012 09:12:24] Success	Include script: _TU20_Global_Functions.lua
    [03/23/2012 09:12:54] Error	Script: Client Script, Line 106 (2502)
    [03/23/2012 09:12:54] Success	Run client data event: Client Script
    [03/23/2012 09:12:54] Notice	Exit update process (Return code: 0)

  • #2
    If it's running as a service, does it have permissions needed to access the network (ie: the internet)

    Comment


    • #3
      Maybe just missing SessionVar.Expand?
      iniFileTxt = TextFile.ReadToTable("%SourceFolder%\\****.ini");
      iniFileTxt = TextFile.ReadToTable(SessionVar.Expand("%SourceFol der%\\****.ini"));

      Harald

      Comment

      Working...
      X