0

我使用 Inno Setup 6.0.3 创建了一个设置,该设置要求最后自动重新启动 Windows 2019 Server。

但是,如果 UAC 设置设置如下 - 用户帐户控制设置:仅当应用程序尝试对我的计算机进行更改时通知我(默认)

用户通过双击Windows 资源管理器中的设置文件开始设置,然后选择“是,立即重新启动计算机”,然后我收到以下错误 - “安装程序无法重新启动计算机。请手动执行此操作”

我已包含所需的 [Setup] 指令 PrivilegesRequired 和 AlwaysRestart

[Setup]
PrivilegesRequired=admin

ChangesEnvironment=yes
AppName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName=test\MyProduct

AlwaysRestart=yes

设置日志确实显示调用了 Inno 设置代码以重新启动 Windows。

2019-11-25 01:28:22.755   Process exit code: 1
2019-11-25 01:28:22.976   Need to restart Windows? Yes
2019-11-25 01:28:25.083   Deinitializing Setup.
2019-11-25 01:28:25.087   Restarting Windows.
2019-11-25 01:28:25.098   Log closed.

然而,API ExitWindows 失败,因为 inno 设置未能提升权限,因此 Windows 无法启动并显示上述错误消息。

笔记:

  • 此外,如果我通过右键单击“以管理员身份运行”来明确运行设置,那么自动重启工作正常。
  • 如果 UAC 已关闭,即设置为“从不通知...”,那么即使用户通过双击 Windows explore 中的设置文件启动设置,自动重启也会起作用。

这是一个已知问题还是我在 [Setup] 指令中遗漏了什么?

完整的日志失败:

2019-11-25 01:28:19.079 Log opened. (Time zone: UTC-08:00) 2019-11-25 01:28:19.079 Setup version: Inno Setup version 6.0.3 (u) 2019-11-25 01:28:19.079 Original Setup EXE: C:\viren\Output\mysetup.exe 2019-11-25 01:28:19.079 Setup command line: /SL5="$5065A,721408,721408,C:\viren\Output\mysetup.exe" /SPAWNWND=$C0662 /NOTIFYWND=$3A0222 /ALLUSERS 2019-11-25 01:28:19.080 Compatibility mode: Yes (Installer) 2019-11-25 01:28:19.080 Windows version: 10.0.17763 (NT platform: Yes) 2019-11-25 01:28:19.080 64-bit Windows: Yes 2019-11-25 01:28:19.080 Processor architecture: x64 2019-11-25 01:28:19.080 User privileges: Administrative 2019-11-25 01:28:19.082 Administrative install mode: Yes 2019-11-25 01:28:19.083 Install mode root key: HKEY_LOCAL_MACHINE 2019-11-25 01:28:19.083 64-bit install mode: No 2019-11-25 01:28:19.087 Created temporary directory: C:\Users\ADMINI~1\AppData\Local\Temp\is-7REUJ.tmp 2019-11-25 01:28:21.790 Calling RestartManager's RmGetList. 2019-11-25 01:28:21.800 RmGetList finished successfully. 2019-11-25 01:28:21.800 RestartManager found no applications using one of our files. 2019-11-25 01:28:21.820 Starting the installation process. 2019-11-25 01:28:21.829 Directory for uninstall files: C:\Program Files (x86)\MyOrg 2019-11-25 01:28:21.839 Will append to existing uninstall log: C:\Program Files (x86)\MyOrg\unins000.dat 2019-11-25 01:28:21.880 -- File entry -- 2019-11-25 01:28:21.881 Dest filename: C:\Program Files (x86)\MyOrg\unins000.exe 2019-11-25 01:28:21.884 Time stamp of our file: 2019-11-25 01:28:18.741 2019-11-25 01:28:21.884 Dest file exists. 2019-11-25 01:28:21.884 Time stamp of existing file: 2019-11-25 01:25:14.078 2019-11-25 01:28:21.885 Version of our file: 51.1052.0.0 2019-11-25 01:28:22.111 Version of existing file: 51.1052.0.0 2019-11-25 01:28:22.111 Installing the file. 2019-11-25 01:28:22.203 Leaving temporary file in place for now. 2019-11-25 01:28:22.205 Saving uninstall information. 2019-11-25 01:28:22.205 Renaming uninstaller. 2019-11-25 01:28:22.207 Deleting uninstall key left over from previous administrative 32-bit install. 2019-11-25 01:28:22.207 Creating new uninstall key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{0940EFBB-D1FC-4C6F-91E0-996D9E40B2A5}_is1 2019-11-25 01:28:22.208 Writing uninstall key values. 2019-11-25 01:28:22.210 Detected previous non administrative install? No 2019-11-25 01:28:22.210 Detected previous administrative 64-bit install? No 2019-11-25 01:28:22.216 Installation process succeeded. 2019-11-25 01:28:22.230 -- Run entry -- 2019-11-25 01:28:22.230 Run as: Current user 2019-11-25 01:28:22.230 Type: Exec 2019-11-25 01:28:22.230 Filename: certutil 2019-11-25 01:28:22.230 Parameters: -f -p xyz -importpfx "C:\MyOrg\NMX\CertFiles\Some-Certificate.pfx" 2019-11-25 01:28:22.462 Process exit code: 0 2019-11-25 01:28:22.463 -- Run entry -- 2019-11-25 01:28:22.463 Run as: Current user 2019-11-25 01:28:22.463 Type: Exec 2019-11-25 01:28:22.463 Filename: netsh 2019-11-25 01:28:22.463 Parameters: http add sslcert ipport=0.0.0.0:443 certhash=458A6AXXXXXXXXXXXXXXXXXXXXXXXXXxxxxx84059B8 appid={7CE058D3-892A-4318-9D3C-41FA3D8C6CE2} 2019-11-25 01:28:22.755 Process exit code: 1 2019-11-25 01:28:22.976 Need to restart Windows? Yes 2019-11-25 01:28:25.083 Deinitializing Setup. 2019-11-25 01:28:25.087 Restarting Windows. 2019-11-25 01:28:25.098 Log closed.

完整的日志工作

2019-11-25 05:08:50.911 Log opened. (Time zone: UTC-08:00) 2019-11-25 05:08:50.911 Setup version: Inno Setup version 6.0.3 (u) 2019-11-25 05:08:50.911 Original Setup EXE: C:\viren\Output\mysetup.exe 2019-11-25 05:08:50.911 Setup command line: /SL5="$22031A,721408,721408,C:\viren\Output\mysetup.exe" 2019-11-25 05:08:50.912 Compatibility mode: Yes (Installer) 2019-11-25 05:08:50.912 Windows version: 10.0.17763 (NT platform: Yes) 2019-11-25 05:08:50.912 64-bit Windows: Yes 2019-11-25 05:08:50.912 Processor architecture: x64 2019-11-25 05:08:50.912 User privileges: Administrative 2019-11-25 05:08:50.913 Administrative install mode: Yes 2019-11-25 05:08:50.913 Install mode root key: HKEY_LOCAL_MACHINE 2019-11-25 05:08:50.913 64-bit install mode: No 2019-11-25 05:08:50.917 Created temporary directory: C:\Users\ADMINI~1\AppData\Local\Temp\is-9VKDA.tmp 2019-11-25 05:08:53.798 Calling RestartManager's RmGetList. 2019-11-25 05:08:53.810 RmGetList finished successfully. 2019-11-25 05:08:53.810 RestartManager found no applications using one of our files. 2019-11-25 05:08:53.833 Starting the installation process. 2019-11-25 05:08:53.840 Directory for uninstall files: C:\Program Files (x86)\MyOrg 2019-11-25 05:08:53.856 Will append to existing uninstall log: C:\Program Files (x86)\MyOrg\unins000.dat 2019-11-25 05:08:53.861 -- File entry -- 2019-11-25 05:08:53.862 Dest filename: C:\Program Files (x86)\MyOrg\unins000.exe 2019-11-25 05:08:53.865 Time stamp of our file: 2019-11-25 05:08:50.653 2019-11-25 05:08:53.865 Dest file exists. 2019-11-25 05:08:53.865 Time stamp of existing file: 2019-11-25 01:28:18.741 2019-11-25 05:08:53.865 Version of our file: 51.1052.0.0 2019-11-25 05:08:54.165 Version of existing file: 51.1052.0.0 2019-11-25 05:08:54.166 Installing the file. 2019-11-25 05:08:54.305 Leaving temporary file in place for now. 2019-11-25 05:08:54.309 Saving uninstall information. 2019-11-25 05:08:54.309 Renaming uninstaller. 2019-11-25 05:08:54.313 Deleting uninstall key left over from previous administrative 32-bit install. 2019-11-25 05:08:54.314 Creating new uninstall key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{0940EFBB-D1FC-4C6F-91E0-996D9E40B2A5}_is1 2019-11-25 05:08:54.315 Writing uninstall key values. 2019-11-25 05:08:54.316 Detected previous non administrative install? No 2019-11-25 05:08:54.316 Detected previous administrative 64-bit install? No 2019-11-25 05:08:54.325 Installation process succeeded. 2019-11-25 05:08:54.347 -- Run entry -- 2019-11-25 05:08:54.347 Run as: Current user 2019-11-25 05:08:54.347 Type: Exec 2019-11-25 05:08:54.347 Filename: certutil 2019-11-25 05:08:54.347 Parameters: -f -p xyz -importpfx "C:\MyOrg\NMX\CertFiles\Some-Certificate.pfx" 2019-11-25 05:08:54.542 Process exit code: 2147942402 2019-11-25 05:08:54.544 -- Run entry -- 2019-11-25 05:08:54.544 Run as: Current user 2019-11-25 05:08:54.544 Type: Exec 2019-11-25 05:08:54.545 Filename: netsh 2019-11-25 05:08:54.545 Parameters: http add sslcert ipport=0.0.0.0:443 certhash=xxxxxxxxdffdsafdsfdsafsafsdafsa appid={7CE058D3-892A-4318-9D3C-41FA3D8C6CE2} 2019-11-25 05:08:55.150 Process exit code: 1 2019-11-25 05:08:55.365 Need to restart Windows? Yes 2019-11-25 05:08:57.032 Deinitializing Setup. 2019-11-25 05:08:57.037 Restarting Windows. 2019-11-25 05:08:57.050 Log closed.

4

0 回答 0