hsc
Posts: 71
Joined: Wed Mar 02, 2016 2:55 pm

Optional startup (autostart) link

Tue Oct 27, 2020 9:41 am

Hi,
I found a few threads here that explain how to create a link in the startup folder of the start menu, to auto start the installed application when the user logs on. This works fine.
Now I want to present the user with a check box so they can choose at installation time whether or not to create that startup link. Creating the checkbox is easy, but how do I link the startup link to the condition?
Thanks
Hans

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Optional startup (autostart) link

Wed Oct 28, 2020 5:47 pm

Hello Hans,

In order to achieve what you want, we will basically need to condition the installation of the shortcut itself.

To do so, we will need a dummy component (either a registry value or a file) that will help us condition the installation of the shortcut.

I'd say that the best option here would be the registry, therefore I will present you a solution that includes that.

Please go to "Registry" page and create a new value, e.g.:
RegistryCreateShortcut.png
RegistryCreateShortcut.png (38.59KiB)Viewed 3432 times

This way, in "Organization" page, a new component will be created having the name given to your registry value.

Now, one important thing to be noted here is the fact that, in order to achieve this, we will need to use a "Shortcut to External file", not a "Shortcut to Installed file".

The reason behind this is the fact that when creating a shortcut to an installed file, the shortcut is binded to the component of the executable and we can not move it, therefore we can not condition it without conditioning the installation of the EXE itself.

With that being said, we will need to create a shortcut to an external file, such as:
StartupShortcut.png
StartupShortcut.png (30.04KiB)Viewed 3432 times

After doing so, please go to "Organization" page, locate the component that contains your shortcut, move the shortcut to registry's component and then condition the installation of the component based on your checkbox control:
Condition.png
Condition.png (108.7KiB)Viewed 3432 times

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

hsc
Posts: 71
Joined: Wed Mar 02, 2016 2:55 pm

Re: Optional startup (autostart) link

Mon Nov 09, 2020 1:00 pm

Hi Catalin, thank you for your help. Actually it was decided to remove the "Autostart" altogether because it makes no sense in the specific use case. But I assume I will return to this issue later when I create an installer for another product where it makes sense :)
Best
Hans

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Optional startup (autostart) link

Thu Nov 12, 2020 5:34 pm

You are always welcome, Hans! :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”