To create a shortcut you can follow the steps from the create shortcut tutorial. If the shortcut should be conditionally created, then add the ShortcutsDlg. Based on the checkbox state, the shortcuts placed in the corresponding folders will be created or not.
Here we have 2 limitations. To conditionally create a shortcut we need to have the ShortcutsDlg. You cannot condition each shortcut to be created, instead all shortcuts will be created or not in a certain location e.g. Desktop based on the corresponding checkbox.
To be able to conditionally create a shortcut without using the predefined ShortcutsDlg, here's what you need to do:
1) In the Files and Folders view, create an external shortcut to your .EXE package:
We cannot use the installed file shortcut because the shortcut cannot be moved from the component of that file.
2) Create a dummy registry to use its component to attach the external shortcut
By default, the external shortcut does not have its own component, thus a dummy component needs to be created and attach the external shortcut to it.
3) Attach the external shortcut to its component
- For this, navigate to the Organization view and select the component of the registry
- Then locate the component of the shortcut and drag-and-drop it under the component of the registry
- Condition its creation based on the property attached to the checkbox
The sample project is attached to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file.
Hope you will find this information helpful and let us know if you want to see more samples from our side.
All the best,
Dan