murphy78 DiskPart and Apply Image Script

Discussion in 'Scripting' started by murphy78, Apr 2, 2014.

  1. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,404
    11,646
    240
  2. Bira

    Bira MDL Senior Member

    Oct 4, 2017
    261
    151
    10
    Hi Murphy78, how are you?
    doing here some identities in your script in my language I saw that, I do not know can be mistaken my, in these parts

    Code:
    :IMG64
    FOR %%i IN (Z Y X W V U T S R Q P O N M L K J I H G F E D C B A) DO (IF EXIST "%%i:\x64\Sources\install.wim" SET INSTALLIMAGE="%%i:\x64\Sources\install.wim"&GOTO :SETUPCHECK)
    FOR %%i IN (Z Y X W V U T S R Q P O N M L K J I H G F E D C B A) DO (IF EXIST "%%i:\x64\Sources\install.esd" SET INSTALLIMAGE="%%i:\x64\Sources\install.esd"&GOTO :SETUPCHECK)
    FOR %%i IN (Z Y X W V U T S R Q P O N M L K J I H G F E D C B A) DO (IF EXIST "%%i:\x64\Sources\install.swm" SET INSTALLIMAGE="%%i:\x64\Sources\install.swm"&SET SPLIT=1&SET SPLITPATTERN="%%i:\x86\Sources\install*.swm"&GOTO :SETUPCHECK)
    
    where I optimize in my
    
    :IMG64
    FOR %%i IN (Z Y X W V U T S R Q P O N M L K J I H G F E D C B A) DO (
        for %%j in (
            wim
            esd
            swm
        ) do (
            IF EXIST "%%i:\x64\Sources\install.%%j" (
                IF "%%j" equ "swm" (
                    SET INSTALLIMAGE="%%i:\x64\Sources\install.swm"
                    SET SPLIT=1
                    SPLITPATTERN="%%i:\x64\Sources\install*.swm"
                    GOTO :SETUPCHECK
                )
                SET INSTALLIMAGE="%%i:\x64\Sources\install.%%j"
                GOTO :SETUPCHECK
            )
        )
    )
    GOTO :SETUPCHECK
    
    and here another mistake
    
    :RUNDPEXISTING
    DISKPART /S X:\DISKPART.TXT
    SET ERRORTEMP=!ERRORLEVEL!
    IF !ERRORLEVEL! NEQ 0 (
    ECHO.
    ECHO THERE WERE ERRORS FORMATTING THE PARTITION
    ECHO.
    PAUSE
    GOTO :MAINMENU
    )
    GOTO :IMAGESELECTION
    )
    
    Where else do you get in mine, can you have one) more or not?
    
    :RUNDPEXISTING
    DISKPART /S X:\DISKPART.TXT
    SET ERRORTEMP=!ERRORLEVEL!
    
    IF !ERRORLEVEL! NEQ 0 (
        ECHO.
        ECHO THERE WERE ERRORS FORMATTING THE PARTITION
        ECHO.
        PAUSE
        GOTO :MAINMENU
    )
    GOTO :IMAGESELECTION
     
  3. DioNZB

    DioNZB MDL Member

    Jun 23, 2013
    238
    419
    10
    All the download links are down, Can someone provide me with a new one
    Thanks in advance
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    48,939
    100,695
    450
    Abandoned.
     
  5. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    48,939
    100,695
    450
  6. haz367

    haz367 MDL Addicted

    Jan 11, 2020
    804
    1,462
    30
    #267 haz367, Apr 27, 2023
    Last edited: May 2, 2023
    Excuse me for being a jerk for a min...

    Keep up the good work everybody :)
     
  7. haz367

    haz367 MDL Addicted

    Jan 11, 2020
    804
    1,462
    30
    @murphy78

    You lurker...pls fix the good work.
     
  8. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,404
    11,646
    240
    Sorry about that. Re-uploaded the 3 files in the OP to mirror creator. They should be working again.
     
  9. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    48,939
    100,695
    450
    Did you fix the scripts too?

    ISO with install,esd (your currently uploaded version):

    Code:
    ============================================================
    Add Muprhy78 Diskpart and Apply Image script to boot.wim
    originally by Enthousiast v1.2...
    ============================================================
    
    An alternate winpeshl.ini can auto-run the diskpart/apply image script
    Would you like to replace the file in setup media?
    Y/N or Q to quit N
    
    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, 3558719488 bytes (3394 MiB)
    
    Extracting archive: Source_ISO\25352.1.230422-2250.ZN_RELEASE_CLIENTPRO_OEMRET_X64FRE_EN-US_ESD_2023_05_02.ISO
    --
    Path = Source_ISO\25352.1.230422-2250.ZN_RELEASE_CLIENTPRO_OEMRET_X64FRE_EN-US_ESD_2023_05_02.ISO
    Type = Udf
    Physical Size = 3558719488
    Comment = Win_10_x64_en-US
    Cluster Size = 2048
    Created = 2023-05-03 02:00:00
    
    Everything is Ok
    
    Folders: 84
    Files: 950
    Size:       3567152752
    Compressed: 3558719488
    This script only supports install.wim and install.esd format
    Structure must be sources\install.wim or x64\sources\install.wim
    Press any key to continue . . .
    This has been discussed here (a few posts up and down):
    https://forums.mydigitallife.net/threads/win-11-boot-and-upgrade-fix-kit.83724/page-50#post-1767560
     
  10. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,404
    11,646
    240
    Been a while, but didn't you ask me to fix this for v1.3.1 and I did?
    This is what I have posted on the releaselog:
    "1.3.1 Added Media Creation Tool style x86/x64 $oem$ folder copying that would detect the architecture of the install applied and seek the appropriate $oem$ subfolder to copy
    Re-worked the add diskpart apply image script to be in line with the support for the default and dual boot format
    Added esd and split wim support for the add diskpart apply image script for the line that used to detect information from the install.wim
    Minor other tinkerings not worth mentioning, mostly wording or spacing issues"

    I never really intended on replacing your hard work for the win11 fix. I just was trying to get something going at first. IIRC there was some reason why everything was set to wim at first on those old scripts, though I don't remember why that is.
     
  11. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    48,939
    100,695
    450
    #272 Enthousiast, May 4, 2023
    Last edited: May 4, 2023
    That was for the MCT like x86/64 ISO structure ate the running of the script during setup, seems now it doesn't support single install.esd anymore when inserting the script.
     
  12. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,404
    11,646
    240
    I'm a bit confused. Did you just replace the files from my 1.3.1 version into the shoddy win11 v1.2 thing I made? If you did, it doesn't work that way. I never added esd support for that script. I added esd support for my 1.3.1 installer script.
     
  13. KleineZiege

    KleineZiege MDL Expert

    Dec 11, 2018
    1,780
    2,009
    60
    you are awesome, the script is so good,
    Thank you very much.
     
  14. fabricio simoes

    fabricio simoes MDL Member

    Dec 17, 2020
    110
    21
    10

    Can anyone help me put diskpart to start as written.
    Recently @Enthousiast made a script installer and I've modified his first version:
    So now you can run add-Diskpart_Apply_Image_Tool_murphy78_custom_v1.1.cmd with an
    iso in the source_iso folder and it will spit out an already integrated diskpart/apply image iso
    The script gives you a choice to include a winpeshl.ini which will start the script automatically
    If you choose that option you can still choose to exit the script when running the setup media.
    It will just run the setup program after exiting. Instead of the characteristic blue setup screen,
    it will be white to denote that it is not running a normal setup routine. This is MS's way of telling
    people that it has ran an abnormal startup routine for setup. There is no other alteration to setup.
     
  15. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,404
    11,646
    240
    It's been quite a while since I've tinkered with the custom version. Using winpeshl.ini to automatically launch menu.cmd (The main diskpart/setup script)
    is certainly possible and it's what I used to do on my super-aio releases because normal setup is only meant for the specific OS version that the SKUs ship with.
    Obviously a diskpart/setup script was preferable in that situation because you wouldn't want mismatched recovery information, winre.wim partition sizes, etc.

    As far as the actual winpeshl.ini, it's just:
    Code:
    [LaunchApps]
    %WINDIR%\system32\winpeinit.exe
    %WINDIR%\system32\menu.cmd
    %SYSTEMDRIVE%\sources\setup.exe
    
    I changed things in 1.3.1 which is different from the v1.1 custom that comes with diskpart/apply v1.3.0 (The v1.1 custom was meant to apply to win11 stuff that @Enthousiast was working on) It meant to help with something. I forget exactly what off the top of my head.
    The diskpart/apply changelog for v1.3.1 is:
    1.3.1 Added Media Creation Tool style x86/x64 $oem$ folder copying that would detect the architecture of the install applied and seek the appropriate $oem$ subfolder to copy
    Re-worked the add diskpart apply image script to be in line with the support for the default and dual boot format
    Added esd and split wim support for the add diskpart apply image script for the line that used to detect information from the install.wim
    Minor other tinkerings not worth mentioning, mostly wording or spacing issues
     
  16. fabricio simoes

    fabricio simoes MDL Member

    Dec 17, 2020
    110
    21
    10

    I don't know how to change, this version is no longer available for download, I'm using the one from @Enthousiast but I wanted it to start disk part automatically?
    In which folder do I place this code created winpeshl.ini file?
     
  17. fabricio simoes

    fabricio simoes MDL Member

    Dec 17, 2020
    110
    21
    10
  18. fabricio simoes

    fabricio simoes MDL Member

    Dec 17, 2020
    110
    21
    10
    I'm just having a problem as my xml is in the root of the iso, it keeps asking Microsoft for an account, I can't get around it, maybe there was a specific place to put this xml, to use diskpart...?