I am creating two desktop shortcuts on the final page using the following XML. The shortcuts get created correctly, but when I perform an uninstall, they are not being removed. Based on what is documented regarding what should be automatically added to the list of things cleaned up by the uninstaller, I am expecting these to be be removed. I could not find any reference to a "removeShortcuts".

                <name>My Prog</name>
                <name>My Other Prog</name>

asked 15 Oct '12, 19:28

DennisU's gravatar image

accept rate: 0%

The <createShortcuts> action does not add the files to uninstaller automatically. Only shortcuts that are defined as part of shortcut lists inside <component>, not actions, are automatically added for uninstallation.

In order to have shortcuts automatically removed by the uninstaller, it is required to add the files manually using <addFilesToUninstaller> action. However, as final page is run after uninstaller is created, it is not possible to add these shortcuts to list of files to uninstaller.

In this case it is better to show a <booleanParameter> that will ask the user if shortcuts should be created before installation? Then the shortcuts could be be added as shortcuts to components and have a rule in the shortcuts that checks if the parameter was checked by user.

The parameter would be:

<booleanParameter> <name>install_desktop_shortcuts</name> <description>${msg(FinalPage.CreateDesktopShortcuts.text)}</description> <explanation></explanation> <value></value> <default>0</default> </booleanParameter>

And the component definition would be:

<component> <!-- ... --> <desktopShortcutList> <shortcut> <comment></comment> <exec>${installdir}/bin/myprog.sh</exec> <icon>${installdir}/bin/myprog48.png</icon> <name>My Prog</name> <path>${installdir}/bin</path> <platforms>all</platforms> <runAsAdmin>0</runAsAdmin> <runInTerminal>0</runInTerminal> <windowsExec>${installdir}/bin/myprog.exe</windowsExec> <windowsExecArgs></windowsExecArgs> <windowsIcon>${installdir}/bin/myprog.exe</windowsIcon> <windowsPath>${installdir}/bin</windowsPath> <ruleList> <isTrue> <value>${install_desktop_shortcuts}</value> </isTrue> </ruleList> </shortcut> <shortcut> <comment></comment> <exec>${installdir}/bin/myotherprog.sh</exec> <icon>${installdir}/bin/myotherprog48.png</icon> <name>My Other Prog</name> <path>${installdir}/bin</path> <platforms>all</platforms> <runAsAdmin>0</runAsAdmin> <runInTerminal>0</runInTerminal> <windowsExec>${installdir}/bin/myotherprog.exe</windowsExec> <windowsExecArgs></windowsExecArgs> <windowsIcon>${installdir}/bin/myotherprog.exe</windowsIcon> <windowsPath>${installdir}/bin</windowsPath> <ruleList> <isTrue> <value>${install_desktop_shortcuts}</value> </isTrue> </ruleList> </shortcut> </desktopShortcutList> <!-- ... --> </component>

The shortcuts have the rule to check value of the parameter defined above, so will only be created if user has selected to install them.


answered 16 Oct '12, 03:36

wojciechka's gravatar image

wojciechka ♦♦
accept rate: 26%

Is there a way not to ask the user for the shortcut to be installed before the uninstaller? This is ridiculous to ask typical user for this as he has no idea what's the difference.What the user wants to be sure of is that if he has uninstalled the app ,the related shortcut is gone as well.

(26 Jan '15, 07:23) SasMaster

You can also create the shortcuts during <finalPageActionList> and add <deleteFile path="${windows_folder_common_desktopdirectory}"/> to the <posUninstallationActionList>.

(26 Jan '15, 12:01) david
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 15 Oct '12, 19:28

Seen: 1,598 times

Last updated: 26 Jan '15, 12:01