Announcement

Collapse
No announcement yet.

Update for HTTP and LAN

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

  • jassing
    replied
    Originally posted by pramod View Post
    can i write a script which have read URL for HTTP and LAN server both or not in TrueUpdate 3.0?
    Hmm. that's a tricky question; the "can" part is the bit I don't know ;-)

    But seriously, yes; scripting can be writen to do just about anything you want; as long as it's possible to w/o scripting... IOW --if you can do it on the pc you want to "update" then it can be scripted.

    Leave a comment:


  • pramod
    replied
    Update for HTTP and LAN

    Originally posted by jassing View Post
    To read a value from the registry
    See:
    Registry.GetValue()
    can i write a script which have read URL for HTTP and LAN server both or not in TrueUpdate 3.0?

    Leave a comment:


  • jassing
    replied
    To read a value from the registry
    See:
    Registry.GetValue()

    Leave a comment:


  • pramod
    replied
    Update for HTTP and LAN

    Originally posted by jassing View Post
    did you upload the files to the server?

    regarding your "registry" question -- are you reading the local registry to find out where the files are on the server?

    Unless it's a local network; you're not going to be able to read a remote registry -- and if you can; it would be a serious security hole.
    yes the value of server URL saved in the local registry.

    Leave a comment:


  • jassing
    replied
    did you upload the files to the server?

    regarding your "registry" question -- are you reading the local registry to find out where the files are on the server?

    Unless it's a local network; you're not going to be able to read a remote registry -- and if you can; it would be a serious security hole.

    Leave a comment:


  • pramod
    replied
    Update for HTTP and LAN

    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, 10:59 PM.

    Leave a comment:


  • jassing
    replied
    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?

    Leave a comment:


  • pramod
    replied
    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.

    Leave a comment:


  • jassing
    replied
    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()?

    Leave a comment:


  • Ulrich
    replied
    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, 07:38 AM.

    Leave a comment:


  • pramod
    replied
    Read update server path

    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.

    Leave a comment:


  • jassing
    replied
    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...

    Leave a comment:


  • pramod
    replied
    Error Message

    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.

    Leave a comment:


  • pramod
    replied
    Error : URL not found

    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.

    Leave a comment:


  • jassing
    replied
    Have a look here:
    http://www.indigorose.com/forums/showthread.php?t=22862
    that should give you the ideas behind it...

    Leave a comment:

Working...
X