Indigo Rose Software
  #1  
Old 12-19-2008
pramod pramod is offline
Forum Member
 
Join Date: Sep 2008
Posts: 27
Update for HTTP and LAN

Hello Friends,

when i m trying to create an script which is used to update from both the HTTP and LAN server. But when use the wizard it work only for one either HTTP or LAN. Please show me the steps to create script for both HTTP and LAN.

Thanks,
Reply With Quote
  #2  
Old 12-19-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,901
you mean you get some files from the LAN and some files from HTTP?

You're going to have to do some scripting -- but it's easy once you get the hang of it..
__________________
Reply With Quote
  #3  
Old 12-19-2008
pramod pramod is offline
Forum Member
 
Join Date: Sep 2008
Posts: 27
TrueUpdate Server

Quote:
Originally Posted by jassing View Post
you mean you get some files from the LAN and some files from HTTP?

You're going to have to do some scripting -- but it's easy once you get the hang of it..
Can we take the trueupdate server from the script.
Reply With Quote
  #4  
Old 12-20-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,901
I don't understand what you mean...
__________________
Reply With Quote
  #5  
Old 12-21-2008
pramod pramod is offline
Forum Member
 
Join Date: Sep 2008
Posts: 27
TrueUpdate server

Quote:
Originally Posted by jassing View Post
I don't understand what you mean...
Hello jassing,

Thanks for the reply.
i just want to take the Trueupdate server path from the path specified in the script not the path specified in the project wizard.
Reply With Quote
  #6  
Old 12-22-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,901
Have a look here:
http://www.indigorose.com/forums/showthread.php?t=22862
that should give you the ideas behind it...
__________________
Reply With Quote
  #7  
Old 12-23-2008
pramod pramod is offline
Forum Member
 
Join Date: Sep 2008
Posts: 27
Error : URL not found

Quote:
Originally Posted by jassing View Post
Have a look here:
http://www.indigorose.com/forums/showthread.php?t=22862
that should give you the ideas behind it...
Hello jassing,

when i m run the TrueUpdateClient.exe then it thrown a error "The requested URL was not found on the server". Below show the error log


[12/23/2008 15:04:51] Success Update started: D:\Projects\VB\Robin\CropTrakGPS\Update Output\UpdateClient.exe
[12/23/2008 15:04:51] Notice Update engine version: 3.0.1.0
[12/23/2008 15:04:51] Notice Product: FDM, version %ProductVer%
[12/23/2008 15:04:51] Success Language set: Primary = 9, Secondary = 1
[12/23/2008 15:04:51] Success Include script: _TU20_Global_Functions.lua
[12/23/2008 15:04:56] Error An error occurred when trying to download the server file. Server ID: TrueUpdate Server 1 : The requested URL was not found on the server. (3624)
[12/23/2008 15:04:56] Error Script: Client Script, Line 61 (3624)
[12/23/2008 15:04:56] Success Run client data event: Client Script
[12/23/2008 15:04:57] Notice Exit update process (Return code: 0)

Thanks & Regards,
Pramod.
Reply With Quote
  #8  
Old 12-23-2008
pramod pramod is offline
Forum Member
 
Join Date: Sep 2008
Posts: 27
Error Message

Quote:
Originally Posted by jassing View Post
Have a look here:
http://www.indigorose.com/forums/showthread.php?t=22862
that should give you the ideas behind it...
Hello jassing,

The following error is shown: Script: Server Script, Line 56: attempt to index global `g_TargetVersion' (a nil value) (-1)

what was the reason to come this error.
How to solve this error.

Thanks & Regards,
Pramod.
Reply With Quote
  #9  
Old 12-23-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,901
Quote:
Originally Posted by pramod View Post
Hello jassing,

The following error is shown: Script: Server Script, Line 56: attempt to index global `g_TargetVersion' (a nil value) (-1)

what was the reason to come this error.
How to solve this error.

Thanks & Regards,
Pramod.
Since I don't know what is at your line 56 -- I can't even begin to help you there; but you're trying to use nil as a table; which doesn't work.
as for your other error; it sounds like you are trying to access a url on a server that doesn't exist...
__________________
Reply With Quote
  #10  
Old 12-24-2008
pramod pramod is offline
Forum Member
 
Join Date: Sep 2008
Posts: 27
Read update server path

Quote:
Originally Posted by jassing View Post
Since I don't know what is at your line 56 -- I can't even begin to help you there; but you're trying to use nil as a table; which doesn't work.
as for your other error; it sounds like you are trying to access a url on a server that doesn't exist...
Thanks for reply....

I'd like to set the location of my TrueUpdate servers by reading from the registry.
I've looked on the TU2 help, but wasn't able to find it.
Reply With Quote
  #11  
Old 12-24-2008
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
Quote:
I'd like to set the location of my TrueUpdate servers by reading from the registry.
You can't insert new information in TrueUpdate's server list table in runtime. All servers have to be informed before you build the updater, if you want to use TrueUpdate.GetServerFile().

You may, however, download the server files by yourself if they are to be retrieved from a location not on the TU server list, and like jassing said - some scripting is required. Here is my suggestion:
  1. For example, you could retrieve the IP address from where to download the server files from an *.INI file with INIFile.GetValue(), or from the registry with Registry.GetValue() if it was inserted there.
  2. After you have the current address from where to check for an update, build the new URL and use HTTP.Download() to retrieve the three files (*.ts1, *.ts2 and *.ts3) from the remote server (or from the LAN) and store them locally in the same (temporary) folder.
  3. Then, after you have managed to fetch the files, use TrueUpdate.LoadServerFile() to load the *.ts1 file with the correct encryption key.
  4. Finally, if the file was loaded without error, use TrueUpdate.RunScript() to perform the steps necessary to update the installation.
You should be able to find examples for each step in the help file.

Ulrich
__________________

Last edited by Ulrich; 12-26-2008 at 07:38 AM.
Reply With Quote
  #12  
Old 12-24-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,901
Quote:
Originally Posted by pramod View Post
Thanks for reply....

I'd like to set the location of my TrueUpdate servers by reading from the registry.
I've looked on the TU2 help, but wasn't able to find it.
have you looked at Registery.GetValue()?
__________________
Reply With Quote
  #13  
Old 12-25-2008
pramod pramod is offline
Forum Member
 
Join Date: Sep 2008
Posts: 27
Thanks for reply,

I want to set the TrueUpdate Server path from the registry in client script (download server script). i'll try to get the servername but it throw error "The requested URL was not found on the server". Can you show me example.

Regards,
Pramod.
Reply With Quote
  #14  
Old 12-25-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,901
Quote:
Originally Posted by pramod View Post
Thanks for reply,

I want to set the TrueUpdate Server path from the registry in client script (download server script). i'll try to get the servername but it throw error "The requested URL was not found on the server". Can you show me example.

Regards,
Pramod.
Didn't you post this the other day? Can you pull up the url on another computer? What url is the client trying to get? did you load the files to the server as specified in the docs?
__________________
Reply With Quote
  #15  
Old 12-25-2008
pramod pramod is offline
Forum Member
 
Join Date: Sep 2008
Posts: 27
Update for HTTP and LAN

Quote:
Originally Posted by jassing View Post
Didn't you post this the other day? Can you pull up the url on another computer? What url is the client trying to get? did you load the files to the server as specified in the docs?
Hello Jassing,

yes i have load the file on the server.

and the client script for OnStart is this

function GetServerFileCallback(BytesDownloaded, FileSize, TransferRate, SecondsLeft, EstimatedTimeRemaining, ServerStatusMessage, tableClientUpdateInfo)

-- Did the user click Cancel?
if(screen_globals.Cancelled) then
-- Tell the GetServerFile action to abort
return false;
end


local Downloading = TrueUpdate.GetLocalizedString("MSG_UPDATE_INFORMAT ION");

-- Set appropriate messages if we're updating the TrueUpdate Client
if(tableClientUpdateInfo) then
-- What part of the Client are we updating?
if(tableClientUpdateInfo.UpdateType == 0) then
Downloading = TrueUpdate.GetLocalizedString("MSG_UPDATE_EXECUTAB LE");
else
Downloading = TrueUpdate.GetLocalizedString("MSG_UPDATE_DATA");
end
end

-- Reset the progress bar if we've started downloading something different
if((screen_globals.Downloading == nil) or (Downloading ~= screen_globals.Downloading)) then

DlgProgressBar.SetPos(CTRL_PROGRESS_BAR_01, 0);

screen_globals.Downloading = Downloading;
end

-- Update the status text to show what we're downloading
DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_ 01, {Text=TrueUpdate.GetLocalizedString("MSG_DOWNLOADI NG")..": "..Downloading.." "..TrueUpdate.GetLocalizedString("MSG_FROM").. " "..TrueUpdate.GetLocalizedString("MSG_SERVER_NUMBE R").." "..screen_globals.CurrentServerIndex});

-- Calculate the percentage that has been downloaded so far
local PercentComplete = 0;
if(FileSize > 0) then
PercentComplete = (BytesDownloaded/FileSize) * 100;
end

-- Update the progress bar
DlgProgressBar.SetPos(CTRL_PROGRESS_BAR_01, PercentComplete);

-- Update the status text
if(ServerStatusMessage == "") then
-- We're downloading...

-- Shorten the TransferRate to 2 decimal places
local TransferRateFormatted = string.format("%.2f", TransferRate);

if(FileSize > 0) then

local StatusText = TrueUpdate.GetLocalizedString("MSG_ESTIMATED_TIME_ LEFT")..": "..EstimatedTimeRemaining.." - "..TrueUpdate.GetLocalizedString("MSG_TRANSFER_RAT E")..": "..TransferRateFormatted.." "..TrueUpdate.GetLocalizedString("MSG_KB_PER_SEC") ;
DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_ 02, {Text=StatusText});
else

local SecondsElapsed = os.time() - screen_globals.TimeStarted;

local TimeElapsed = g_GetFormattedTime(SecondsElapsed);

local StatusText = TrueUpdate.GetLocalizedString("MSG_ELAPSED_TIME"). .": "..TimeElapsed.." - "..TrueUpdate.GetLocalizedString("MSG_TRANSFER_RAT E")..": "..TransferRateFormatted.." "..TrueUpdate.GetLocalizedString("MSG_KB_PER_SEC") ;
DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_ 02, {Text=StatusText});
end

else
-- We're waiting for the server...

-- Show the current status message
DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_ 02, {Text=ServerStatusMessage});
end

-- Tell the GetServerFile action to continue
return true;
end

------------------------------
-- Download the server files
------------------------------

-- Get the list of TrueUpdate Server locations
local tableTrueUpdateServers = TrueUpdate.GetUpdateServerList();

if(tableTrueUpdateServers) then

screen_globals.TimeStarted = os.time();

for index, ServerName in tableTrueUpdateServers do

screen_globals.CurrentServerIndex = index;

screen_globals.GotServerFiles = TrueUpdate.GetServerFile(ServerName, true, GetServerFileCallback);

-- Break out of this loop if we succeeded
if(screen_globals.GotServerFiles) then
break;
end
end
end


how can i pass the URL form the registry in this code.

please help me.

Last edited by pramod; 12-25-2008 at 10:59 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 3038: Could not seek in compressed file Rikard Setup Factory 7.0 Discussion 2 05-25-2006 12:55 PM
Adding a TU2 LAN update server Tek TrueUpdate 2.0 7 04-11-2005 01:39 PM
WinXP MCE - LAN port problem Derek General Chat 2 03-07-2005 01:32 AM
Complex LAN update rodion TrueUpdate 1.0 2 01-03-2005 11:18 AM
KB: Determining if a Network (LAN) is Present Desmond AutoPlay Media Studio 5.0 Examples 1 08-07-2004 11:39 PM


All times are GMT -6. The time now is 06:01 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software