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

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

  1. bonesz

    bonesz MDL Addicted

    Jun 30, 2013
    644
    371
    30
    link are down
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. bonesz

    bonesz MDL Addicted

    Jun 30, 2013
    644
    371
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. KleineZiege

    KleineZiege MDL Expert

    Dec 11, 2018
    1,850
    2,105
    60
    great script, but for people who have no idea, very difficult to understand
     
  4. skonka

    skonka MDL Novice

    Nov 15, 2012
    42
    21
    0
    I used Enthousiast's script when it first launched. Feels like ages ago so now I want to clean install just to try it again with 2.0 because it feels like a milestone version.
     
  5. Mellipes

    Mellipes MDL Senior Member

    Jun 17, 2021
    359
    227
    10
    Dare I say it, If one doesn't understand how to use this great little script, then one shouldn't be playing around with their operating system, and leave "sleeping dogs lie".
     
  6. scaramonga

    scaramonga MDL Senior Member

    Oct 27, 2012
    426
    262
    10
    Simplest thing ever, nothing difficult about it at all.
     
  7. KleineZiege

    KleineZiege MDL Expert

    Dec 11, 2018
    1,850
    2,105
    60
    not for me either *g
     
  8. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,479
    1,474
    60
    #249 rpo, Aug 31, 2021
    Last edited: Aug 31, 2021
    I reworked Enthousiast's script. I you like it, adopt it, if not ...
    Code:
    @setlocal DisableDelayedExpansion
    @echo off
    
    REM change wording if needed..
    TITLE Admin Check...
    echo Checking for admin...
    
    reg query HKU\S-1-5-19 >nul 2>&1 || if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
    
    :gotAdmin
        pushd "%CD%"
        CD /D "%~dp0"
    cls
    
    SET "Version=v2.0"
    TITLE Win 11 Boot ^& Upgrade FiX KiT %version%...
    
    rem 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=bin\wimlib-imagex.exe"
      set "xOS=x86"
    ) else (
      set "_wimlib=bin\bin64\wimlib-imagex.exe"
      set "xOS=amd64"
    )
    
    echo.
    echo ============================================================
    echo Win 11 Boot ^& Upgrade FiX KiT %version%...
    echo ============================================================
    echo.
    echo.
    echo=================================================================================
    ECHO Select the desired FiX...
    echo=================================================================================
    ECHO.
    ECHO [ 1 ] - Puts the Win 11 install.wim/esd in a Win 10 ISO (Provide a Win 10 ISO in the "Source_ISO\W10\" Folder)
    ECHO This method is usefull for clean installs from boot, using the standard W10 setup. A generic EI.CFG file will
    ECHO be copied to the sources folder.
    ECHO.
    ECHO [ 2 ] - Integrate Diskpart ^& Apply Image script ^(v1.3.1^), modify boot.wim to skip the SB, RAM, DiskSize and TPM 2.0 check
    ECHO and replace ^"appraiserres.dll^" with one from a 1703 ISO. A generic EI.CFG file will be copied to the sources folder.
    ECHO.
    ECHO This method enables you to:
    ECHO - Use the standard Win 11 setup for clean installs on devices without Secure Boot and TPM 2.0 and low amount of DiskSize ^& RAM.
    ECHO - Use the alternative Diskpart ^& Apply Image installation script for clean installs.
    ECHO - Circumvent ^"TPM 2.0 is required^" error when ^(inplace^) upgrading.
    ECHO - Enables to install on LegacyBIOS^/MBR only systems.
    ECHO - Circumvents the 64GB ^(52GB^) minimum disk size check.
    ECHO.
    echo=================================================================================
    ECHO.
    CHOICE /C 12 /N /M "* Type your option (1 or 2) ="
    SET "FiX=%ERRORLEVEL%"
    
    if exist "Work" rmdir /q /s "WORK"
    if exist "TEMP" rmdir /q /s "TEMP"
    if not exist "Source_ISO\W11\*.iso" (
    echo.
    ECHO==========================================================
    echo No iso file detected in Source_ISO\W11 dir...
    ECHO==========================================================
    echo.
    goto cleanup
    )
    
    IF /I "%FiX%"=="1" if not exist "Source_ISO\W10\*.iso" (
    echo.
    ECHO==========================================================
    echo No iso file detected in Source_ISO\W10 dir...
    ECHO==========================================================
    echo.
    goto cleanup
    )
    
    mkdir "TEMP"
    for /f %%i in ('dir /b Source_ISO\W11\*.iso') do bin\7z.exe e -y -oTEMP Source_ISO\W11\%%i sources\setup.exe >nul
    bin\7z.exe l .\TEMP\setup.exe >.\TEMP\version.txt 2>&1
    for /f "tokens=4 delims=. " %%i in ('findstr /i /b FileVersion .\TEMP\version.txt') do set vermajor=%%i
    for /f "tokens=4,5 delims=. " %%i in ('findstr /i /b FileVersion .\TEMP\version.txt') do (set majorbuildnr=%%i&set deltabuildnr=%%j)
    
    IF NOT DEFINED vermajor (
    echo.
    ECHO==========================================================
    echo Detecting setup.exe version failed...
    ECHO==========================================================
    echo.
    goto cleanup
    )
    
    SET "Winver="
    
    IF %vermajor% GEQ 19041 SET "Winver=10"
    IF %vermajor% GEQ 21996 SET "Winver=11"
    
    IF NOT DEFINED Winver (
    echo.
    ECHO==========================================================
    echo Unsupported iso version...
    ECHO==========================================================
    echo.
    goto cleanup
    )
    
    IF %vermajor% GEQ 21996 SET "BUILD=22000"
    
    IF NOT DEFINED BUILD (
    echo.
    ECHO==========================================================
    echo Unsupported Win10 build...
    ECHO==========================================================
    echo.
    goto cleanup
    )
    
    If /I "%FiX%"=="2" (
    echo.
    echo ============================================================
    echo Extracting W11 Source ISO...
    echo ============================================================
    echo.
    bin\7z x -y -oWork\ Source_ISO\W11\
    echo.
    
    ) else (
    
    echo ============================================================
    echo Extracting W10 Source ISO... except sources^\install.*
    echo ============================================================
    echo.
    bin\7z x -y -oWork\ Source_ISO\W10\ -x!sources\install.*
    echo.
    echo ============================================================
    echo Extracting Win 11 install.wim^/esd to work dir...
    echo ============================================================
    echo.
    for /f %%i in ('dir /b Source_ISO\W11\*.iso') do bin\7z.exe e -y -oWORK\Sources Source_ISO\W11\%%i sources\install.* >nul
    )
    
    if exist "Work\sources\install.wim" set WIMFILE=INSTALL.WIM
    if exist "Work\sources\install.esd" set WIMFILE=INSTALL.ESD
    
    REM detect wim arch
    
    for /f "tokens=2 delims=: " %%# in ('dism.exe /english /get-wiminfo /wimfile:"Work\sources\%WIMFILE%" /index:1 ^| find /i "Architecture"') do set warch=%%#
    
    for /f "tokens=3 delims=: " %%m in ('dism.exe /english /Get-WimInfo /wimfile:"Work\sources\%WIMFILE%" /Index:1 ^| findstr /i Build') do set b2=%%m
    
    REM detect extracted win11 iso language
    set "IsoLang=ar-SA,bg-BG,cs-CZ,da-DK,de-DE,el-GR,en-GB,en-US,es-ES,es-MX,et-EE,fi-FI,fr-CA,fr-FR,he-IL,hr-HR,hu-HU,it-IT,ja-JP,ko-KR,lt-LT,lv-LV,nb-NO,nl-NL,pl-PL,pt-BR,pt-PT,ro-RO,ru-RU,sk-SK,sl-SI,sr-RS,sv-SE,th-TH,tr-TR,uk-UA,zh-CN,zh-TW"
    for %%i in (%IsoLang%) do if exist "Work\sources\%%i\*.mui" SET "LabelLang=%%i"
    
    echo.
    echo ============================================================
    echo Copying generic ei.cfg to the work dir...
    echo ============================================================
    echo.
    COPY /Y "EI_CFG\EI.CFG" "WORK\Sources\"
    echo.
    
    If /I "%FiX%"=="2" (
    echo.
    echo ============================================================
    echo Adding Murphy78 Diskpart and Apply Image Script 1.3.1 To Boot.wim...
    echo ============================================================
    echo.
    %_wimlib% update Work\sources\boot.wim 2 --command "add 'murphy78-DiskPart-Apply-v1.3.1\%warch%\' '\'"
    echo.
    echo ============================================================
    echo Modding Boot.wim to disable Secure Boot, RAM, DiskSize and TPM 2.0 check...
    echo ============================================================
    echo.
    if exist "TEMP" rmdir /q /s "TEMP"
    
    %_wimlib% extract "WORK\sources\boot.wim" 2 \Windows\System32\config\SYSTEM --no-acls --no-attributes --dest-dir="TEMP"
    
    Reg.exe load HKLM\MDL_Test "TEMP\SYSTEM"
    
    Reg.exe add "HKLM\MDL_Test\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d "1" /f
    Reg.exe add "HKLM\MDL_Test\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d "1" /f
    Reg.exe add "HKLM\MDL_Test\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d "1" /f
    Reg.exe add "HKLM\MDL_Test\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d "1" /f
    Reg.exe unload HKLM\MDL_Test
    
    %_wimlib% update "WORK\sources\boot.wim" 2 --command="add 'TEMP\SYSTEM' '\Windows\System32\config\SYSTEM'"
    
    if exist "TEMP" rmdir /q /s "TEMP"
    
    echo.
    echo ============================================================
    echo Optimizing boot.wim...
    echo ============================================================
    echo.
    %_wimlib% optimize "WORK\Sources\boot.wim" --recompress
    echo.
    echo ============================================================
    echo Replacing the Win 11 appraiserres.dll with one from a 1703 ^(15063^) ISO...
    echo ^(The original file will be renamed to appraiserres.dll.bak^)
    echo ============================================================
    echo.
    ren "WORK\sources\appraiserres.dll" "appraiserres.dll.bak"
    copy /Y "Appraiserress_DLL\appraiserres.dll" "WORK\Sources"
    )
    
    echo.
    ECHO==========================================================
    echo Creating %WARCH% ISO...
    ECHO==========================================================
    echo.
    for /f "tokens=2 delims==." %%# in ('wmic os get localdatetime /value') do set "_date=%%#"
    set "isodate=%_date:~0,4%-%_date:~4,2%-%_date:~6,2%"
    echo.
    for /f "delims=" %%i in ('dir /b Source_ISO\W11\*.iso') do set "isoname=%%i"
    set "isoname=%isoname:~0,-4%_FIXED_%isodate%.ISO"
    If /I "%FiX%"=="1" set "isoname=WIN10_With_%majorbuildnr%.%b2%_%wARCH%_%LabelLang%_%WIMFILE%_%isodate%.ISO"
    
    set "isolabel=Win_%Winver%_%vermajor%_%warch%_%LabelLang%"
    
    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 -l"%isolabel%" work "%isoname%"
    
    :cleanup
    if exist "TEMP" rmdir /q /s "TEMP"
    if exist "Work" rmdir /q /s "WORK"
    popd
    pause
    exit /b
     
  9. Dark Dinosaur

    Dark Dinosaur X Æ A-12

    Feb 2, 2011
    4,158
    5,975
    150
    I Choice your version.
    save me 2KB from my 512GB SSD :p
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,667
    103,475
    450
    So, inserting the win 11 iso into the "Source_ISO\W11\" folder, running the cmd file and selecting "option 2" is to difficult? Maybe quit the schnaps next time;):D
     
  11. kerimcem

    kerimcem MDL Member

    Nov 19, 2007
    194
    63
    10
    thank you,works well.
     
  12. danfozzy85

    danfozzy85 MDL Novice

    Jan 4, 2018
    6
    4
    0
    #253 danfozzy85, Sep 2, 2021
    Last edited: Sep 2, 2021
    Maybe a silly question but quickly clicking through this thread I see nothing mentioning bypassing the processor requirement (my system meets all the other requirements except this one!)

    I'm assuming the kit will help overcome this, which option would be best if so, 1 or 2?
     
  13. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,667
    103,475
    450
    Atm, there is not really a cpu check, considering it can be installed on ancient win vista era core2duo systems (i have no working old amd system, they didn't last that long in the past:D), but when you encounter a block, lemme know:)

    Option one is a noob option, for people insisting to use a win 10 based iso but didn't know how to put the win 11 install.wim/esd into a win 10 iso.

    Option 2 is best to use.
     
  14. danfozzy85

    danfozzy85 MDL Novice

    Jan 4, 2018
    6
    4
    0
    #255 danfozzy85, Sep 2, 2021
    Last edited: Sep 2, 2021
    appreciate the reply, ive gone ahead with option 2 and now have it installed working perfectly, with the exception that its not carried my activation over from windows 10 (i chose a clean install from the advanced options)

    thank you for the help :)
     
  15. okaussie3

    okaussie3 MDL Member

    May 23, 2017
    102
    12
    10
    How does this kit effect belonging to the Dev channel in the Insiders Program? I used option 1 and upgraded my Windows 10 Pro to Windows 11 Pro. Went to the update page and I was told that I no longer belong to the Insiders Program due to my computer does not meet the requirements of Windows 11. They want me to reinstall Windows 10.

    I then used option 1 and did a clean install on another drive and it came up with the same thing.

    Should I have used option 2, or is this issue something unrelated to the kit??

    I am running a ASUS M5A78L-M USB3 MOBO with and AMD Athlon FX 8300 with 8GB RAM and 2 1TB SATA1 Hard drives..

    Both OS's run fine. Just have the issue with the Insider Program.

    TIA

    Bill
     
  16. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,667
    103,475
    450
    For ISO upgrades only.
    Option 1 is not the core of the tool, i will have to hide it for normal use.
     
  17. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,479
    1,474
    60
    #258 rpo, Sep 2, 2021
    Last edited: Sep 4, 2021
    I updated, just for the fun, my previous script to introduce a GUI to let the user select the W10 and W11 ISOs which can be located in every device/folder on te PC. This is for people too lazy to copy the ISOs into the Source_ISO\W10 and Source_ISO\W11 folders.
    Code:
    <# : standard way of doing hybrid batch + powershell scripts
    @echo off
    setlocal DisableDelayedExpansion
    TITLE Admin Check...
    echo Checking for admin...
    reg query HKU\S-1-5-19 >nul 2>&1 || if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) else (
                                        echo Privilege escalation failed.&pause&exit /b)
    rem Got Administrator privileges
    Color 1F 
    SET "Version=2.x"
    TITLE Win 11 Boot ^& Upgrade FiX KiT %version%...
    cls
    echo====================================================================================
    ECHO Select the desired FiX...
    echo====================================================================================
    ECHO.
    ECHO [ 1 ] - This method is usefull for clean installs from boot, using the standard 
    echo         W10 setup. A generic EI.CFG file will be created in the sources folder.
    ECHO.
    ECHO [ 2 ] - Integrate Diskpart ^& Apply Image script ^(v1.3.1^), modify boot.wim to 
    echo         skip the SB, RAM, DiskSize and TPM 2.0 check and replace "appraiserres.dll"
    echo         with one from a 1703 ISO. A generic EI.CFG file will be created in the 
    echo         sources folder.
    ECHO.
    ECHO         This method enables you to:
    ECHO         - Use the standard Win 11 setup for clean installs on devices without 
    echo           Secure Boot and TPM 2.0 and low amount of DiskSize ^& RAM.
    ECHO         - Use the alternative Diskpart ^& Apply Image installation script for 
    echo           clean installs.
    ECHO         - Circumvent "TPM 2.0 is required" error when ^(inplace^) upgrading.
    ECHO         - Enables to install on Legacy BIOS/MBR only systems.
    ECHO         - Circumvents the 64GB ^(52GB^) minimum disk size check.
    ECHO.
    echo====================================================================================
    ECHO.
    CHOICE /C 12 /N /M "* Type your option (1 or 2) =" 
    rem Call PowerShell for the GUI
    powershell -noprofile "$ScriptDir='%~dp0';$FIX='%ERRORLEVEL%';iex ((Get-Content('%~f0')) -join \"`n\")"
    rem Return to cmd
    if not "%errorlevel%"=="0" goto cleanup
    cls
    pushd "%CD%"
    CD /D "%~dp0"
    
    for /f "delims=" %%i in ('type "TEMP\W11"') do set "W11=%%i"
    for /f "delims=" %%i in ('type "TEMP\W10"') do set "W10=%%i"
    
    TITLE Win 11 Boot ^& Upgrade FiX KiT %version%...
    
    rem 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=bin\wimlib-imagex.exe") else (set "_wimlib=bin\bin64\wimlib-imagex.exe")
    
    echo.
    echo ============================================================
    echo Win 11 Boot ^& Upgrade FiX KiT %version%...
    echo ============================================================
    echo.
    
    if exist "WORK" rmdir /q /s "WORK"
    
    bin\7z.exe e -y -oTEMP "%W11%" sources\setup.exe >nul
    bin\7z.exe l .\TEMP\setup.exe >.\TEMP\version 2>&1
    for /f "tokens=4,5 delims=. " %%i in ('findstr /i /b FileVersion .\TEMP\version') do (set vermajor=%%i&set majorbuildnr=%%i&set deltabuildnr=%%j)
    
    IF NOT DEFINED vermajor (
    echo.
    ECHO==========================================================
    echo Detecting setup.exe version failed...
    ECHO==========================================================
    echo.
    goto cleanup
    )
    
    SET "Winver="
    
    IF %vermajor% GEQ 19041 SET "Winver=10"
    IF %vermajor% GEQ 21996 SET ("Winver=11" & SET "BUILD=22000")
    
    IF NOT DEFINED Winver (
    echo.
    ECHO==========================================================
    echo Unsupported iso version...
    ECHO==========================================================
    echo.
    goto cleanup
    )
    
    IF NOT DEFINED BUILD (
    echo.
    ECHO==========================================================
    echo Unsupported Win10 build...
    ECHO==========================================================
    echo.
    goto cleanup
    )
    
    If defined W10 (
    echo ============================================================
    echo Extracting W10 Source ISO... except sources^\install.*
    echo ============================================================
    echo.
    bin\7z x -y -oWORK\ "%W10%" -x!sources\install.*
    echo.
    echo ============================================================
    echo Extracting Win 11 install.wim^/esd to work dir...
    echo ============================================================
    echo.
    bin\7z.exe e -y -oWORK\Sources "%W11%" sources\install.* >nul
    
    ) else (
    
    echo.
    echo ============================================================
    echo Extracting W11 Source ISO... 
    echo ============================================================
    echo.
    bin\7z x -y -oWORK\ "%W11%"
    echo.
    echo.
    echo ============================================================
    echo Adding Murphy78 Diskpart and Apply Image Script 1.3.1 To Boot.wim...
    echo ============================================================
    echo.
    %_wimlib% update WORK\sources\boot.wim 2 --command "add 'murphy78-DiskPart-Apply-v1.3.1\%warch%\' '\'"
    echo.
    echo ============================================================
    echo Modding Boot.wim to disable Secure Boot, RAM, DiskSize and TPM 2.0 check...
    echo ============================================================
    echo.
    if exist "TEMP" rmdir /q /s "TEMP"
    
    %_wimlib% extract "WORK\sources\boot.wim" 2 \Windows\System32\config\SYSTEM --no-acls --no-attributes --dest-dir="TEMP"
    
    Reg.exe load HKLM\MDL_Test "TEMP\SYSTEM"
    Reg.exe add "HKLM\MDL_Test\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d "1" /f
    Reg.exe add "HKLM\MDL_Test\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d "1" /f
    Reg.exe add "HKLM\MDL_Test\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d "1" /f
    Reg.exe add "HKLM\MDL_Test\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d "1" /f
    Reg.exe unload HKLM\MDL_Test
    
    %_wimlib% update "WORK\sources\boot.wim" 2 --command="add 'TEMP\SYSTEM' '\Windows\System32\config\SYSTEM'"
    
    echo.
    echo ============================================================
    echo Optimizing boot.wim...
    echo ============================================================
    echo.
    %_wimlib% optimize "WORK\Sources\boot.wim" --recompress
    echo.
    echo ============================================================
    echo Replacing the Win 11 appraiserres.dll with one from a 1703 ^(15063^) ISO...
    echo ^(The original file will be renamed to appraiserres.dll.bak^)
    echo ============================================================
    echo.
    ren "WORK\sources\appraiserres.dll" "appraiserres.dll.bak"
    copy /Y "Appraiserress_DLL\appraiserres.dll" "WORK\Sources"
    )
    
    if exist "Work\sources\install.wim" set WIMFILE=INSTALL.WIM
    if exist "Work\sources\install.esd" set WIMFILE=INSTALL.ESD
    
    REM detect wim arch
    
    for /f "tokens=2 delims=: " %%# in ('dism.exe /english /get-wiminfo /wimfile:"Work\sources\%WIMFILE%" /index:1 ^| find /i "Architecture"') do set warch=%%#
    
    for /f "tokens=3 delims=: " %%m in ('dism.exe /english /Get-WimInfo /wimfile:"Work\sources\%WIMFILE%" /Index:1 ^| findstr /i Build') do set b2=%%m
    
    REM detect extracted win11 iso language
    set "IsoLang=ar-SA,bg-BG,cs-CZ,da-DK,de-DE,el-GR,en-GB,en-US,es-ES,es-MX,et-EE,fi-FI,fr-CA,fr-FR,he-IL,hr-HR,hu-HU,it-IT,ja-JP,ko-KR,lt-LT,lv-LV,nb-NO,nl-NL,pl-PL,pt-BR,pt-PT,ro-RO,ru-RU,sk-SK,sl-SI,sr-RS,sv-SE,th-TH,tr-TR,uk-UA,zh-CN,zh-TW"
    for %%i in (%IsoLang%) do if exist "Work\sources\%%i\*.mui" SET "LabelLang=%%i"
    
    echo.
    echo ============================================================
    echo Creating generic ei.cfg to the work dir...
    echo ============================================================
    echo.
    (
    echo [Channel]
    echo _Default
    echo [VL]
    echo 0
    )>"WORK\Sources\EI.CFG"
    
    echo.
    ECHO==========================================================
    echo Creating %WARCH% ISO...
    ECHO==========================================================
    echo.
    for /f "tokens=2 delims==." %%# in ('wmic os get localdatetime /value') do set "_date=%%#"
    set "isodate=%_date:~0,4%-%_date:~4,2%-%_date:~6,2%"
    echo.
    
    If defined W10 (set "isoname=WIN10_With_%majorbuildnr%.%b2%_%wARCH%_%LabelLang%_%WIMFILE%_%isodate%.ISO") else (
    setlocal EnableDelayedExpansion
    for /f "delims=" %%i in ('dir /b "%W11%"') do set "isoname=%%i"
    set "isoname=!isoname:~0,-4!_FIXED_%isodate%.ISO"
    setlocal DisableDelayedExpansion)
    
    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 -l"Win_%Winver%_%vermajor%_%warch%_%LabelLang%" work "%isoname%"
    
    :cleanup
    if exist "TEMP" rmdir /q /s "TEMP"
    if exist "Work" rmdir /q /s "WORK"
    popd
    pause
    exit /b
    #>
    $ScriptDir=$ScriptDir.TrimEnd("\") # remove trailing \
    $pswindow = $host.ui.rawui          # create a reference to the console’s UI.RawUI child object
    $pswindow.foregroundcolor = "Yellow";$pswindow.backgroundcolor = "Blue"
    $pswindow.windowtitle = ([string]($pswindow.windowtitle -split "^.*  ")).trim() ; $Title=$pswindow.windowtitle
    #
    Add-Type -AssemblyName System.Windows.Forms # Load the class System.Windows.Forms
    #
    # Filebrowser dialog object
    $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
        Multiselect = $false # One file can be chosen
        Filter = 'ISO images (*.iso)|*.iso' # Select only iso files
    }
    #
    clear-host
    if ($FIX -eq 2){$CreateISO=1} else {$CreateISO=0}
    
    $Form=New-Object System.Windows.Forms.Form # Create the screen form (window)
    $Form.TopMost = $True
    $Form.Text=$Title
    $Form.Width=560 ; $Form.Height=250
    $Form.StartPosition = "CenterScreen"
    $Form.ControlBox=$False
    $Form.SizeGripStyle = "Hide"
    [System.Windows.Forms.Application]::EnableVisualStyles();
    
    $W10Image=New-Object System.Windows.Forms.Label # Put the ISO Image label on the form
    $W10Image.Location=New-Object System.Drawing.Point(20,20)
    $W10Image.Font='Default Font,9'
    $W10Image.Size=New-Object System.Drawing.Size(350,20)
    $W10Image.text="Windows 10 ISO Image"
    $Form.Controls.Add($W10Image)
    
    $W10File=New-Object System.Windows.Forms.Label # Put the ISO file name on the form
    $W10File.Location=New-Object System.Drawing.Point(20,40)
    if ($FIX -eq 2){$W10File.Text="*** Not applicable ***"} else {$W10File.Text=" "}
    $W10File.Font='Consolas,10'
    $W10File.Size=New-Object System.Drawing.Size(505,23)
    $W10File.Backcolor = [System.Drawing.Color]::White
    $W10File.BorderStyle = [System.Windows.Forms.BorderStyle]::FixedSingle
    $Form.Controls.Add($W10File)
    
    $SelectW10Button=New-Object System.Windows.Forms.Button # Put the Select ISO button on the form
    $SelectW10Button.Location=New-Object System.Drawing.Point(155,170)
    $SelectW10Button.Text="Select W10"
    $SelectW10Button.Font='Default Font,9'
    $SelectW10Button.Size=New-Object System.Drawing.Size(100,26)
    if ($FIX -eq 2){$SelectW10Button.Enabled = $false}
    $Form.Controls.Add($SelectW10Button)
    
    $W11Image=New-Object System.Windows.Forms.Label # Put the ISO Image label on the form
    $W11Image.Location=New-Object System.Drawing.Point(20,90)
    $W11Image.Font='Default Font,9'
    $W11Image.Size=New-Object System.Drawing.Size(350,20)
    $W11Image.text="Windows 11 ISO Image"
    $Form.Controls.Add($W11Image)
    
    $W11File=New-Object System.Windows.Forms.Label # Put the ISO file name on the form
    $W11File.Location=New-Object System.Drawing.Point(20,110)
    $W11File.Text=" "
    $W11File.Font='Consolas,10'
    $W11File.Size=New-Object System.Drawing.Size(505,23)
    $W11File.Backcolor = [System.Drawing.Color]::White
    $W11File.BorderStyle = [System.Windows.Forms.BorderStyle]::FixedSingle
    $Form.Controls.Add($W11File)
    
    $SelectW11Button=New-Object System.Windows.Forms.Button # Put the Select ISO button on the form
    $SelectW11Button.Location=New-Object System.Drawing.Point(285,170)
    $SelectW11Button.Text="Select W11"
    $SelectW11Button.Font='Default Font,9'
    $SelectW11Button.Size=New-Object System.Drawing.Size(100,26)
    $Form.Controls.Add($SelectW11Button)
    
    $CancelButton=New-Object System.Windows.Forms.Button # Put the Cancel button on the form
    $CancelButton.Location=New-Object System.Drawing.Point(425,170)
    $CancelButton.Text="Cancel"
    $CancelButton.Font='Default Font,9'
    $CancelButton.Size=New-Object System.Drawing.Size(100,26)
    $Form.Controls.Add($CancelButton)
    $CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
    
    $CreateISOButton=New-Object System.Windows.Forms.Button # Put the Create Disk button on the form
    $CreateISOButton.Location=New-Object System.Drawing.Point(20,170)
    $CreateISOButton.Text="Create ISO"
    $CreateISOButton.Font='Default Font,9'
    $CreateISOButton.Size=New-Object System.Drawing.Size(100,26)
    $Form.Controls.Add($CreateISOButton)
    $CreateISOButton.Enabled = $false
    $CreateISOButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
    
    $SelectW10Button.Add_Click({
        If ($FileBrowser.ShowDialog() -ne "Cancel"){ # if Cancel, just ignore
            $Global:Image10Path = $FileBrowser.filename    # return the file name
            $W10File.Text= Split-Path -Path $Image10Path -leaf # extract filename and extension (iso)
            if (($W10File.Text).length -gt 62) {$W10File.Text = $Image10Path.PadRight(100," ").substring(0,62)+"..."}
            $Global:CreateISO=$Global:CreateISO -bor 1
            if ($Global:CreateISO -eq 3) {$CreateISOButton.Enabled = $true
            $CreateISOButton.Focus()}
            }})
           
    $SelectW11Button.Add_Click({
        If ($FileBrowser.ShowDialog() -ne "Cancel"){ # if Cancel, just ignore
            $Global:Image11Path = $FileBrowser.filename    # return the file name
            $W11File.Text= Split-Path -Path $Image11Path -leaf # extract filename and extension (iso)
            if (($W11File.Text).length -gt 62) {$W11File.Text = $Image11Path.PadRight(100," ").substring(0,62)+"..."}
            $Global:CreateISO=$Global:CreateISO -bor 2       
            if ($Global:CreateISO -eq 3) {$CreateISOButton.Enabled = $true
            $CreateISOButton.Focus()}
            }})
    
    #
    if($form.ShowDialog() -eq "Cancel") {[Environment]::Exit(1)}
    
    $TEMP="$ScriptDir\TEMP"
    remove-item "$TEMP" -Recurse -force -ErrorAction SilentlyContinue
    new-item "$TEMP" -ItemType "directory"
    #
    "$Image11Path" | out-file "$TEMP\W11"
    "$Image10Path" | out-file "$TEMP\W10"
    
    
     
  18. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,667
    103,475
    450
    #259 Enthousiast, Sep 2, 2021
    Last edited: Sep 2, 2021
    (OP)
    Replacing the appraiserres.dll in "C:\$WINDOWS$.~BT
    I was about to adopt your previous improvement (wasn't that big of a difference) but i can't maintain and support my tool when it's coded at a level i am not at:(

    EDIT: i will take a look at it asap.
     
  19. [Racer-X]

    [Racer-X] MDL Novice

    Oct 26, 2009
    4
    0
    0