Duplicate Boot Loader for OSIM ImageX Windows 11
search cancel

Duplicate Boot Loader for OSIM ImageX Windows 11

book

Article ID: 419888

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation

Issue/Introduction

When installing a ImageX OS Image (Windows 11 ) using OSIM, a dual boot loader appears :

 

With bcdedit we could see 2 Boot Loader

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=O:
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-us
inherit                 {globalsettings}
default                 {default}
resumeobject            {uuid}
displayorder            {default}
                       {uuid}
toolsdisplayorder       {memdiag}
timeout                 30


Windows Boot Loader
-------------------
identifier              {default}
device                  partition=C:
path                    \windows\system32\winload.efi
description             Windows 11
locale                  en-us
inherit                 {bootloadersettings}
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \windows
resumeobject            {uuid}
nx                      OptIn
bootmenupolicy          Standard


Windows Boot Loader
-------------------
identifier              {uuid}
device                  locate=\WINDOWS\system32\winload.efi
path                    \WINDOWS\system32\winload.efi
description             Windows 11
locale                  de-DE
inherit                 {bootloadersettings}
displaymessageoverride  Recovery
recoveryenabled         No
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                locate=\WINDOWS
systemroot              \WINDOWS
resumeobject            {uuid}
nx                      OptIn
bootmenupolicy          Standard

Environment

Client Automation 14.5 CU7 + Patch 99112377 (Client Automation OSIM Certification 14.5 CU7 - Windows 11 24H2)

Cause

This problem is caused by this part in script C:\Program Files (x86)\CA\DSM\osimips\os-template\camenu\IMAGEX64-WIN10.cmd

c:
if not %uefiBoot%=="" (
  bcdboot c:\windows /s o:
) else (
  bcdboot c:\windows /d /s c:
)

boot loader is created again even if there is already one.

Resolution

  1. Edit file C:\Program Files (x86)\CA\DSM\osimips\os-template\camenu\IMAGEX64-WIN10.cmd

    and replace the part in bold

    REM remove old information about prepare sysprep step
    if exist c:\osimsysprep.log ( del c:\osimsysprep.log /Q /F )

    c:
    if not %uefiBoot%=="" (
      bcdboot c:\windows /d /s o:
    ) else (
      bcdboot c:\windows /d /s c:
    )

    bcdedit /set {default} device partition=c:
    bcdedit /set {default} osdevice partition=c:
    if not %uefiBoot%=="" (
      bcdedit /set {bootmgr} device partition=o:
    ) else (
      bcdedit /set {bootmgr} device partition=c:
    )
    bcdedit /set {ntldr} device partition=c:

    cd c:\
    x:\amd64\ca-osim\sdmpcimg -m TFTP -p c:\canpc.dat

    with this part in bold :

    REM remove old information about prepare sysprep step
    if exist c:\osimsysprep.log ( del c:\osimsysprep.log /Q /F )

    c:
    if not %uefiBoot%=="" (
     rem Clean any existing BCD entries first
     bcdedit /delete {default} /f >nul 2>&1
     bcdedit /delete {bootmgr} /f >nul 2>&1
     
     rem Create fresh boot configuration for UEFI
     bcdboot c:\windows /s o: /f UEFI
     bcdedit /set {default} device partition=c:
     bcdedit /set {default} osdevice partition=c:
     bcdedit /set {bootmgr} device partition=o:
    ) else (
     rem Clean any existing BCD entries first  
     bcdedit /delete {default} /f >nul 2>&1
     
     rem Create fresh boot configuration for BIOS
     bcdboot c:\windows /s c: /f BIOS
     bcdedit /set {default} device partition=c:
     bcdedit /set {default} osdevice partition=c:
     bcdedit /set {bootmgr} device partition=c:
    )
    bcdedit /set {ntldr} device partition=c:

    cd c:\
    x:\amd64\ca-osim\sdmpcimg -m TFTP -p c:\canpc.dat

    .
  2. Do the same modification for already created ImageX OS Image under 

    C:\Program Files (x86)\CA\DSM\Server\SDBS\var\managedpc\camenu\<IMAGENAME>.cmd

Additional Information

This problem is corrected in file IMAGEX64-WIN10.cmd of Client Automation 14.6