MMGeri
Posts: 1
Joined: Fri Aug 19, 2022 1:05 pm

Shortcuts

The Shortcut name which is a formatted type doesn't get deferred at install time.
Table: Image
Results in:
Image
Log:
MSI (s) (B8:C8) [14:04:35:447]: Executing op: ShortcutCreate(Name=[SHORTCUT_NAME],,,FileName=C:\Program Files\x86)\Org\Cel.NET\asd.txt,,WorkingDir=C:\Program Files (x86)\Org\Cel.NET\,,IconIndex=0,HotKey=0,ShowCmd=1,,,,,)
Liviu
Posts: 1042
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Shortcuts

Hello and welcome to our forums,

This happens because the "Name" field of the Shortcut does not support formmated type properties.

This is a Windows Installer limitation and only PseudoFormatted properties can be used. Unfortunately, the Shortcut name field does not support Formatted properties. Only PseudoFormatted properties are supported and they are resolved at build time.

During the installation you need to use only properties referenced by Formatted data types, for example "[ProductName]".

More details on our Windows Installer Formatted Type article.

Now, as a solution for your request, you can achieve this using custom actions (for example rename the shortcuts using cmd).

Go to the "Custom Actions" page and add a new "Launch file" scheduled like this:
launch file ca.png
launch file ca.png (201.83 KiB) Viewed 887 times

Command line: /c "rename "[DesktopFolder]updater.lnk" "[EDIT_1_PROP].exe.lnk""

Note: Replace EDIT_1_PROP with your property.

Attached you can find a sample project.

Hope this helps! If you have any other questions, please don’t hesitate to contact us.

Best regards,
Liviu
Attachments
sample.aip
(25.24 KiB) Downloaded 109 times
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”