Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Program installed with Admin privileges fails to start for standard user
 

Program installed with Admin privileges fails to start for standard user

Hi,
I have a msi setup program that installs a dotnetapplication that also uses MSChart and a type library. It all installs fine by a (Administartor) user with who is able touse elevated privileges during the install.

When I run it as the user that installed it,the applicationworks as it should - even without needing/using elevated privileges to run it.

However, when I login as a standard user - with no Administrative privileges and try to launch the application - it appears to be trying to download or install something before failing saying that it could not access a particular file (actually the error message is very similar to that I receive when I try and run the setup.exe over the web; see post: http://social.msdn.microsoft.com/Forums/en/winformssetup/thread/fe5958af-a72b-4361-84f1-bab03099a72f)

Edited to give error message:

Error 1001. Exception occurred while initializing the installation:
System.IO.FileNotFoundException: Could not load file or assembly 'file://C:\WINDOWS\system32\and' or one of its dependencies. The system cannot find the file specified.

Please can someone explain what is happening and what I need to do in order to overcome this problem. Could the file it cannot access be the type library?
Many thanks,
-Paul
pauldb  Friday, July 31, 2009 12:54 PM
It's not really about the shortcut being for All Users. If the setup installs anything that is a per-user item, then it will be installed only for the installing user and missing for other users. An example of a missing per-user item could be a HKCU registry entry or a file in a user-profile folder. This install of the missing item behaves like a repair with a progress dialog etc when the other user first uses the shortcut. The other thing that happens is that custom actions can run because of the built-in condition that doesn't show in the IDE. My guess is that this is why you're seeing the file not found exception. Add a condition of Not Installed to your custom action iof you do not want it to run on repair. You'll see MsiInstaller entries in the Event Log (Application) .
Phil Wilson
  • Marked As Answer bypauldb Monday, August 03, 2009 10:39 AM
  •  
PhilWilson  Friday, July 31, 2009 8:55 PM
Hi
Having read a separate thread:

http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/92895f8c-0a8b-477e-be0a-3c5632195bad

I've found that my application does launch from the Program Files folder - even when logged in as the non-privileged user.

So, why should it try an install/repair from a shortcut to that executable if the shortcut isunder the 'All Users' folder?

Puzzled,
-Paul
pauldb  Friday, July 31, 2009 3:05 PM
It's not really about the shortcut being for All Users. If the setup installs anything that is a per-user item, then it will be installed only for the installing user and missing for other users. An example of a missing per-user item could be a HKCU registry entry or a file in a user-profile folder. This install of the missing item behaves like a repair with a progress dialog etc when the other user first uses the shortcut. The other thing that happens is that custom actions can run because of the built-in condition that doesn't show in the IDE. My guess is that this is why you're seeing the file not found exception. Add a condition of Not Installed to your custom action iof you do not want it to run on repair. You'll see MsiInstaller entries in the Event Log (Application) .
Phil Wilson
  • Marked As Answer bypauldb Monday, August 03, 2009 10:39 AM
  •  
PhilWilson  Friday, July 31, 2009 8:55 PM
Thanks for your reply.
However, the application works for the non-privileged user - if started by double clicking the program icon in the Program Files folder or from new shortcuts that have been manually created by that user.

Surely what you're saying about possible missing files and registry entries would also apply in these cases, no?

What is so different about the msi created shortcuts? After all, I thought a shortcut was a shortcut. Nothing else.
Oh right - they're "advertised shortcuts". Ironic name, pity they're not more publicised.

Thanks,
-Paul

pauldb  Saturday, August 01, 2009 8:13 AM
Hi Phil,
I added the Not Installed condition to my custom installer as you suggested - and it all now works wonderfully well. When the non-privileged user first runs the application, the installer does run but no longer fails.

This being the case, I decided not to disable the advertised shortcuts mentioned in other threads - because I don't know if they're doing anything positive in the background.

Anyhow, many thanks for your help.
Best wishes,
-Paul
pauldb  Monday, August 03, 2009 10:38 AM

You can use google to search for other answers

Custom Search

More Threads

• *URGENT* Setup And Deployment Project In Visual C# Express
• Error Registring COM dll during Deployment
• Call NGEN after/in Clickonce deployment. How?
• Where is sqlexpr32.exe?
• Control Click Once Installation Folders
• Prompt for reboot with installation project
• Outlook issue with setup project deployment
• Clickonce techonology issue.. Please help :)
• Setup and Deployment (WCF)/.NET 3.5 -- How do I force newer builds to install files (example .sdf) without an uninstall?
• silent install ClickOnce Application