Bug: Issue shortcut - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Atlas
Posts: 30
Joined: Sun Mar 16, 2008 11:08 am

Bug: Issue shortcut

I activated the dialog that lets the user specify in which places he wants shortcuts added to his computer. If he leaves checked the option to add a shortcut to the start menu, then it is added in a folder like this:

[folder]/[shortcut]

However, if the user unselects that option, the folder is still created:

[folder]/<empty>
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

This is a bug in Advanced Installer and it will be fixed in the next version. Thank you for bringing this to our attention.

Until then, you can use a custom action to remove this folder. Here is what I used in my tests:

Code: Select all

Function removeDir()
   Dim pathToFolder, smallPath
   Set objFS = CreateObject("Scripting.FileSystemObject")
   pathToFolder = Session.Property("SHORTCUTDIR")   
   smallPath=Left(pathToFolder,Len(pathToFolder)-1)     
   If (objFS.FolderExists(smallPath)) then
      objFS.DeleteFolder smallPath, true     
   End if
End Function
You can write this into a .VBS file and add it as an attached custom action under "InstallExecuteSequence" -> "InstallFinalize". In the "Function Name" field you can set removeDir and you should condition the custom action with (NOT Installed).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Atlas
Posts: 30
Joined: Sun Mar 16, 2008 11:08 am

Thank you for the help. Now I have another problem related to this:

Since I only have 1 shortcut, I don't want it to appear within a folder, but rather appear directly in the start menu. I discovered that I can do this by putting the shortcut in "Start Menu\Programs". However, if you put the shortcut there then it is always created, even if the user un-checks the box for creating shortcuts in the start menu.

Is it possible to create a shortcut without a folder and still have the user be able to decide whether or not he wants the shortcut created?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

This can be done by creating an external shortcut which points to the file installed by your package. After the shortcut is created, you can go to the "Organization" page and condition the installation of the component of the shortcut.

Note that it is recommended that you first move the shortcut to a dummy component (for example a component which contains a registry entry) in order to obtain a component which is installed only if the user wants to create the shortcut.

You can condition this component with the AI_STARTMENU_SH property which corresponds to the "Start Menu Programs folder" checkbox on "ShortcutsDlg".
http://www.advancedinstaller.com/user-g ... rties.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”