The common method we use in Windows is to add a manifest file to the application and then the resulting Exe will have administrator privileges.
Recently, when I used Wix to create Exe installer, I found that this method does not work, I searched on github and * for a long time did not find a good way, the only feasible way is to use the App application to wrap a layer so that the installer will have administrator privileges at startup, but I do not think it is very good, so I decided to modify the PE file directly after a day of effort, has been successfully implemented in C# code (of course, you can use C# code to do it), and I have been able to use C# code to do it. After a day's effort, I've successfully realized it with C# code (of course, you can also use theCFF Explorertool interface words operation to achieve), the next section describes the use of the tool to modify to achieve the effect.
1. After installing the CFF Explorer tool, open the tool
2. Check for administrator privileges
As shown above, we want to realize that the location becomes requireAdministrator
3. Finding the address of the inventory document
Copy the address as shown above