2015-10-23 157 views
0

我需要提交以下命令:Inno Setup的 - BCDEDIT不工作

bcdedit /set {default} recoveryenabled No 

,但它不是与Inno Setup的工作。

我已经试过如下:

[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 

回答

1

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

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


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

“bcdedit.exe的”不被识别为一个内部或外部命令,可操作 程序或批处理文件。

在我的系统(我相信这将是对你的一样),那是因为我运行Windows 64位和bcdedit.exeC:\Windows\System32。由于Inno Setup在32位应用程序中,默认情况下为gets redirected to C:\Windows\SysWOW64C:\Windows\System32的32位版本)。并且没有32位版本的bcdedit.exe

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

另外,通过命令解释器(cmd.exe)运行.exe应用程序没有意义。

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

或者使用64-bit install mode