Create Desktop Shortcut to a folder

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • mdxafx
    Forum Member
    • Nov 2006
    • 13

    Create Desktop Shortcut to a folder

    Hi All,

    Im using Setup Factory to install some project files, they are word, excel..etc, to a users (selected Drive) within the folder named -> Exercise Files.

    The files install fine to any chosen Drive,

    but i want to be able to create a shortcut of where the folder has been installed, c: d: e:\Exercise Files to the desktop for easy acess.

    Im a little stuct as how to do this?
    could someone please push me in the right direction as where to start?


    Thanks all.
    Mdx.
  • Tek
    Forum Member
    • Mar 2004
    • 695

    #2
    If you are using the %AppFolder% variable for your installation folder, this will create a shortcut on the desktop for it.

    Code:
    Shell.CreateShortcut(Shell.GetFolder(SHF_DESKTOP), "My Files", SessionVar.Expand("%AppFolder%"), "", "", "", 0, SW_SHOWNORMAL, nil, "");

    Comment

    • mdxafx
      Forum Member
      • Nov 2006
      • 13

      #3
      Thanks Tek,

      The path was slightly extented so first time build of:-

      Shell.CreateShortcut(Shell.GetFolder(SHF_DESKTOP), "My Files", SessionVar. Expand("%AppFolder%"), "", "", "", 0, SW_SHOWNORMAL, nil, "");

      didn't work!

      Then i realised my path was %AppFolder%\Exercise Files

      so i added it:-

      Shell.CreateShortcut(Shell.GetFolder(SHF_DESKTOP), "My Files", SessionVar. Expand("%AppFolder%\\Exercise Files"), "", "", "", 0, SW_SHOWNORMAL, nil, "");

      And it worked, Thanks a lot!
      great help!:yes :yes :yes

      Mdx

      Comment

      • mamun
        Forum Member
        • Jan 2008
        • 14

        #4
        Thanks... I used that and succeeded..

        well, can you help that,
        when i will uninstall it the shortcut will be removed.
        but how can i do that and where i have to write code.

        Best Regards,
        Abdullah Al Mamun

        Comment

        • Adam
          Indigo Rose Staff Member
          • May 2000
          • 2148

          #5
          There are 2 ways you can do this:

          1) You can add the shortcut to the uninstall file using:

          Code:
          UninstallData.AddItem(UNINDATA_SHORTCUTS, {Filename="full path to .lnk file"});
          2) Or you can add a Shell.DeleteShortcut() action to the uninstall actions section.

          Adam Kapilik

          Comment

          Working...
          X