Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Placing shortcut through script


2 replies to this topic

Usman Javaid

Usman Javaid
  • Members
  • 15 posts

Posted 16 January 2006 - 12:55

I want to display a checkbox asking the user whether to place a application shortcut on the desktop. Is there any way to do it. Currently I use the SDFinish dialog and I have two options available on it launching app. and view readme. But I only want to show user Readme and shortcut options. The problem is how to create an application.exe short cut through script.

lavocat

lavocat
  • Full Members
  • 158 posts

Posted 26 January 2006 - 09:26

Through script you should use the AddFolderIcon function in an InstallScript Custom Action with a condition based on a property "linked" to the checkbox.
Then you have to plan for uninstall, repair and rollback scenarios.

Without script there is an another solution with no need to plane for uninstall, repair and rollback scenarios.
Create a Feature with a new component into it only for the shortcut.
Using this way you must ask the user to set the checkbox (in the UI sequence) before the CreateShortcuts action is called, so I don't think you may ask it at the end of the installation.

1. Add an entry to the shortcut table :
NewShortcut1 DesktopFolder NEWSHO~1|NewShortcut1 myAppShortcut [INSTALLDIR]addressentry.h 1

myAppShortcut is the empty component. It is in a feature named "myAppShortcutFeature"

2. Put a checkbox in a windows of the UI sequence. In the bahavior of the commit button, place the Remove ControlEvent.
Example in the ReadyToInstall window (MYPROP is the property of the checkbox)
in ControlEvent Table:
ReadyToInstall InstallNow Remove myAppShortcutFeature NOT MYPROP 1


This will remove the feature myAppShortcutFeature only if the checkbox is unchecked.

Edited by lavocat, 26 January 2006 - 09:32.


lavocat

lavocat
  • Full Members
  • 158 posts

Posted 27 January 2006 - 08:14

I forgot this is the InstallScript MSI section (I thoug it was the Basic MSI section).
So ou can use AddFolderIcon in your script without using CA and then no need to plan for uninstall, repair and rollback scenarios.
Note that the effects of InstallScript custom actions—as opposed to the effects of an InstallScript MSI project event-driven script—are not logged for uninstallation.