Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    113

    Help with ICON file

    I have an application that uses Shell.CreateShortcut to build desktop shortcuts to a number of batch files to start the application. However since I build on the C: drive if the client installs on other than the C: drive the shortcuts don't work because the "Target" points to the wrong path. The "Start in" also has to be changed.

    Does anyone know how to change the .ink files properties from within AMS5 Pro to accomplish this?

    Lee

  2. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by leebos
    I have an application that uses Shell.CreateShortcut to build desktop shortcuts to a number of batch files to start the application. However since I build on the C: drive if the client installs on other than the C: drive the shortcuts don't work because the "Target" points to the wrong path. The "Start in" also has to be changed.

    Does anyone know how to change the .ink files properties from within AMS5 Pro to accomplish this?

    Lee

    When the user selects a different directory where they want to install your project, save that directory as a variable. Then when you create the shortcut use that variable as part of the path to the file.

    Code:
    --Ask where they want to run their install
    strNewPath = Dialog.FolderBrowse("Select Install Folder", _ProgramFilesFolder);
    --[[run your install stuff here
    and here 
    and here]]
    --Then build your shortcut using the path selected above.
    Shell.CreateShortcut(Shell.GetFolder(SHF_DESKTOP), "Shortcut to My File", strNewPath.."\\AppFolder\\MyExe.exe", , , "", 0, SW_SHOWNORMAL, nil);
    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  3. #3
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    113
    Tigg,

    That works for a single shortcut, but not for my purpose. I have about 12 shortcuts stored in C:\application\icons. They point to C:\application\batfiles. Each batchfile calls in a different setup file and then starts the application.exe. For each of the 12 shortcuts I need to be able to change the "Target" and "Start in" locations. I don't know the batch file or shortcut names as they are created by other users. I use a File.Find to get them. I am able to change the batchfiles to work but not the .lnk files

    Lee

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by leebos
    Tigg,

    That works for a single shortcut, but not for my purpose. I have about 12 shortcuts stored in C:\application\icons. They point to C:\application\batfiles. Each batchfile calls in a different setup file and then starts the application.exe. For each of the 12 shortcuts I need to be able to change the "Target" and "Start in" locations. I don't know the batch file or shortcut names as they are created by other users. I use a File.Find to get them. I am able to change the batchfiles to work but not the .lnk files

    Lee

    Can you not recreate the shortcuts after you find the batch files?

    If not, it may require a dll call using Shell32 to change the information in an existing .lnk file. Worm or Intrigued may be able to help with their programming knowledge.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  5. #5
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    113
    Tigg,

    I could "IF" I knew the name of the original shortcut. They must remain the same.

    I found a dll written by Worm that gets the Target, I may be able to use that to rebuild the shortcut.

    Thanks,
    Lee

Similar Threads

  1. Audio Tracks Project
    By Michael in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 03-18-2004, 10:58 PM
  2. 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
  3. HOWTO: "Hide" Externally Referenced Files
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-23-2002, 03:19 PM
  4. Can search allow manual browse even if file is found?
    By RichardShaw in forum Setup Factory 5.0
    Replies: 2
    Last Post: 08-28-2000, 06:08 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