CreateProcess failed when the inno setup packager is installed; code 740

problem: USES inno setup to package our published program test.exe. After the installation, check Launch XXX to run the program, and the following error occurs:
Unable to execute file:xxx
CreateProcess failed; code 740.
The requested operation needs to be promoted.

error reason: below are the two ICONS of test.exe, with the shield is with the administrator rights, without the shield is a normal program.


When packaging ordinary programs, the end of the installation will not report an error; An error will not be reported until the end of the installation when the administrator privilege program is packaged.
My guess is that when the installation package is executed, the installation package does not carry administrator rights, so after the installation is over, start test.exe without administrator rights and it will execute normally.
However, if you were to execute test.exe with administrator privileges, you would have permission issues.
therefore, we need to install the package with administrator rights, let the installation package run with administrator rights.
Specific implementation steps are as follows:
Let the installation packages generated by inno Setup come with administrator privileges
Download Resource Hacker
Download address: http://www.angusj.com/resourcehacker/

2. Modify setupldr.e32 file
, right click on the administrator rights to run resourcehacker.exe, select File-> Open, find the setupldr.e32 file in the Inno Setup installation directory.

I’ll change asInvoker to requireAdministrator

After modification, first select Action-& GT; Modify, then File-> Save. As follows:

3. Recompile the package script
Recompiled with Inno Setup, the resulting installation package will have a shield attached to the icon. As follows:


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Spare time not regularly update some ideas, thinking articles, welcome to pay attention to, discuss together, precipitation technology!

Read More: