desktop shortcuts created on final page are not uninstalling


1 comment

  • Avatar

    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/</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/</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.

Please sign in to leave a comment.