0

Problem: I have a visual studio solution with a visual studio setup project. During the installation of the msi package, I want a shortcut to be created in the startup folder, so that my application can automatically start when the user logs in.

Action Taken:

I followed this : How to create an installer project in VS2019 for a Windows form application

and this

Visual Studio Deployment Project - Create shortcut to deployed executable

This question must not be considered as duplicate as these steps are not working for me, they endup with a corrupted shortcut. The shortcut gets created but is not working:

The application deploys correctly and the link gets created but it does not point to the executable. If you look at the picture below, you'll see That Target is greyed out and "points" to a folder. It should mention the executable name.

enter image description here

If I create a shortcut manually, you can see the difference (Target is properly filled)

enter image description here

Steps to reproduce:

  1. Right click setup then view File System
  2. Right click File System on Target Machine, then Add Special Folder / User's Startup folder
  3. On the right panel of Application Folder, I right click Primary Output of FormAgent and Create Shortcut to Primary Output

enter image description here

  1. I drag and drop the shortcut to User's Startup Folder and rename it appropriately.

Result: Shortcut gets created in the startup folder but is corrupted.

Troubleshooting done:

I wanted to create a shortcut to FormAgent.exe instead of a shortcut to Primary Output. But nowhere in the GUI I found a place to select anything else than Primary Output. Every single GUI is proposing Primary output from ProjectName and nothing else.

See the below picture which is the Properties of the shortcut: In the properties, if I click on Target, it points to Primary Output with no possibility to select an executable. (Add File is adding an external file to the setup project).

enter image description here

As additional troubleshooting, I went back to Application Folder and edited the properties of Primary Output, then clicked on Output: The output displays 2 files and I wonder if this could be the cause of my problem. ( What is a result of a shortcut to an output that has 2 files?)

enter image description here

CloudAnywhere
  • 669
  • 1
  • 11
  • 27
  • Are you saying that the shortcut doesn’t work? There are different kinds of shortcuts, and the fact that the executable name is not in the Target field does not necessarily mean the shortcut is defective. I wish I understood it enough to explain, but the real test is whether or not it launches the app. – padeso Jan 20 '23 at 11:29
  • I recently answered a similar question about making an installer for a startup app. Before I tackle your question here, can you take a look at that and see if it helps solve your issue? https://stackoverflow.com/a/75072531/5438626 Basically, that solution writes a registry key directly. – IVSoftware Jan 20 '23 at 13:07
  • @IVSoftware : will try thanks. The creation of shortcut from the setup project is definitely not working in our case and we didn't find the root cause nor workaround. Registry key will do the trick. Thanks; – CloudAnywhere Mar 23 '23 at 11:01

0 Answers0