【问题标题】:Inno Setup - bcdedit is not workingInno 设置 - bcdedit 不工作
【发布时间】:2015-10-23 04:25:19
【问题描述】:

我需要提交命令:

bcdedit /set {default} recoveryenabled No

但它不适用于 Inno Setup。

我试过如下:

[Setup]
PrivilegesRequired=admin

[Run]
Filename: "{cmd}"; Parameters: "/c ""bcdedit.exe /set recoveryenabled No""";

但我仍然看到 No 未应用。正如您在下面看到的,它仍然是Yes。但是当我从命令提示符手动执行相同的命令时,它可以工作。知道为什么它在 Inno Setup 中不起作用吗?我还以管理员身份运行setup.exe

C:\windows\system32>bcdedit /v

Windows Boot Manager
--------------------
identifier              {9dea862c-5cdd-4e70-acc1-f32b344d4795}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-GB

integrityservices       Enable

timeout                 30

Windows Boot Loader
-------------------

device                  partition=C:
path                    \windows\system32\winload.efi
description             Windows 8.1
locale                  en-GB

integrityservices       Enable
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \windows

nx                      OptIn
bootmenupolicy          Standard
quietboot               Yes

【问题讨论】:

    标签: windows inno-setup bcdedit


    【解决方案1】:

    可能有很多原因。这很难说,因为您没有提供太多信息来调试它。

    使用/K 代替/C 是第一步,因为它将保持cmd.exe 窗口打开,以便您查看是否有任何错误消息。


    当我在一个简单的安装程序中使用您的 [Run] 部分条目时,我得到:

    'bcdedit.exe' 未被识别为内部或外部命令, 可运行的程序或批处理文件。

    在我的系统上(我相信在你的系统上也是如此),这是因为我运行的是 64 位 Windows 并且bcdedit.exeC:\Windows\System32 中。作为 32 位应用程序中的 Inno Setup,它默认为 gets redirected to C:\Windows\SysWOW64C:\Windows\System32 的 32 位版本)。并且没有 32 位版本的 bcdedit.exe

    添加Flags: 64bit 使Inno Setup 找到bcdedit.exe 的64 位版本。

    此外,通过命令解释器 (cmd.exe) 运行 .exe 应用程序毫无意义。

    [Run]
    Filename: "bcdedit.exe"; Parameters: "/set recoveryenabled No"; Flags: 64bit
    

    或使用64-bit install mode

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-03
      • 2013-06-05
      • 2012-11-07
      • 2011-05-28
      相关资源
      最近更新 更多