我需要提交命令:
bcdedit /set {default} recoveryenabled No但它不适用于Inno安装程序。
我尝试了以下几点:
[Setup]
PrivilegesRequired=admin
[Run]
Filename: "{cmd}"; Parameters: "/c ""bcdedit.exe /set recoveryenabled No""";但是我仍然看到No没有被应用。正如您在下面看到的,它仍然是Yes。但是,当我从命令提示符手动执行相同的命令时,它可以工作。知道为什么它在Inno安装程序中不能工作吗?我还以管理员身份运行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发布于 2015-10-23 06:11:26
可能有很多原因。很难判断,因为您没有提供太多的信息来调试它。
使用/K而不是/C是第一步,因为它将使cmd.exe窗口保持打开状态,这样您就可以看到是否有任何错误消息。
当我在一个普通的安装程序中使用您的[Run]节条目时,我得到:
“bcdedit.exe”不被识别为内部或外部命令、可操作的程序或批处理文件。
在我的系统上(我相信你的系统也会一样),这是因为我运行的是Windows64位,bcdedit.exe是在C:\Windows\System32中运行的。作为32位应用程序中的Inno安装程序,默认情况下它是C:\Windows\SysWOW64 (C:\Windows\System32的32位版本).而且没有32位版本的bcdedit.exe。
添加Flags: 64bit使Inno安装程序找到64位版本的bcdedit.exe.
此外,没有必要通过命令解释器( .exe )运行cmd.exe应用程序。
[Run]
Filename: "bcdedit.exe"; Parameters: "/set recoveryenabled No"; Flags: 64bit或者使用64位安装模式。
https://stackoverflow.com/questions/33294868
复制相似问题