我通过 Inno setup 创建了一个安装程序。安装程序安装的 MyPro.exe 应在 Win7 中以管理员身份运行。以下是脚本的重要部分。但是,MyPro.exe 仍然无法以管理员身份运行,并且无法在 \System 中写入其配置文件。你能告诉我哪个是错的吗?
[Setup]
PrivilegesRequired=admin
[Icons]
Name: {group}\MyPro; Filename: {app}\MyPro.exe; Flags:
[Registry]
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\"; ValueType: String; ValueName: "{app}\MyPro.exe"; ValueData: "RUNASADMIN"; Flags: uninsdeletekeyifempty uninsdeletevalue; MinVersion: 0,6.1
Root: "HKCU"; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: String; ValueName: "{app}\MyPro.exe"; ValueData: "RUNASADMIN"; Flags: uninsdeletevalue; MinVersion: 0,6.1