Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006
    Location
    Lincoln, NE
    Posts
    1

    Grin Newbie Trying to Set AppFolder

    Hi, all. I'm trying to reset the default installation folder for an app, depending on whether or not the user has already installed a previous version. I'm able to locate the EXE file itself, but then I'm stumped; how do I change the default app folder to reflect the location of that (previously installed) file?

    Here's what I'm using to find the file (mostly snagged from someone else's previous post on a related subject - thanks!):

    Code:
    
    for i,v in tbDrives do
    	if Drive.GetType(v) == DRIVE_FIXED then
    		tbFile = File.Find(v, "MyApp.exe", true, false, nil, nil);
    		if not tbFile then
    		else
    			-- SET THE DEFAULT INSTALL FOLDER HERE!
    			break
               end
         end
    end
    
    I figure I could also do it by checking the Registry to find the app's current location, but I didn't get anywhere with that, either.

    Seems simple enough, so I must just not be understanding something about syntax, variables, etc. (Or else I need sleep.)

    Thanks for any help you can offer!

  2. #2
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    Try something like this:

    Code:
    for i,v in tbDrives do
    	if Drive.GetType(v) == DRIVE_FIXED then
    		tbFile = File.Find(v, "MyApp.exe", true, false, nil, nil);
    		if not tbFile then
    		
    		else
    			Paths = String.SplitPath(tbFile[1]);	
    			SessionVar.Set("%AppFolder%", Paths.Drive..Paths.Folder);		
            end
         end
    end
    Adam Kapilik

Similar Threads

  1. Newbie: Create nested shortcut menus
    By tim_mj in forum Setup Factory 7.0
    Replies: 1
    Last Post: 07-27-2005, 11:42 AM
  2. How to put a variabele in a WriteFromString
    By brianlesker in forum Setup Factory 7.0
    Replies: 11
    Last Post: 10-04-2004, 05:44 PM
  3. List box item value to set up loop
    By bruciori in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 04-17-2003, 03:06 PM
  4. HOWTO: Set up an MP3 Playlist
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 11:57 AM
  5. 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

Posting Permissions

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