Indigo Rose Software
  #1  
Old 09-27-2005
rkligman rkligman is offline
Forum Member
 
Join Date: Sep 2005
Posts: 17
Must have same Download Path?

I was creating my Server Update script and noticed a small issue once I went to make it live. This is a LAN update. There is a line in the Server script that looks like:

-- Where do you want to download the installer/patch file from?
g_PatchFileSource = SessionVar.Expand("C:\\Projects\\SPMG\\Setup.exe") ;

This tells the Update where to find the Install file. It worked great. But on the Live system the location in not there. In fact, the location is NOT on my system. It's in \\Spmgfs1\ShrdFls\CA. So the script needed to be changed to:

g_PatchFileSource = SessionVar.Expand("\\\\Spmgfs1\\ShrdFls\\CA\\Setup .exe");

It worked great on the Live system but I now have a small dilemma on future updates. In order to test it on my system I have to uncomment one line and comment another. I suppose I could use an IF statement with a variable or Constant but it brings up a bigger question.

Let's say that I wanted some redundancy. It appears as if my redundant systems need to be the same hierarchically. How would I handle it if they weren't?

Now that I'm writing this out, the thought that comes to mind would be some way of knowing which TrueUpdate Server I'm on in order to set the g_PatchFileSource variable correctly. Is this the way to do it and if so, how?
  #2  
Old 09-28-2005
Mark's Avatar
Mark Mark is offline
Indigo Rose Staff Member
 
Join Date: Jun 2000
Location: Indigo Rose Software
Posts: 1,773
Hi,

If you wanted to simply test different locations during the test phase and the live phase, consider using a design-time constant to control this.

Since it appears as though you used the TrueUpdate wizard to generate your script, the index of the TrueUpdate server used will be stored in:
Code:
screen_globals.CurrentServerIndex
This is an index into the table of TrueUpdate servers returned by the action:
Code:
TrueUpdate.GetUpdateServerList()
This code where this is accomplished can be found on the 'Download Server Script' screen's 'On Start' event.

If you want to build some redundancy into your patch file location you could try doing it in a similar way to how TrueUpdate 2.0 handles redundancy for TrueUpdate servers. Try storing your patch file locations in a table and then loop through the table and check to see if the patch file specified in the table exists using a File.DoesExist() action. If it does exist then use that file.

Here is a quick example, instead of the g_PatchFileSource = SessionVar.Expand("\\\\Spmgfs1\\ShrdFls\\CA\\Setup .exe"); line try something like:

Code:
-- Table of patch files
tbPatchFiles = 
{
	"C:\\Path File one.exe"
	, "C:\\Path File two.exe"
	, "C:\\Path File three.exe"
};

g_PatchFileSource = "";
for index, patchFile in tbPatchFiles do

	-- Break out of this loop if this is the file we want
	if(File.DoesExist(patchFile)) then
		g_PatchFileSource = patchFile;
		break;
	end
end
Note: This example does not handle what happened if no patch files are found, you will probably want to handle this if you use this example.
__________________
MSI Factory The Next Generation Intelligent Setup Builder
  #3  
Old 09-28-2005
rkligman rkligman is offline
Forum Member
 
Join Date: Sep 2005
Posts: 17
OK, that seems to make sense. Basically the wizard just scratches the surface of what you can do. The key to real power is learning how to use the scripting.
  #4  
Old 09-29-2005
Mark's Avatar
Mark Mark is offline
Indigo Rose Staff Member
 
Join Date: Jun 2000
Location: Indigo Rose Software
Posts: 1,773
Quote:
Originally Posted by rkligman
OK, that seems to make sense. Basically the wizard just scratches the surface of what you can do. The key to real power is learning how to use the scripting.
That's very true rkligman, the Wizard sets up a basic True Update project that will cover the needs of most people, but if you need more then that or something very specific for your update, it will have to be done with scripting.

Some other nice things about the Wizard are that it provides a nice shell to get your going, and that it provides a lot of sample code for people to work off of.
__________________
MSI Factory The Next Generation Intelligent Setup Builder
 

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
Bug? Http download error not recorded by GetHTTPErrorInfo() Ken Gartner TrueUpdate 2.0 1 03-16-2005 08:56 AM
HOWTO: Download and Install Files from the Web Support Setup Factory 6.0 Knowledge Base 0 10-23-2002 02:16 PM
How do I add to my PATH statement at install? Tnygaard Setup Factory 6.0 3 05-27-2002 02:38 AM
PATH environment variable RDodson Setup Factory 6.0 4 02-27-2002 01:17 PM


All times are GMT -6. The time now is 12:06 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