woodhoct
Posts: 15
Joined: Wed Nov 04, 2015 9:52 pm

Multiple instances and desktop shortcuts

Tue Mar 29, 2016 3:57 pm

Hello,

Anyone have tips how to handle multiple instances and desktop shortcuts to those multiple instances? I have a single desktop icon as if I were setting up a single instance application. That single desktop icon is updated to the most current instance installed. That makes sense. I don't know how to have desktop icons point to the specific instance. Clearly, I'm missing something. Any insight will be appreciated.

Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Multiple instances and desktop shortcuts

Thu Mar 31, 2016 12:29 pm

Hello,

I think this is happening because your shortcuts have the same name.

In this case, you may need to provide unique name for your shortcuts. Note that the name field of a shortcut is of PseudoFormatted Type.

In this case, you may need a custom action to rename the shortcut. A sample project where the shortcut is renamed during installation is attached to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file.

let me know if that helped.

Best regards,
Dan
Attachments
Rename ShortcutSample.zip
(103.9KiB)Downloaded 348 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

woodhoct
Posts: 15
Joined: Wed Nov 04, 2015 9:52 pm

Re: Multiple instances and desktop shortcuts

Mon Apr 24, 2017 8:08 pm

Hi Dan,

It's been a while, but I've finally returned to this.

Your code sample works great! It gets me 99% of the way there.

How would I register the shortcut for uninstall/upgrade?

MMueller
Posts: 5
Joined: Fri Mar 29, 2019 10:37 am

Re: Multiple instances and desktop shortcuts

Fri Mar 29, 2019 10:45 am

Hi,
I'm facing the same issue. I try to rename the shortcut and use the [InstanceId]-Property to get different shortcuts for each instance but it doesn't work. This property is always resolved with #0 and the shortcuts override each other every time a new instance is installed.
How can I fix this problem?

Best Regards,
Marco

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple instances and desktop shortcuts

Fri Mar 29, 2019 11:33 am

Hi Marco and welcome to our forums.

I'm afraid that the name of the files and folders are stored in the MSI tables at build time and they cannot be changed during the installation. They will always use the default value of the properties assigned to their name. Hence, in order to have different names for your shortcuts, you can use the method my colleague Dan mentioned above.

Another option, is to create a property-based folder that contains the "InstanceId" property in its paths. For example:

Code: Select all

[ProgramMenuFolder][Manufacturer]\[ProductName][InstanceId]
In this case, a different folder will be created for each instance containing the shortcut that will have the same name.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MMueller
Posts: 5
Joined: Fri Mar 29, 2019 10:37 am

Re: Multiple instances and desktop shortcuts

Fri Mar 29, 2019 12:24 pm

Hi Eusebio,
I tried the solution of Dan and used "[ProductName] [InstanceId]" for the renaming of the shortcut. But the [IncanceId]-Property does not work für the renaming.

Here my definition of the instance property:
InstanceProperty.png
InstanceProperty.png (5.75KiB)Viewed 26020 times

Definition of my renaming property:
RenameProperty.png
RenameProperty.png (8.53KiB)Viewed 26020 times

Last but not least the definition of the custom action:
CustomAction.png
CustomAction.png (33.85KiB)Viewed 26020 times

It looked like the Property does not work outside the multiple instance dialog because the value is always the same. Is there another possibility to get the renaming correct?

Best regards,
Marco

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple instances and desktop shortcuts

Tue Apr 02, 2019 2:24 pm

Hi Marco,

Can you try to set the "NEW_SHORTCUT_NAME" property to "[ProductName] [InstanceId]" through a "Set installer property" custom action added after the "Install Execution Stage -> Searches" action group in the "Custom Actions" page and see if it works?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MMueller
Posts: 5
Joined: Fri Mar 29, 2019 10:37 am

Re: Multiple instances and desktop shortcuts

Mon Apr 08, 2019 12:58 pm

Hi Eusebio,
this works fine, thank you!

Best regards,
Marco

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple instances and desktop shortcuts

Mon Apr 08, 2019 2:39 pm

You're welcome Marco. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

GS-MV
Posts: 2
Joined: Tue Mar 22, 2022 10:10 am

Re: Multiple instances and desktop shortcuts

Thu Jan 11, 2024 4:11 pm

Hello,

I have installed multiple instances (in this case 5), and shortcut names are okay, so I have 5 different shortcuts on my desktop.
How would Advanced Installer know what is the modified name of the shortcut during uninstall?

As I experienced, the shortcut remains on the desktop after uninstall.

Best regards,
Viktor

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

Re: Multiple instances and desktop shortcuts

Tue Jan 16, 2024 1:00 pm

Hello Viktor and welcome to our forums,
How would Advanced Installer know what is the modified name of the shortcut during uninstall?

As I experienced, the shortcut remains on the desktop after uninstall.
You are indeed right - the shortcut will not be removed because the Windows Installer service does not know about it.

One way of removing the shortcuts would be through a Custom Action. However, you'd have to be specific with the name since it's on Deskop where a lot of .Ink files reside - this means we can not remove, for instance, all shortcuts.

Another (and easier, I would say) way would be through a "File Removal" operation in the "Files and Folders" page.

The only problem with both is that you need to know the name of the renamed shortcut.

Hope this helps!

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

GS-MV
Posts: 2
Joined: Tue Mar 22, 2022 10:10 am

Re: Multiple instances and desktop shortcuts

Mon Jan 29, 2024 9:46 am

Hi Catalin,

Thank you for your help.

I have my own way, because I stored the custom name in the Registry "InstanceInfo"="[InstanceId]-[INSTNAME_EDIT_PROP]".
After a Registry search I can use "InstanceInfo" under Custom Actions for creating and removing the desktop shortcuts with the exact file name.

Best regards,
Viktor

Liviu
Posts: 1026
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Multiple instances and desktop shortcuts

Mon Jan 29, 2024 1:19 pm

Hello Viktor,

Thank you for providing additional insight into your solution. It's great that you've found a customized approach that works for your specific needs.

Let us know if you have any other questions.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”