views:

2931

answers:

5

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.

A: 

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

cmsjr
No - msi is not available to Express edition I believe
adeena
A: 

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.

Rob Prouse
I can't find any kind of "InstallAllUsers" option in properties for the project... I'm using the Express edition... is it not available there?
adeena
There are two sets of properties which is confusing. One is a dialog that pops up when you right-click and hit properties. This isn't it. The one you want is the properties window that docks in VS. You can also go to View | Properties in the main menu to bring it up.
Rob Prouse
Rob: I know which you mean. But there are only 2 properties in that view. One for "Project File" and one for "Project Folder" for the project. The "Solution" that's one level above that just has "Description", "Path" and "Startup Project"
adeena
If you are seeing Project File and Project Folder, you are clicking on the C# project file. What I said was for the setup project. For Click-Once, it is always installed per user.
Rob Prouse
A: 

A blog post on MDSN blogs explains that the non-admin user needs permission to a directory and a registry key and gives a scary workaround.

foson
I'm using "ClickOnce". MSI is not available
adeena
+3  A: 

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.

Rob Prouse
:( Yeah, this isn't available in Express which is what I was suspecting. Thanks a bunch tho! I think my answer for now is that I'm going to try and get my main user to have admin priv.
adeena
Sure, although you might want to look at the Nullsoft installer. It is pretty easy to use and will give you a better user experience.
Rob Prouse
I will for the future and for other things... but for this particular thing, to get it working now, adding admin priv was easy and it worked. Thanks! :)
adeena
+1  A: 

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.

whatknott