Using the RelaunchElevated Fix
Published: June 11, 2010
Updated: June 11, 2010
Applies To: Windows 7, Windows Vista
This section includes information about using the RelaunchElevated compatibility fix, including the associated issues and usage.
The RelaunchElevated compatibility fix enables you to automatically elevate child applications when the parent process that calls the CreateProcess API is difficult to determine. This compatibility fix works by redirecting the executable's entry point to jump to code inside of the fix itself, which then restarts the application with elevated permissions. For example, it is a common practice for a Web download to change its name. By using this compatibility fix, it is possible to specify the child executable whose name does not change, instead of the parent, whose name might change.
|If the application contains a User Account Control (UAC) manifest, the compatibility fix will be disabled, and the application will not start with elevated permissions. In addition, you might have to also apply the Using the SpecificNonInstaller Fix to further prevent the application from failing to start with elevated permissions.|
Investigating the Issue
The RelaunchElevated compatibility fix should be considered as a possible resolution if you receive the ERROR_ELEVATION_REQUIRED failure and if you are unable to consistently target the parent application by using the ElevateCreateProcess compatibility fix due to an unexpected name change by the parent application.
None. This compatibility fix interrupts the application start process, and then creates a new elevated instance each time the targeted application is started.
Fixing Your Code
You can remedy this issue by creating a manifest for the specific application that includes the desired run-level (requireAdministrator), and then by using the ShellExecuteEx API to invoke this specified executable file.