uac

Why does Vista SP1 UAC prompt show a different file name for my MSI installer?

For my MSI installer, Vista SP1 UAC prompt shows me "5eab7.msi" for my MSI name which is clearly not my MSI file name. However the company name is correct. How to make the UAC prompt show the real name of my installer? I am using WiX, by the way. Thank you in advance! ...

start exe as non admin from admin exe

Hi, When my app updates it needs admin rights and pops the uac prompt up and this is all good. However when it restarts it self its still in admin mode and thus every thing it does has admin rights. The problem comes when the next time the app is started its a normal user and thus cant read any of the files that where made before. How ...

UnauthorizedAccessException in my own directory

I'm trying to iterate over the items on my start menu, but I keep receiving the UnauthorizedAccessException. I'm the directory's owner and my user is an administrator. Here's my method (it's in a dll project): // root = C:\Users\Fernando\AppData\Roaming\Microsoft\Windows\Start Menu private void walkDirectoryTree(DirectoryInfo root) { ...

Elevation without restarting an application?

Has anyone managed to get administration rights through the UAC without restarting the application or embedding a manifest file? I'd like to write to some files that only administrators can modify, without relying to another elevated application. Is it possible to impersonate an administrator previously calling with some native API the ...

Run with administrative permission issue

Hello everyone, I am using Windows Vista and I find something strange, I programatically invoke IE to open IE to access some local html page, the current user belongs to administrator group; I programatically invoke IE with RunAs parameter, and let IE to access access some local html page, the current user belongs to administrator g...

UAC Application Manifest when you don't know runtime application name

I have a program that works fine if UAC is turned off. I want to be able to use a manifest to have it simply request elevation privileges when it launches. The instructions from MS say "The application manifest file should have the same name as the target executable file with a .manifest extension" and that's probably why I am not havi...

Screen saver crashes if UAC is enabled

Does screen saver require any manifest file? I'm renaming the .exe to .scr file. Right now i am not using any manifest file for the screen saver. But if if UAC is enabled, my screen saver crashes. How to by pass this UAC thing ? ...

How do you de-elevate privileges for a child process

I know how to launch a process with Admin privileges from a process using: proc.StartInfo.UseShellExecute = true; proc.StartInfo.Verb = "runas"; where proc is a System.Diagnostics.Process. But how does one do the opposite? If the process you're in is already elevated, how do you launch the new process without admin privileges? Mor...

CreateDesktop() with Vista UAC (C Windows)

I'm using CreateDesktop() to create a temporary desktop where an application will run, perform a cleanup action (while remaining out of the way) and terminate. I'm closing that desktop once the application is gone. Everything is fine when using Windows XP and even Vista. The problem arises when you enable the (annoying) UAC. Everything ...

GetPrivateProfileString() Gives Access Denied Error on Vista

A GetPrivateProfileString() call works fine on Windows XP but fails with an Access Denied error when run on Vista. The call is being made inside a thread spawned by a Windows service which I wrote. The Windows service itself is run using the credentials of a user account on the local machine (thought to be needed because the code requi...

Show UAC prompt when launching an app

I have an app which needs administrator privileges to do some things. I'd like to just show the UAC prompt when it starts, and then be elevated. I'm not sure how to do this, but I'm hearing about things like manifests and whatnot but not seeing a plain answer anywhere. ...

C#: Detect if running with elevated privileges?

I have an application that needs to detect whether or not it is running with elevated privileges or not. I currently have code set up like this: private static bool _isAdministrator() { WindowsIdentity identity = WindowsIdentity.GetCurrent(); WindowsPrincipal principal = new WindowsPrincipal(identity); return principal.IsIn...

Vista UAC - Trouble Mapping Network Drives

We have an application that programmatically maps network drives. On Vista with UAC on, we get some strange issues. Our application maps the drive non-elevated, so if the user browses explorer and double clicks to run an exe, it prompts for UAC. So when they approve it, it prompts for a username/password for the share... Strange sin...

Windows 7 file access permission question

I installed my application in Windows 7 and as part of the installation, it installs some text files. Now, if I open the text file in notepad and try to save it, I get an "Access denied" error. I'm logged in as administrator on the machine and the file is not marked read only and security permissions seem to be fine. However, I could de...

Moved to Windows 7 (64) for development. What about UAC settings? [Windows Application]

For years Windows XP (32 bit)was my development desktop (personal projects). I develop many hobby projects and distribute it as open source and have never worried or bothered about checking it in Vista (I have used Vista only for a week). But none of my users have complained much about my apps in Vista. Now I have moved to Windows 7 64 ...

Is it possible to lower the privilege level when calling CoCreateInstance on Vista?

Okay, I have a plugin for IE that when installed needs to (with the user's permission) restart IE. To do this I have a DLL that is invoked by the installer. And it works, but the problem is that when IE is restarted on Vista, it is restarted with the administrator privileges of the installer, which is a problem for a number of reasons. ...

Inhibiting registry virtualization programatically

In the context of a generalized .NET-based component, which can be hosted in a variety of scenarios - i.e., 64 bit or not, interactive process or not, I need to write to the registry in an area that's subject to UAC virtualisation. However, I want to prevent such access from being virtualized in order that each execution is not subject t...

UAC gives me fits!

The code I am currently working on runs on Windows Server 2003, but needs to be able to write to EventLogs on multiple machines. I am coding in C#, using VS2008 Pro, and .NET Framework 3.5. The code itself is relatively simple (thanks to the framework): using (EventLog remoteEvtLog = new EventLog(LogName, HostName, EventSource)) { ...

nsinstall: Bad file number error on Vista

I'm attempting to build Firefox on my Windows Vista Ultimate machine. I keep getting the following error: nsinstall: Bad file number I've read that this error is caused because of UAC in Vista. Here are the two articles that lead me to this conclusion. https://wiki.mozilla.org/Penelope_Developer_Page#Windows_Vista and http://www.ke...

Correct way to design around Windows UAC limitations?

I found out an application I wrote does not work properly under Windows Vista/7 if UAC is enabled at any level, because it writes files to the install directory of the program, defaults to "C:\Program Files\MyProgram." If UAC is disabled (or on any other version of Windows) it works properly - I read that UAC denies applications write ac...