cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamic Shortcut Names

Dynamic Shortcut Names

Summary

This article will discuss the limitation of creating dynamic shortcut names for MSI installers.

Synopsis


In some circumstances you may want the name of a shortcut to become dynamic, which would automatically change depending on other settings within your project.
Using a Property for the shortcut's name may seem like the logical solution however this is not possible - and this article will discuss the reason why.


Discussion


When a name is created for a shortcut it is stored within the MSI tables here:
Direct Editor > Shortcut Table > Name Column
User-added image

The screenshot above shows the attempt to name the shortcut [ProductName]
The issue arises however that the datatype of the Name column is "Filename" which is unable to resolve the square brackets as a Property - therefore after installation the shortcut name will just appear as {ProductName] rather than the value of that property.

There are different types of datatypes which Microsoft have assigned to different string value columns, the one which is able to resolve Property values is called "Formatted".
The different types which are associated to the different columns of the shortcut table can be viewed here:
https://msdn.microsoft.com/en-us/library/aa371847(v=vs.85).aspx

Further details regarding the datatypes we have discussed can be found on here:
Filename Datatype - https://msdn.microsoft.com/en-us/library/aa368590(v=vs.85).aspx
Formatted Datatype - https://msdn.microsoft.com/en-us/library/aa368609(v=vs.85).aspx

The ability to change the datatype of an MSI table column is something which is not possible within InstallShield.



Workaround


If dynamic shortcut names are important to your installation then a possible workaround would be to write custom code to create the shortcuts instead - this could then be launched as a custom action.

Special care must be taken if this approach is taken however, as additional custom actions will be required to remove the shortcuts at uninstall / upgrade time.

In addition if shortcuts are created by custom code - the additional benefits of MSI self repair functionality would be lost.
Labels (1)
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jun 07, 2018 02:09 AM
Updated by: