1

I have created a C# Windows Forms app with .Net 6 and Visual Studio 2022. When publishing it, a setup.exe is created. When running setup.exe it installs the app in appdata/local/app/2.0/.../...

Is there a way to force a shortcut in the desktop after installing it? I have to distribute the app to my co-workers who are not very tech savvy and I don't want them to go through the hassle of finding the installation folder and creating a shortcut themselves.

I use ClickOne for publishing.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
matsrom
  • 25
  • 5
  • What installer are you using? ClickOnce? – gunr2171 May 22 '23 at 20:21
  • @gunr2171 Yes, ClickOne! – matsrom May 22 '23 at 20:22
  • @gunr2171 The "Create desktop shortcut" checkbox is missing in my publish settings. Doing some previous research, I've found some answers like this one that propose a code solution but I haven't tried yet since it seems to be a way to do it through the publishing settings in previous Visual Studio versions and I think is weird they removed this feature in VS2022. – matsrom May 22 '23 at 20:33
  • Why this question is closed? This is very specific to Visual Studio 2022. The link provided to close this question, answers belongs to outdated versions of visual studio. – Pavan Chandaka May 22 '23 at 21:05
  • 1
    @PavanChandaka you can always add your answer to the more canonical post, as [others have done about specific versions of VS](https://stackoverflow.com/a/55631037/1043380) – gunr2171 May 22 '23 at 21:58

1 Answers1

2

If you want create shortcut icon in desktop by c#

this answer https://stackoverflow.com/a/4909475/13634838

If some one looks for setting options using Visual studio 2022,

  • After selecting "Clickonce", select "next" on publish window.

  • Keep selecting "next" till you reach to "settings".

  • Now select "options" link which opens "Publish Options" window.

  • Select "Manifest" on "Publish Options" window.

  • Then you will observe a check box saying "Create desktop shortcut". Select it.

Pavan Chandaka
  • 11,671
  • 5
  • 26
  • 34
  • 1
    Dammnit! Had to change my VS language to english and following your instructions I managed to find that option. Thank you! – matsrom May 23 '23 at 07:42