uac

NSIS: Installing an Application to always Run as Administrator

笑着哭i 提交于 2019-11-30 07:11:26
I have a NSIS script that is working well for a large application. I have read many threads all over the web, but cannot get a clear answer to the following: is it possible to install an application using NSIS which, when launched (regardless of the type of user) automatically is run as administrator? If this is possible how can it be achieved? Note: I am already imposing that the NSIS package must be run as admin using RequestExecutionLevel admin I have tried writing the UAC requirement to the applications registry entry using this method but I could not get the RUNASADMIN command to compile

Private key of certificate in certificate-store not readable

喜夏-厌秋 提交于 2019-11-30 06:57:32
I think I've got the same issue like this guy , but I wasn't as lucky as him/her since the solution provided doesn't work for me. The solution provided looks for files on the C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys ( not in sub directories) and C:\Users\[Username]\AppData\Roaming\Microsoft\Crypto\RSA (and subdirectories) However since I want the setup to install the application to all users, the custom action is running under the SYSTEM -User, which leads the files beeing actually created in C:\ProgramData\Application Data\Microsoft\Crypto\RSA\S-1-5-18 . When running an "normal"

Windows batch file starting directory when 'run as admin'

跟風遠走 提交于 2019-11-30 06:18:58
问题 I have a batch file which is in a directory and must be run from there as well because it updates files within this directory. This works perfectly fine, except when the user runs the batch file as administrator (required on Vista). Then the starting directory is C:\Windows\System32. Is there any way to still be able to know from which directory the batch file was run? I dont want the user to enter the directory manually. 回答1: Try to access the batch files path like this: echo %~dp0 For more

How do I check if my program is ran by user as administrator (Vista/Win7, C++) [duplicate]

[亡魂溺海] 提交于 2019-11-30 05:31:16
问题 This question already has answers here : Detect if program is running with full administrator rights (2 answers) Closed 2 years ago . I saw IsInRole method but I can't find information on how to use it with C++. 回答1: There's a C++ code snippet in this old answer taken from the UACHelpers project on CodePlex. 回答2: This code solves your problem. Feel free to use it. It works with SE_GROUP_USE_FOR_DENY_ONLY. /** IsGroupMember determines if the current thread or process has a token that contais a

Launch application after installation complete, with UAC turned on

℡╲_俬逩灬. 提交于 2019-11-30 05:22:18
Good day. I've been building an installer for our product using the WIX(Windows Installer XML) technology. The expected behavior is that the product is launched, if the check box is checked after installation. This has been working for some time now, but we found out recently that UAC of Win 7, and Vista is stopping the application from launching. I've done some research and it has been suggested to me that I should add the attributes Execute='deferred' and Impersonate='no'. Which I did, but then found out that to execute deferred, the CustomAction has to be performed, between the

How do I create add a shortcut (.lnk) for my application to the Startup folder programatically in .NET/C#

∥☆過路亽.° 提交于 2019-11-30 05:21:42
My application will have a per machine (not per user) Startup shortcut. I can create a shortcut during the installer process no problem. My problem comes when the user later removes it and then tries to re-enable. In otherwords, they turn off RunOnStartup (which deletes the Startup ink) and at a later time they decide they do want it to run on startup so they go back into preferences and re-enable. Apparently, this is a pretty common gripe with .NET that there isn't a native way to create shortcuts. But, haven't found a very good solution. Solutions I've Found/Considered: Rather then create a

Embedding an application manifest into a VB6 exe

萝らか妹 提交于 2019-11-30 04:54:22
I have recently gone through a bunch of standalone utility apps written in VB6 to make sure that registry virtualization is turned off for Windows Vista and above. I created a standalone manifest file for each exe, set the requestedExecutionLevel appropriately (some of them need to modify HKEY_LOCAL_MACHINE registry keys, others do not), and tested them. They all appear to work correctly. I have only one small problem remaining. Since they are standalone utilities, people are used to just copying them around the network and running them manually. If anyone forgets to copy the manifest file as

Restart program unelevated

社会主义新天地 提交于 2019-11-30 04:49:42
问题 For some reason, my C# program needs to restart with elevated privileges. I use the following code to achieve it: private static void RestartForPermissionsFix() { ProcessStartInfo processInfo = new ProcessStartInfo(); processInfo.Verb = "runas"; processInfo.FileName = Assembly.GetExecutingAssembly().Location; Process.Start(processInfo); } This works great. After I "fix my privileges", I want to restart the program unelevated . I tried the same as above without the "runas", but it does not

Starting another process with elevation using different user credentials

天涯浪子 提交于 2019-11-30 04:45:35
I'm trying to start an elevated process from with a non-elevated process, but I also need to supply the username and password for a user with administrative credentials. I've tried both the "runas" method for elevation as well as using a manifest, but both yield different errors. For example, if I do this (without using a manifest that requires elevation): ProcessStartInfo info = new ProcessStartInfo(path); info.UseShellExecute = false; info.UserName = username; info.Password = securePwd; info.Domain = "MyDomain"; info.Verb = "runas"; var proc = Process.Start(info); The process launches

How to use ServerManager to read IIS sites, not IIS express, from class library OR how do elevated processes handle class libraries?

非 Y 不嫁゛ 提交于 2019-11-30 01:20:55
I have some utility methods that uses Microsoft.Web.Administration.ServerManager that I've been having some issues with. Use the following dead simple code for illustration purposes. using(var mgr = new ServerManager()) { foreach(var site in mgr.Sites) { Console.WriteLine(site.Name); } } If I put that code directly in a console application and run it, it will get and list the IIS express websites. If I run that app from an elevated command prompt, it will list the IIS7 websites. A little inconvenient, but so far so good. If instead I put that code in a class library that is referenced and