Publish project for all users

2.9k views Asked by At

I have a C# Windows Forms project that I created.

When i click "Publish" it deploys this click-once application that is only for a single user. If I run the install on my admin account, then there is a shortcut in my AppData that i can click on to run my program. If I try copying that shortcut to C:\users\Public what happens is that another click-once application gets placed on the users' desktop. That user then has to run the install and is annoying cause If i have an update, each user has to uninstall and reinstall the new application. Is there any way to configure VS 2015 to publish in a way that creates an "regular" install for all users?

3

There are 3 answers

0
Arin On

RobinDotNet addressed that in a blog post a while back:

Doing an all-users install is counter to the design goals of ClickOnce deployment, so I think it’s going to be something everyone has to live with, at least for now. Using XCopy or a setup & deployment package and rolling your own incremental update methodology would be the way to go if you absolutely have to have an All Users installation

https://robindotnet.wordpress.com/2009/09/07/installing-a-clickonce-application-for-all-users/

There are more alternative deployment methods listed in this SO answer that might work for you.

0
Thorsten Dittmar On

You can not do this using ClickOnce. You may want to install Windows Installer XML to create regular MSI installers. It nowadays integrates with Visual Studio.

0
Gerald Davis On

As others have pointed out CO is per user. There is no install for all users on the machine option.

However I feel you are either misinformed or badly misconfigured something regarding the implications when it comes to upgrades. Click Once upgrades don't require the user to uninstall, download, and install a new version. That wouldn't exactly be click ONCE.

You can configure your ClickOnce app to automatically detect, fetch, and apply upgrades as you make them available. This can be done either in code so you can control it programmatically or by configuration (i.e. check for updates every time the application starts).

So yes each user would need to install the application once but that would be the end of their involvement.