Start shortcut problem - 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!

rconn
Posts: 70
Joined: Sat Mar 03, 2007 5:38 pm

Start shortcut problem

About three years ago I reported a problem with the shortcuts dialog creating the start menu shortcut even if it was not selected.

At that time you said it would be fixed in 6.4, and gave me a workaround in the meantime:

---------------------

This is a known bug in Advanced Installer and it will be fixed in a future version.
Until then, you can use a custom action to remove this folder. Here is what I used in my tests:

Code: Select all

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:

Code: Select all
(NOT Installed) AND NOT AI_STARTMENU_SH

-----------------------

This still seems to be broken in 8.4, and the workaround stopped working at some point. Using 8.4 (Enterprise) & Windows 7, the start menu shortcut is always created (whether the custom action is defined or not).

Rex Conn
JP Software
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Start shortcut problem

Hi Rex,

This issue has been fixed. If you add a shortcut in the Application Shortcut Folder( set to [ProgramMenuFolder] ), the ShortcutDlg "Start Menu Programs folder" checkbox will determine if the shortcut is installed or not.

Do you have the same settings ?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rconn
Posts: 70
Joined: Sat Mar 03, 2007 5:38 pm

Re: Start shortcut problem

Not sure I understand what you're saying.

I have a shortcut defined in "Start Menu" (as well as one in "Application Shortcut Folder" and one in "Desktop"). Are you saying I should remove the one in "Start Menu" and it will somehow be set from the one in "Application Shortcut Folder"? (And where does "[ProgramMenuFolder]" get set?)

Rex Conn
JP Software
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Start shortcut problem

Hi Rex,

By default "Application Shortcut Folder" is set to [ProgramMenuFolder][ProductName]. ProgramMenuFolder is resolved to "Start Menu\Programs" folder on the target machine.

Our ShortcutsDlg dialog can remove only Application Shortcut Folder. This is because it uses a specific installer property which contains the entire folder path. If you create custom folders under "Start Menu\Programs" directory in "Files and Folders" page, our dialog has no way of knowing what paths your shortcuts use.

So make sure that your Start menu programs are placed in Application Shortcut Folder and not in the predefined "Start Menu" folder from Files and Folders page.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rconn
Posts: 70
Joined: Sat Mar 03, 2007 5:38 pm

Re: Start shortcut problem

Hi Cosmin:

I'm not creating the shortcut in a folder; it's in the root of "Start Menu" -- so that it will appear at the top of the Start menu (before any of the program folders).

The shortcut does get created in the root of "Start Menu"; the problem is it is *always* created, regardless of the checkbox value. Is it not possible to optionally create a shortcut there with Advanced Installer?

I've tried creating the shortcut with & without the wizard, but it is still always created during installation.

Rex Conn
JP Software
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Start shortcut problem

Hi Rex,

You can add the shortcut in any location you need and condition its component with a checkbox control's attached public property. However, the installation of a shortcut cannot be conditioned directly because it is linked to its target. Therefore, a shortcut to a file must be in the same component as the file. This is why in order to condition the installation of a shortcut it must point to an external file.

The target of an external shortcut is not in the installation package, therefore you can move it to any component you want. You can add the shortcut to an existing component or create a new one by using a dummy registry entry and condition it by using the Organization page.

Here is an article with the steps to achieve this functionality. The "Condition the creation of the shortcut" section is relevant in your case.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”