Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7416831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:34:38+00:00 2026-05-29T07:34:38+00:00

I have a problem which I guessed would be really simple to solve… but

  • 0

I have a problem which I guessed would be really simple to solve… but duh.

I’m deploying a .NET application with VS2010. I have a C# Windows Forms project and a Deployment Project. I need the installer to run with admin privileges because the app is installed for all users and an entry to the registry is made.

When starting the setup.exe I’m not prompted for privilege elevation. The installer will just start and suggest to install to Program Files (x86) which is good. After clicking next the installer runs and finished with a success message. Which is basically a lie because it did not successfully install. Instead it puts the apps exe directly to C:\.

How can I make the installer ask for admin privileges. Or do I have to rely on my customer to right click the setup and select “Run as Admin” which is very error prone?

Clarifications about my setup:

  • In the File System view of the setup project I added (among other things) “Primary Output from project01 (Active)” and “Build Outputs from project01 (Active) to “Application Folder”. I also added a shortcut to “Primary Output” into “User’s Programs Menu\CompanyName\ProgramName”.
  • In the Registry View I added an entry to HKEY_CLASSES_ROOT because I need to register an url handler.

I also modified the setup’s settings: I set InstallAllUsers to True because it is supposed to do so.

When I build and start the setup.exe by double clicking (or by selecting Install from the project’s context menu) I always get the same result: The installer runs without asking for admin privileges, ask for an install location (which I leave at the default C:\Program Files(x86)\Company\ProgramName) and then procedes after clicking Next. As a result, the exe is put directly in C:\ and the shortcut created of course points into Nirvana.

If I run the setup.exe manually as Administrator things work fine. But this cannot seriously be the way to go.

So how can I tell the setup to always run as Admin?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:34:39+00:00Added an answer on May 29, 2026 at 7:34 am

    I think this is a perfectly valid question, is a real problem, and has an actual explanation.

    I recently ran across this problem. In my case, the cause is that the AlwaysInstallElevated policy was set on the computer through GPO. The policy was set to 1 in the per-machine policy and 0 in the per-user policy. These policies can be manually set to reproduce the effect it has on MSI installers

    Using msexec /log install.log /i Deploy.msi, I had a setup log and there were strings in it like this:

    MSI (s) (A4:8C) [13:00:42:885]: Ignoring disallowed property TARGETDIR
    MSI (s) (A4:8C) [13:00:42:885]: Ignoring disallowed property VSDNETURLMSG
    MSI (s) (A4:8C) [13:00:42:885]: Ignoring disallowed property VSDNETMSG
    

    It seems that Visual Studio does not set the SecureCustomProperties in the MSI correctly and post processing of some sort is needed. I think that moving to WiX may be a better long term solution instead.

    A blog post on MSDN is what I found that helped me find the root cause to this problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It looks like a problem which could have simple solution, but I haven't found
I have a problem which is most likely a simple problem, but neverthe less
I have a problem which I think is related to forward declarations, but perhaps
I have a very simple problem which requires a very quick and simple solution
I am just learning Blend/Silverlight/VS2010/.net/etc. I have a simple project that resides on a
I have a problem which I am sure some of you would be interested
I have a problem which requires me to parse several log files from a
I have a problem which requires a reversable 1:1 mapping of keys to values.
I have a problem which I cant seem to find answer to through searches
I have a problem which I don't know how to fix. It has to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.