How do I install/deploy/build my Visual C# application so it's available to all users?

10,041

Solution 1

You cannot change a ClickOnce setup project to install All Users. They are designed to be installed for individual users only. You need to create an MSI installer. Add a new project to your solution, go to Other Project Types | Setup and Deployment | Setup Wizard. That should get you on your way, then see my other answer.

Not sure if this works in Express though. If it doesn't, you may need to use a third-party installer like Wix or the Nullsoft installer.

Solution 2

Open up your setup project in Visual Studio. Click on your deployment project then hit F4 to bring up the properties. In the properties, switch InstallAllUsers to true and rebuild your project. It should work as you expect now.

Solution 3

Is the install an MSI? If so try MSIEXEC.EXE /I yourpackage.msi ALLUSERS=1

Solution 4

If your application is a single .exe file, why bother having an install at all? I love apps that I can just copy to my machine and run without having to go through installing and uninstalling.

If you want to get really fancy, zip your .exe file up with a .cmd file that copies the .exe to 'Program Files' and creates a start menu shortcut.

ClickOnce's biggest strength is for applications that change frequently. It allows the client to seamlessly update itself from the updated server version. If you're not doing that, the main benefit of using ClickOnce is gone.

Share:
10,041
adeena
Author by

adeena

I'm an Software/Systems Engineer, Author, Speaker, and all around geek. https://adeenamignogna.com

Updated on June 05, 2022

Comments

  • adeena
    adeena almost 2 years

    I've written an application in Microsoft Visual C# 2008 Express Edition.

    The Windows XP computer I want to install it on has two user accounts. One is the admin account, the other is the main user account and does not have admin privledges.

    I tried installing the application as the main user, and got an error saying i can't because I'm not admin. Fine. I tried installing the application as the admin account. It installs fine and works fine under the admin account, but doesn't seem to be available in my main user account. From the main user account, I navigated using windows explorer to where I run the application from as admin and the same "can't install" error.

    What do I need to do to make this available to my main user account?

    Thanks!

    -Adeena

    Update: someone asked for these details: I'm using the "ClickOnce" publishing scheme (I think that's the only thing available in Express. I use the wizard and I publish it to a local folder on my machine, then I say "user's will install from a CD-ROM" (as opposed to from a website or file share), and select "The application will not check for updates"

    update2: when I try installing under the main user account, I get a dialog that says: "Application cannot be started. contact the application vendor." and then there is a button for "Details..." I click on that and get the following error summary: ERROR SUMMARY Below is a summary of the errors, details of these errors are listed later in the log. * Activation of C:\ADIA\ADIA.application resulted in exception. Following failure messages were detected: + Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

    Another note... It's a very simple application. If I copy the executable that gets built when I'm working in MS Visual Express to the other machine and just run it as my main user, it runs fine.