Skip to content
⌘ NSIS Forum Archive

Desktop shortcut checkbox

7 posts

JimR#

Desktop shortcut checkbox

I am sure it is in the docs but I have not found it yet (or perhaps just not recognized it).

I am using MUI2 as a base. On the generated page for the user to choose a start menu location there is a checkbox to skip generating shortcuts. How do I detect that in my script so that I do not generate the shortcuts?

Somewhat related - is it possible to add another checkbox so that the user could indicate whether or not they also want a shortcut on the desktop? It would seem convenient to have this option close to the other checkbox rather than a separate message box.
Anders#
Read the "Start Menu folder" section in the MUI docs. You must use the MUI_STARTMENU_WRITE_* macros. (And if you don't want to use those macros you can read the start menu plugin readme to find out how to get the checkbox state)

If you want to follow the Windows guidelines then you should not create a desktop shortcut.
JimR#
Oh, thanks - that was easy! It was not clear to me that it was saying that the code would not be executed if the box was unchecked.

Re: desktop - true but most programs seem to do that so I think users will expect it. Many users seem to like a very cluttered desktop. Is there an easy way to add such a checkbox?
Anders#
A named section on the components page is easy. A checkbox with a custom action on the finish page is not hard either. Modifying the startmenu page is a lot harder...
JimR#
Interesting. I would have thought that one would just duplicate the code for the existing checkbox on the startmenu page and change the variable names. Is the code for the startmenu accessible?
Anders#


You can modify that code and recompile. You can also move controls and add another checkbox at run-time with the system plugin...
JimR#
Oh, I see the added complexity! I will put the option in my finish dialog. Thanks for your patient help.

Jim