在Inno Setup中以管理员权限执行安装后程序

问题描述 投票:1回答:1

我正在尝试在安装结束时运行另一个安装程序(postinstall)。安装程序需要管理员授权。因此添加了PrivilegesRequired=admin,错误仍然存​​在。

以下错误消息:enter image description here

无法执行文件:C:\ Users \ User1 \ AppData \ Local \ Multi Webcam Video Recorder \ webcam.exe

CreateProcess失败;代码740。请求的操作需要提升。

#define MyAppName "Multi Webcam Video Recorder"
#define MyAppExeName "webcam.exe"

[Setup]
AppName={#MyAppName}
PrivilegesRequired=admin

[Files]
Source: ..\src\webcam.exe; DestDir: {localappdata}\{#MyAppName}; Flags: ignoreversion

[Run]
Filename: {localappdata}\{#MyAppName}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent
installer inno-setup elevated-privileges
1个回答
0
投票

使用postinstall flag,默认情况下以原始权限执行程序,即使安装程序本身以管理员权限运行。要保留安装程序的(管理员)权限,请添加postinstall

runascurrentuser flag
© www.soinside.com 2019 - 2024. All rights reserved.