Make Inno Setup installer request privileges elevation only when needed

Inno Setup 6 has a built-in support for non-administrative install mode. Basically, you can simply set PrivilegesRequiredOverridesAllowed: [Setup] PrivilegesRequiredOverridesAllowed=dialog Additionally, you will likely want to use the auto* variants of the constants. Notably the {autopf} for the DefaultDirName. [Setup] DefaultDirName={autopf}\My Program The following is my (now obsolete) solution for Inno Setup 5, based on @TLama’s … Read more

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

Make sure you are adding the reference to the correct Microsoft.Web.Administration, should be v7.0.0.0 that is located under c:\windows\system32\inetsrv\ It looks like you are adding a reference to IIS Express’s Microsoft.Web.Administraiton which will give you that behavior

Running IIS Express with admin privileges

For Visual Studio 2015 and 2012 this solution will work. Go to Solution Explorer in Visual Studio, right click the web project and select “Unload Project” Next on the same project, right click and select ‘Edit Project File‘ Find the <DevelopmentServerPort>0</DevelopmentServerPort><IISUrl>http://localhost:56058/</IISUrl> xml tags and and remove them. Reload the project and run. Images to follow:

How to make a batch file delete itself?

npocmaka’s answer works, but it generates the following error message: “The batch file cannot be found.” This isn’t a problem if the console window closes when the script terminates, as the message will flash by so fast, no one will see it. But it is very undesirable if the console remains open after the script … Read more

How can I auto-elevate my batch file, so that it requests from UAC administrator rights if required?

There is an easy way without the need to use an external tool – it runs fine with Windows 7, 8, 8.1, 10 and 11 and is backwards-compatible too (Windows XP doesn’t have any UAC, thus elevation is not needed – in that case the script just proceeds). Check out this code (I was inspired by the … Read more

How do I force my .NET application to run as administrator?

You’ll want to modify the manifest that gets embedded in the program. This works on Visual Studio 2008 and higher: Project + Add New Item, select “Application Manifest File”. Change the <requestedExecutionLevel> element to: <requestedExecutionLevel level=”requireAdministrator” uiAccess=”false” /> The user gets the UAC prompt when they start the program. Use wisely; their patience can wear out quickly.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)