blak3r
Posts: 8
Joined: Wed Jun 17, 2009 7:40 pm

MSI Command Line to prevent Start Menu Shortcuts?

Is there a way to pass an option to an msi to prevent it from installing the Start Menu Shortcuts?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: MSI Command Line to prevent Start Menu Shortcuts?

Hello,

There is no command to automatically achieve this. However, if you created the msi using Advanced Installer, and you have access to the .aip project file, you can pass properties through command line to the msi using this format:

Code: Select all

yourinstaller.msi PROPERTYNAME="Property value"
You can then use this property in a condition that tests whether to install the shortcuts in Start Menu, like explained in the following paragraphs.

Please note that Start Menu Shortcuts are not installed by default, unless you specifically place them in the "Application Shortcut" folder on the "Files and Folders" page. Please follow our comprehensive guide on Creating Shortcuts.

You can conditionally place shortcuts there by:
- organizing your shortcuts into Components from the Organization page
- selecting the component and then pressing "..." in the Condition edit box. The Condition Dialog will pop up
- use the Condition Dialog to form a condition, using the property you are passing to your installer thorough command line
- for your purpose, you can simply place "NOT PROPERTYNAME" as the condition. The condition will fail if a property with the "PROPERTYNAME" name and a random value is passed to the msi, and no shortcuts will be installed in the Start folder

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
blak3r
Posts: 8
Joined: Wed Jun 17, 2009 7:40 pm

Re: MSI Command Line to prevent Start Menu Shortcuts?

Hi Gabriel,

Thanks for your response.

It's unclear to me how you create a "Start menu shortcut" show up as a "resource" that could could then be placed into a component on the Organization page. The conditional logic which can be applied to a component makes sense.

Regards,
Blake Robertson
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: MSI Command Line to prevent Start Menu Shortcuts?

Hello,

You can try following these steps:
- add an external shortcut to your file
- make sure your shortcut's uses a property to point to your target file, for example "[APPDIR]YourCommand.exe", where "YourCommand.exe" is your target file, and APPDIR is the path to your target file.
- a corresponding resource will appear in one of the components on the Organization page
- you can find it by right clicking on your shortcut in the Files and Folders page and selecting "Go to component" from the context menu
- the shortcut resource can not have its own component, which is why you will need to create a dummy element as a registry
- on the Registry page create a new random registry entry
- on the Organization page place the registry resource and shortcut resource in the same component, and condition your component for installation as stated in my post above

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Feature Requests”