Inno Setup CreateProcess failed: Code 740 (Inno Setup program packaged promoted to administrator privileges)

Original reference  https://www.cnblogs.com/SnailProgramer/p/4243666.html

http://blog.csdn.net/x356982611/article/details/50386824/

1. Description of the problem

Inno Setup packaged programs on Win7 64-bit systems installed, the final step in the installation procedure If selected to run the program, you will get an error message box.

This is because of the need administrator rights 64 win7 system to run the program, and packed files and do not have this privilege to try to directly run. Solution: Add the administrator privileges to install the package.

2, add administrator privileges

(1) adding a node [Setup] .iss file PrivilegesRequired = admin

(2) into the installation directory, locate the file SetupLdr.e32, which is a binary configuration file, you need to modify this tool with ResourceHacker.exe

   找到<requestedExecutionLevel level="asInvoker" uiAccess="false"/></requestedPrivileges>,

修改为<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/></requestedPrivileges>

(3) After modifying resources do not forget to compile it, and then save the modified file, and replace the original file SetupLdr.e32

3, remove administrator privileges

(1) the node is added PrivilegesRequired [Setup] = none or PrivilegesRequired = lowest

(2) 在[Setup]节点修改 DefaultDirName(安装路径)的值,默认可能是DefaultDirName={pf}\{#MyAppName},

  不要带{pf}, {win}, {sys}这些变量值,比如设置成DefaultDirName={localappdata}\{#MyAppName}

Guess you like

Origin www.cnblogs.com/xiurui12345/p/11814188.html