Win 11 Boot And Upgrade FiX KiT (v5.1f Released!!!)

Discussion in 'Windows 11' started by Enthousiast, Jun 28, 2021.

  1. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,396
    2,376
    60
  2. Famingpunk

    Famingpunk MDL Novice

    May 20, 2021
    32
    9
    0
    I'm running Windows 10 Enterprise version 19043.1082
    Thanks for the code i'll try that
    is there any fix for the invalid namespace error?
    i've tried dism restore and sfc

    Update: i changed the code to what was mentioned above but again giving same "invalid Namespace" error
     
  3. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    7,894
    10,734
    240
    is true hmm Here in Brazil the TPM 2.0 module is costing the face of the face and hard to find that petty people ...;):mad:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. itsmemario1

    itsmemario1 MDL Expert

    Sep 10, 2012
    1,085
    295
    60
    nevermind, whooops
     
  5. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,647
    103,302
    450
  6. Same applies on Win10 builds too for bypassramcheck.
     
  7. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,647
    103,302
    450
    Finally had the time to run a test with a spacing in the filepath and nothing solved it, the extra %dp0 were gone since 1.4b and it still errors when i run it from a path with a spacing in it, will simply put a warning in the readme and OP, to run all from a path without spacings for now, maybe @abbodi1406 can shine his light on the problem when he has some spare time.
     
  8. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,647
    103,302
    450
  9. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,418
    11,684
    240
    Well I'm at a loss then. Your system must have some weird issues.
    You could try to run the oscdimg manually replacing all of the variables with specifically designated words or letters.
    So a "working" oscdimg line for you might look something like:
    Code:
    bin\cdimage.exe -bootdata:2#p0,e,b"Work\boot\etfsboot.com"#pEF,e,b"Work\efi\Microsoft\boot\efisys.bin" -o -m -u2 -udfver102 -lWin_11_22000_x64_en-US Work Win11_22000.51_x64_en-US.iso
    And if you do get everything sorted, try not to butcher your os with weird mods or something in the future. Stick to safe mods like using group policy editor registry setting override keys.
     
  10. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,418
    11,684
    240
    #50 murphy78, Jun 30, 2021
    Last edited: Jul 1, 2021
    What do you mean nothing solved it? I already told you how to solve it. You don't need to put %~dp0 in a file name location if there is a pushd %~dp0 earlier in the script such as you have with your admin check earlier in the your own script.
    I wouldn't have told you how to solve it if I didn't know it solved it. I tested it already.

    edit: Look I even found another fix for you just now. It looks like the problem was the quotes on each side of the set command. So here's a fix where you move the quote from the left side of the set command so that the quotes are only on the right side:
    Code:
    :: Detect OS Architecture
    reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && ( set "arch=x86" ) || ( set "arch=x64" )
    
    if %arch%==x86 (
      set _wimlib="%~dp0bin\wimlib-imagex.exe"
      set "xOS=x86"
    ) else (
      set _wimlib="%~dp0bin\bin64\wimlib-imagex.exe"
      set "xOS=amd64"
    )
    
    This way you keep your %~dp0 and everyone gets to keep their spaced directories and everyone is happy
     
  11. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,647
    103,302
    450
    I was still thinking you meant the extra %~dp0 in the wimlib update commandlines, those were gone since 2 revisions.

    Testing the removal of the os arch settings lines.

    Seems to work:)

    Running from a file path containing a spacing:
    Code:
    
    ============================================================
    Win 11 Boot & Upgrade FiX KiT v1.7...
    ============================================================
    
    
    ================================================================================
    Select the desired FiX...
    ================================================================================
    
    [ 1 ] - Puts the Win 11 install.wim/esd in a Win 10 ISO (Provide a Win 10 ISO in the "Source_ISO\W10\" Folder)
    This method is usefull for clean installs from boot, using the standard W10 setup. A generic EI.CFG file will
    be copied to the sources folder.
    
    [ 2 ] - Integrate Diskpart & Apply Image script (v1.28), modify boot.wim to skip the SB, RAM and TPM 2.0 check
    and replace "appraiserres.dll" with one from a 1703 ISO
    
    This method enables you to:
    - Use the standard Win 11 setup for clean installs on devices without Secure Boot and TPM 2.0 and low amount of RAM.
    - Use the alternative Diskpart & Apply Image installation script for clean installs.
    - Circumvent "TPM 2.0 is required" error when (inplace) upgrading.
    
    ================================================================================
    
    * Type your option and press Enter: 2
    
    Extracting Source ISO...
    
    
    7-Zip 19.00 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
    
    Scanning the drive for archives:
    1 folder, 1 file, 4819959808 bytes (4597 MiB)
    
    Extracting archive: Source_ISO\W11\22000.51.210617-2050.CO_RELEASE_SVC_PROD2_CLIENTMULTI_X64FRE_EN-US.ISO
    --
    Path = Source_ISO\W11\22000.51.210617-2050.CO_RELEASE_SVC_PROD2_CLIENTMULTI_X64FRE_EN-US.ISO
    Type = Udf
    Physical Size = 4819959808
    Comment = CCSA_X64FRE_EN-US_DV5
    Cluster Size = 2048
    Created = 2021-06-19 23:23:58
    
    Everything is Ok
    
    Folders: 84
    Files: 933
    Size:       4828472197
    Compressed: 4819959808
    
    
    ============================================================
    Adding Murphy78 Diskpart and Apply Image Script 1.28 To Boot.wim...
    ============================================================
    
    Scanning "murphy78-DiskPart-Apply-v1.2.8\x64\"
    529 KiB scanned (5 files, 4 directories)
    Using LZX compression with 1 thread
    Archiving file data: 529 KiB of 529 KiB (100%) done
    
    ============================================================
    Modding Boot.wim to disable Secure Boot, RAM and TPM 2.0 check...
    ============================================================
    
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Mounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    The operation completed successfully.
    The operation completed successfully.
    The operation completed successfully.
    The operation completed successfully.
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22000.51
    
    [==========================100.0%==========================]
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Saving image
    [==========================100.0%==========================]
    Unmounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    
    ============================================================
    Optimizing boot.wim...
    ============================================================
    
    "WORK\Sources\boot.wim" original size: 436741 KiB
    Using LZX compression with 8 threads
    Archiving file data: 1135 MiB of 1135 MiB (100%) done
    "WORK\Sources\boot.wim" optimized size: 429893 KiB
    Space saved: 6848 KiB
    
    ============================================================
    Replacing the Win 11 appraiserres.dll with one from a 1703 (15063) ISO...
    (The original file will be renamed to appraiserres.dll.bak)
    ============================================================
    
            1 file(s) copied.
    
    =========================================================
    Creating x64 ISO...
    =========================================================
    
    
    
    OSCDIMG 2.56 CD-ROM and DVD-ROM Premastering Utility
    Copyright (C) Microsoft, 1993-2012. All rights reserved.
    Licensed only for producing Microsoft authorized content.
    
    
    Scanning source tree (500 files in 42 directories)
    Scanning source tree complete (934 files in 85 directories)
    
    Computing directory information complete
    
    Image file is 4833673216 bytes (before optimization)
    
    Writing 934 files in 85 directories to Win_11_22000.51_x64_en-US_2021-07-01.iso
    
    100% complete
    
    Storage optimization saved 24 files, 14217216 bytes (1% of image)
    
    After optimization, image file is 4821587968 bytes
    Space saved because of embedding, sparseness or optimization = 14217216
    
    Done.
    Press any key to continue . . .
    
    Code:
    
    ============================================================
    Win 11 Boot & Upgrade FiX KiT v1.7...
    ============================================================
    
    
    ================================================================================
    Select the desired FiX...
    ================================================================================
    
    [ 1 ] - Puts the Win 11 install.wim/esd in a Win 10 ISO (Provide a Win 10 ISO in the "Source_ISO\W10\" Folder)
    This method is usefull for clean installs from boot, using the standard W10 setup. A generic EI.CFG file will
    be copied to the sources folder.
    
    [ 2 ] - Integrate Diskpart & Apply Image script (v1.28), modify boot.wim to skip the SB, RAM and TPM 2.0 check
    and replace "appraiserres.dll" with one from a 1703 ISO
    
    This method enables you to:
    - Use the standard Win 11 setup for clean installs on devices without Secure Boot and TPM 2.0 and low amount of RAM.
    - Use the alternative Diskpart & Apply Image installation script for clean installs.
    - Circumvent "TPM 2.0 is required" error when (inplace) upgrading.
    
    ================================================================================
    
    * Type your option and press Enter: 1
    ============================================================
    Extracting Source ISO...
    ============================================================
    
    7-Zip 19.00 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
    
    Scanning the drive for archives:
    1 folder, 1 file, 6420856832 bytes (6124 MiB)
    
    Extracting archive: Source_ISO\W10\en_windows_10_consumer_editions_version_20h2_updated_jun_2021_x64_dvd_e638972f.iso
    --
    Path = Source_ISO\W10\en_windows_10_consumer_editions_version_20h2_updated_jun_2021_x64_dvd_e638972f.iso
    Type = Udf
    Physical Size = 6420856832
    Comment = CCCOMA_X64FRE_EN-US_DV9
    Cluster Size = 2048
    Created = 2021-06-07 02:00:00
    
    Everything is Ok
    
    Folders: 85
    Files: 904
    Size:       6415433128
    Compressed: 6420856832
    ============================================================
    Deleting W10 install.wim/esd
    ============================================================
    
    
    ============================================================
    Extracting Win 11 install.wim/esd to work dir...
    ============================================================
    
    
    ============================================================
    Copying generic ei.cfg to the work dir...
    ============================================================
    
            1 file(s) copied.
    
    
    =========================================================
    Creating x64 ISO...
    =========================================================
    
    
    
    OSCDIMG 2.56 CD-ROM and DVD-ROM Premastering Utility
    Copyright (C) Microsoft, 1993-2012. All rights reserved.
    Licensed only for producing Microsoft authorized content.
    
    
    Scanning source tree (500 files in 41 directories)
    Scanning source tree complete (905 files in 86 directories)
    
    Computing directory information complete
    
    Image file is 5028151296 bytes (before optimization)
    
    Writing 905 files in 86 directories to Win10_With_22000.51_x64_en-US_install.wim_2021-07-01.iso
    
    100% complete
    
    Storage optimization saved 25 files, 14182400 bytes (1% of image)
    
    After optimization, image file is 5016018944 bytes
    Space saved because of embedding, sparseness or optimization = 14182400
    
    Done.
    Press any key to continue . . .
    
     
  12. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,556
    15,642
    270
    :tooth:
     
  13. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,418
    11,684
    240
    I'm sorry if I got a bit of an attitude there. I've been dealing with some health issues. Please read my post again. I think I got a solution you will like there.
    I appreciate all you've been doing on this board. I want you to know that.
     
  14. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,647
    103,302
    450
  15. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,418
    11,684
    240
    Code:
    if %arch%==x86 (
      set "_wimlib=bin\wimlib-imagex.exe"
      set "xOS=x86"
    ) else (
      set "_wimlib=bin\bin64\wimlib-imagex.exe"
      set "xOS=amd64"
    )
    Short and to the point. I like it. Y'know the system doesn't give a darn how many qualifiers you use for the files. It just cares if it can find the files. I myself have a bad habit of using extra qualifiers like .\
    You could make a ridiculous monstrosity like .\.\.\.\.\.\somefile.txt and it would be the same thing as just using somefile.txt
     
  16. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,647
    103,302
    450
    I just got a few good examples and some plain precoded stuff from (mainly) @abbodi1406 & @Windows_Addict and once i made some connections my very basic coding produced working tools:D

    The %~dp0 i used at the arch query and setting lines once was introduced to fix something on another earlier tool, can't remember now, this time was the first time it caused errors when running the cmd from a path containing spacings.
     
  17. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,418
    11,684
    240
    Well as I discovered, it only seems to cause that problem when the quotes are on both sides of the set command, which would explain why I didn't remember it doing that before either. I can't say I'm in the habit of using quotes on both sides of the set command so I haven't run into issues like this before. I don't really understand the practice. You can't have a spaced variable so it's not like there's any purpose to putting a quote there. Perhaps there is a reason people do it and I'm just not savvy.

    Like with the setlocal EnableDelayedExpansion
    When you try to compare variables you have to use exclamation points like this:
    IF !ERRORTEMP! EQU 3 (goto :EOF)

    If you try it without the exclamation marks, it just doesn't work. There are odd quirks with cmd scripting that I admit I don't fully understand.
     
  18. Do this:
    Code:
    setlocal DisableDelayedExpansion
    set "work=%~dp0"
    if [%work:~-1%]==[\] set "work=%work:~0,-1%"
    setlocal EnableDelayedExpansion
    pushd "!work!"
    
    The script will then work from any path, even something like:
    Code:
    C:\users\Привет\desktop\` ~ ; ' , ! @ % ^ & ( ) [ ] { } + =
    
    I always use this in my scripts and the results are good :D
     
  19. Just a PUSHD will do everything nothing else.
    So many suggestions for only one solution.
     
    the code i posted above also needs to be used if the path has specials chars and non-ascii chars :)