{"id":22325867,"url":"https://github.com/falahati/uachelper","last_synced_at":"2025-07-29T16:33:35.765Z","repository":{"id":65414131,"uuid":"57291113","full_name":"falahati/UACHelper","owner":"falahati","description":"A helper class library to detect, manage and use UAC functionalities in your program.","archived":false,"fork":false,"pushed_at":"2020-04-18T17:35:47.000Z","size":158,"stargazers_count":70,"open_issues_count":1,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-05-22T22:02:48.237Z","etag":null,"topics":["elevation","uac","uac-functionalities","uac-shield-icon","uac-virtualization"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/falahati.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-28T10:01:34.000Z","updated_at":"2024-02-05T04:39:12.000Z","dependencies_parsed_at":"2023-01-23T10:55:07.787Z","dependency_job_id":null,"html_url":"https://github.com/falahati/UACHelper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falahati%2FUACHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falahati%2FUACHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falahati%2FUACHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falahati%2FUACHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/falahati","download_url":"https://codeload.github.com/falahati/UACHelper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228030009,"owners_count":17858432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elevation","uac","uac-functionalities","uac-shield-icon","uac-virtualization"],"created_at":"2024-12-04T02:14:11.375Z","updated_at":"2024-12-04T02:14:11.806Z","avatar_url":"https://github.com/falahati.png","language":"C#","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=ramin.graphix@gmail.com\u0026lc=US\u0026item_name=Donate\u0026no_note=0\u0026cn=\u0026curency_code=USD\u0026bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"],"categories":[],"sub_categories":[],"readme":"# UAC Helper Class Library\n[![](https://img.shields.io/github/license/falahati/UACHelper.svg?style=flat-square)](https://github.com/falahati/UACHelper/blob/master/LICENSE)\n[![](https://img.shields.io/github/commit-activity/y/falahati/UACHelper.svg?style=flat-square)](https://github.com/falahati/UACHelper/commits/master)\n[![](https://img.shields.io/github/issues/falahati/UACHelper.svg?style=flat-square)](https://github.com/falahati/UACHelper/issues)\n\nA helper class library to detect, manage and use UAC functionalities in your program\n\n## How to get\n[![](https://img.shields.io/nuget/dt/UACHelper.svg?style=flat-square)](https://www.nuget.org/packages/UACHelper)\n[![](https://img.shields.io/nuget/v/UACHelper.svg?style=flat-square)](https://www.nuget.org/packages/UACHelper)\n\nThis library is available as a NuGet package at [nuget.org](https://www.nuget.org/packages/UACHelper/).\n\n## Help me fund my own Death Star\n\n[![](https://img.shields.io/badge/crypto-CoinPayments-8a00a3.svg?style=flat-square)](https://www.coinpayments.net/index.php?cmd=_donate\u0026reset=1\u0026merchant=820707aded07845511b841f9c4c335cd\u0026item_name=Donate\u0026currency=USD\u0026amountf=20.00000000\u0026allow_amount=1\u0026want_shipping=0\u0026allow_extra=1)\n[![](https://img.shields.io/badge/shetab-ZarinPal-8a00a3.svg?style=flat-square)](https://zarinp.al/@falahati)\n[![](https://img.shields.io/badge/usd-Paypal-8a00a3.svg?style=flat-square)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=ramin.graphix@gmail.com\u0026lc=US\u0026item_name=Donate\u0026no_note=0\u0026cn=\u0026curency_code=USD\u0026bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted)\n\n**--OR--**\n\nYou can always donate your time by contributing to the project or by introducing it to others.\n\n## How to use\nCurrently there are three main classes in this library:\n\n### `UACHelper.UACHelper`\nThis static class contains properties about the current state of the application as well as providing methods to get information about other processes and starting new ones.\n\n##### [Static Read Only Properties]\n* `UACHelper.IsElevated`:  A `Boolean` value indicating if the current process has full administrative rights\n* `UACHelper.IsUACSupported`: A `Boolean` value indicating if UAC virtualization is supported on the current machine\n* `UACHelper.IsDesktopOwner`: A `Boolean` value indicating if the user that owns this process also owns the desktop session\n* `UACHelper.IsVirtualized`: A `Boolean` value indicating if the current process started under UAC virtualization\n* `UACHelper.IsAdministrator`: A `Boolean` value indicating if the user that owns this process is a member of the 'Administrators' group\n* `UACHelper.IsUACEnable`: A `Boolean` value indicating if the UAC vitalization is enable on this machine\n* `UACHelper.DesktopOwner`: Returns a `NTAccount` object containing information about the current desktop owner\n* `UACHelper.Owner`: Returns a `WindowsIdentity` object containing information about the current process owner\n\n##### [Static Methods]\n* `UACHelper.GetProcessDesktopOwner()`: Returns a `NTAccount` object containing information about the desktop owner of a specific `Process`\n* `UACHelper.GetProcessOwner()`: Returns a `WindowsIdentity` object containing information about the owner of a specific `Process`\n* `UACHelper.IsProcessElevated()`: Indicates if the passed `Process` started with elevated privileges\n* `UACHelper.GetExpectedRunlevel()`: Checks a file and retrieve the expected `RunLevel` for it to start\n* `UACHelper.StartElevated()`: Starts a new elevated `Process` with the start info provided\n* `UACHelper.StartLimited()`: Starts a new `Process` with the start info provided and with the limited access rights\n* `UACHelper.StartLimitedTask()`: Starts a new process with the task info provided and with the limited access rights using TaskScheduler service\n* `UACHelper.StartWithShell()`: Starts a new `Process` with the start info provided and with the same rights as the current active shell process\n* `UACHelper.StartByShell()`: Starts a new `Process` with the start info provided using the current shell desktop `IShellDispatch2.ShellExecute()` method.\n* `UACHelper.StartAndCopyProcessPermission()`: Starts a new `Process` with the start info provided and with the same rights as the mentioned `Process`\n\n\n### `UACHelper.AAMSettings`\nThis static class contains settings of the \"Admin Approval Mode\"\n\n##### [Static Properties]\n* `AAMSettings.IsEnable`: Enables the \"administrator in Admin Approval Mode\" user type while also enabling all other User Account Control (UAC) policies. Requires restart.\n* `AAMSettings.EnforceAdminCodeSignatures`: Enforce cryptographic signatures on any interactive application that requests elevation of privilege.\n* `AAMSettings.ForceDimPromptScreen`: Will force all UAC prompts to happen on the user's secure desktop.\n* `AAMSettings.IsVirtualizationEnable`: Enables the redirection of legacy application File and Registry writes that would normally fail as standard user to a user-writable data location.\n* `AAMSettings.IsInstallerDetectionEnable`: Used to heuristically detect applications that require an elevation of privilege to install.\n* `AAMSettings.UserPromptBehavior`:  AAM behaviors regarding users running elevated applications\n* `AAMSettings.AdminPromptBehavior`: AAM behaviors regarding administrators' changes to system\n\n\n### `UACHelper.WinForm`\nThis static class contains multiple methods to add the UAC shield icon to the buttons, forms and native dialogs\n\n##### [Static Methods]\n* `WinForm.ShieldifyNativeDialog`: Goes through the controls in the native dialog and adds the UAC shield icon to the desired native button.\n* `WinForm.ShieldifyNativeButton`: Adds the UAC shield icon to the button\n* `WinForm.ShieldifyForm`: Goes through the controls in the `Form` and adds the UAC shield icon to the desired `Button`. Then calls the `Form.ShowDialog` to display the form.\n* `WinForm.ShieldifyButton`: Changes the `Button.FlatStyle` to `FlatStyle.System` and adds the UAC shield icon\n\n##### [Extension Methods]\n* `Form.ShowDialog`: Alias of `WinForm.ShieldifyForm`\n* `Form.ShieldifyButton`: Alias of `WinForm.ShieldifyButton`\n\n## Examples\nCheck the 'UACHelper.Sample' for tons of examples on how to use the library.\n![Screenshot](/screenshot.jpg?raw=true \"Screenshot\")\n\n* Restart the current program in Elevated Mode:\n```C#\nUACHelper.StartElevated(\n    new ProcessStartInfo(Assembly.GetExecutingAssembly().Location)\n);\n```\n\n* Restart the current program in Limited Mode:\n```C#\nUACHelper.StartLimited(\n    new ProcessStartInfo(Assembly.GetExecutingAssembly().Location)\n);\n```\n\n## To do\n* Create an elevated Out-Of-Process COM object from a limited process - Read More: [The COM Elevation Moniker](https://msdn.microsoft.com/en-us/ms679687.aspx)\n\n## License\nThe MIT License (MIT)\n\nCopyright (c) 2016-2020 Soroush\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalahati%2Fuachelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffalahati%2Fuachelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalahati%2Fuachelper/lists"}