PDA

View Full Version : Creating Shortcuts


OSSS
06-29-2009, 08:00 PM
how do i create a shortcut folder for the %ProductName% that will be placed on the users desktop and the Start > Program Files?

In my project (Archive Window) I have a list of files but not a list of folders that are installed. I ran a test installation and the correct folders have been placed in the Program Files as seen in windows explorer. I understand how to create shortcuts to the specific files but I really just need to be able to create shortcuts to the folders not files. please help!

I have referenced the users guide and help files but just cant seem to make sense of it!

Thank you in advance for your help.

Ulrich
06-30-2009, 01:44 PM
Hello,

to create a shortcut on the desktop to the folder where your application was installed, you may use an action like this in the On Post Install event:

Shell.CreateShortcut(_DesktopFolder, SessionVar.Expand("%ProductName%"), SessionVar.Expand("%AppFolder%"), "", "", "", nil, nil, nil, "");

Ulrich

OSSS
06-30-2009, 10:15 PM
Thank you!

What about getting "shortcut folders" into the Start > Program Files > %Product Name% > ADD SHORTCUT FOLDERS HERE

Thanks in advance!

OSSS

Ulrich
07-01-2009, 03:46 PM
You would do this in a similar way as before, for example:
Shell.CreateShortcut(SessionVar.Expand("%StartProgramsFolder%\\%ProductName%"), "Folder description", SessionVar.Expand("%AppFolder%"), "", "", "", nil, nil, nil, "");

Ulrich

OSSS
07-03-2009, 05:55 PM
thanks got it working!

however after we uninstall, the folders stay inplace (files are gone but not folders)....is there a way around that....something to add to the code maybe?

Ulrich
07-06-2009, 02:18 PM
Hello,

it should be no surprise that, if you use Lua actions to create shortcuts, you will need Lua actions to remove them as well. A look into the help file will reveal that you can use Shell.DeleteShortcut() to remove shortcuts that you created manually. You have to include these actions in the uninstaller, for example in the On Post Uninstall event.

Ulrich