Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2001
    Location
    La Crosse, WI, USA
    Posts
    11

    Huh? set install path on network by finding unique file

    We normally apply our software update CDs through a client's PC on a Novell or Windows network system. Our software resides on the server. Our clients have several possible local drive mappings to their server. In SF5.0, I would use a file search variable and search in several priority search paths for a particular file (found under the folder that resides in the root of the install path) , then store that "drive and folder" variable as the 'install to' path. For instance, our path might be f:\apps\hms, or g:\hms, or g:\apps\hms. The file I look for resides in folder 'hms'. Could someone show me what the "On Startup" coding would look like?

    Thanks.

  2. #2
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    Something like this is a good start:

    Code:
    -- search for the file.
    -- NOTE: Found will be nil if the file is not found
    Found = File.Find("C:\\MyDir\\", "file.ext", true, false, nil, nil);
    
    -- if a file was found
    if Found ~= nil then
    
    -- Break up the result path
    FileParts = String.SplitPath(Found[1]);
    -- put it back together without the filename since you want the folder that
    -- the searched for file resides in.
    FolderPath = FileParts.Drive.."\\"..FileParts.Folder;
    
    -- Set the AppFolder to the folder that the file was found in
    SessionVar.Set("%AppFolder%",FolderPath);
    end
    Adam Kapilik

  3. #3
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    I had a similar task: To find the executable on a network drive (I had to look for two files in the same directory). A file search on a network drive might be time consuming.

    I created (in SUF60) a search process with user interaction:

    * Ask the user what network drive to search (network drives in a table)
    * Ask the use what directory we should start with (might be the root)
    * Perform a recursive search

    When the result is found; store the directory in the Registry. Much easier next time!

    (I'm going to convert that project to SUF70 later on.)

  4. #4
    Join Date
    Sep 2001
    Location
    La Crosse, WI, USA
    Posts
    11

    best way to file.find for multiple search paths

    Adam - our software resides on nearly 48 possible drive mappings (but only one mapping for a given customer-so only storing one result). What is the syntax that I could use so that I don't need to create a separate action (approx 48) to cover each path to check? (e.g., c:\apps\hms, c:\hms, d:\hms, d:\apps\hms, etc.)

    Unfortunately, user intervention is what I am trying to avoid; many of our users are not terribly computer literate and not certain of their network mapping to our software, which will cause our updates to fail if they guess incorrectly.

    Thanks!

  5. #5
    Join Date
    Oct 2003
    Posts
    908
    The easiest and best route is to store your installation path in the registry or an .ini file during installation. The next time you need to get the info, you can simply read the registry key or .ini file and get your answer right away. Otherwise, you'll have to do a bunch of file searches. I can't think of any way out of it - other than just starting at the root of the drive in the first place. It'll take longer for the user, but it's faster for you...

  6. #6
    Join Date
    Sep 2001
    Location
    La Crosse, WI, USA
    Posts
    11

    Huh? sounds like a loss of functionality

    I could easily search several priority search paths in SF5.0 in one operation. Storing the path info in registry or ini is not an option; if stored in the registry, they may use a different workstation to apply subsequent installs; if stored in ini file, it has to be an ini file on the server and I still wouldn't be able to tell the installer a specific drive location to look at.

    I am in the Trial stage of evaluating SF7.0. If there isn't a better coding solution, we will remain with SF5.0 for now.

  7. #7
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    You certainly can "search several priority search paths in one operation" with SUF70 (if you want). Whatever search engine you are using, the operation might be time consuming on huge network drives. That's why I prefer to offer a partially user interactive search.

    BTW, Dealing with a server installed application I recommend my customers to use the same workstation for installation/upgrades. (= use of Registry)

  8. #8
    Join Date
    Jan 2000
    Posts
    2,002
    Quote Originally Posted by Dane Lamb
    I could easily search several priority search paths in SF5.0 in one operation. Storing the path info in registry or ini is not an option; if stored in the registry, they may use a different workstation to apply subsequent installs; if stored in ini file, it has to be an ini file on the server and I still wouldn't be able to tell the installer a specific drive location to look at.

    I am in the Trial stage of evaluating SF7.0. If there isn't a better coding solution, we will remain with SF5.0 for now.
    What about making a function like this:

    Code:
    function FindFolderOnDrives()
    	tblDrives = Drive.Enumerate();
    	if(tblDrives)then
    		for index, strDriveName in tblDrives do
    			if((Drive.GetType(strDriveName) == DRIVE_FIXED) or (Drive.GetType(strDriveName) == DRIVE_REMOTE))then
    				local strPath = strDriveName.."hms";
    				if(Folder.DoesExist(strPath))then
    					return strPath;
    				end
    				strPath = strDriveName.."apps\\hms";
    				if(Folder.DoesExist(strPath))then
    					return strPath;
    				end
    			end
    		end
    	end
    	
    	return "";
    end
    Then you can call it and it will check all fixed and remote drives for certain paths. You can expand on the above to do much more as well, but it might provide a good starting point.

    - Brett

Similar Threads

  1. HOWTO: Create a Project Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 01:49 PM
  2. HOWTO: Download and Install Files from the Web
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-23-2002, 01:16 PM
  3. INFO: How to Set the Default Application Directory
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-25-2002, 12:02 PM
  4. Parse Path, finding file before install....
    By NTDmods in forum Setup Factory 6.0
    Replies: 2
    Last Post: 04-09-2002, 02:25 PM
  5. Replies: 0
    Last Post: 08-17-2000, 02:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts