[TOOL] XP2ESD - Create modern Windows XP installer v1.6.2

Discussion in 'Windows XP / Older OS' started by George King, Jan 8, 2021.

  1. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,003
    2,923
    150
  2. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,454
    60
    Again showing GUI, show me how you list disk and partitions and related informations in console not in GUI.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,454
    60
    #2943 George King, Jan 29, 2024
    Last edited: Jan 29, 2024
    (OP)
    How you get correct physical disk and partition number when diskpart uses it's own logical counting?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    326
    159
    10
    #2944 Gelip, Jan 29, 2024
    Last edited: Jan 29, 2024
    Script displays disks and asks about the disk number on which to install:
    Code:
    ...
    REM Make partitions, format & assign letters U: EFI 100MB FAT32
    diskpart /s diskprep1.txt
    echo:
    set /p disk=Please enter the disk number (q to discard):
    if %disk%==q cmd /k
    set /p part=Please enter the size of the OS partition in MB (min. 2100):
    diskpart /s diskprep2.txt
    
    REM Search CD\DVD\USB drive letter and set in %drive% variable
    for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist "%%i:\sources\*.wim" set drive=%%i:
    
    REM Copy EFI folder from %drive%\sources to EFI partition
    xcopy %drive%\sources\EFI U:\EFI /e /h /c /i
    ...

    diskprep1.txt
    Code:
    list disk

    diskprep2.txt
    Code:
    sel disk %disk%
    clean
    convert gpt
    create par efi size=100
    format fs=fat32 label="EFI"
    assign letter u
    create par pri size=%part%
    format fs=ntfs quick label="OS"
    assign letter c
    create par pri
    format fs=ntfs quick label="Data"
    

    I have a simple scenario - the user chooses the disk and the size of the partition on which WinXP wants to install. The WinXP or Win10 installer also displays a window with disks where you can choose a disk, partition or divide it again:
    disks.png

    I don't understand what you want to automate?
     
  5. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,454
    60
    #2945 George King, Jan 29, 2024
    Last edited: Jan 29, 2024
    (OP)
    @Gelip Thats not automated solution. Manually you can do always anything.

    And handling EFI partition or bootloader is not issue. When is used winload thats different mapping story in BCD than boot.ini
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    326
    159
    10
    OK, but I still do not understand what it needed for ??? What scenario do you assume?

    I understand only 2 scenarios:

    1. WinXP installation on one clean disk
    2. The user has a PC with factory-installed Win10 on the GPT disk - so there are ESP, MSR, OS and Recovery partitions
    • To install XP, you must first separate the space on the disk
    • If the partition with the Win10 (OS) system is not the last on the disk, it cannot be done in an easy way and you need to use specialized tools
    • If the partition Win10 (OS) is last on the disk, you can easily reduce it with diskpart with shrink desired= command
    • Now you can install WinXP in this separate area and then you do not need to create an ESP partition, only edit BCD on an existing ESP partition
     
  7. Seven4ever

    Seven4ever MDL Member

    May 16, 2023
    102
    41
    10
  8. Seven4ever

    Seven4ever MDL Member

    May 16, 2023
    102
    41
    10
    + scenario 3 : Replacing an existing partition. Similar to 2 plus delete partition / BCD entry option
     
  9. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    326
    159
    10
    #2949 Gelip, Jan 29, 2024
    Last edited: Jan 29, 2024
    deleted
     
  10. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,454
    60
    #2950 George King, Jan 30, 2024
    Last edited: Jan 30, 2024
    (OP)
    Because I have no time to burn it with ListDisk development. I will use it for listing only for now to achieve needed result. Polishing with used tools can be done later as usual.

    DISKPART - Physical disk numbers are OK, partition numbers are logical - unusable for building boot.ini
    BOOTICE - Physical disk numbers are OK, partitions numbers starts from 0 instead of 1. Not sure if it's physical. Seems physical just started from 0
    LISTDISK - Physical disk numbers are OK, partitions numbers are physical too - usable for building boot.ini

    Anyway my goal should be doable to cover all wanted scenarios now.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. UsefulAGKHelper

    UsefulAGKHelper MDL Senior Member

    Aug 28, 2021
    384
    237
    10
    That's great news!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. user469

    user469 MDL Member

    Oct 23, 2015
    128
    14
    10
    Pardon me so in new version you dont need to a clean install on a new disk but you can choose on wich partition install XP and of course make it bootable ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,454
    60
    That will be possible in future If you mean deploying from already installed system. For now it means we can get rid of needed partition number selection in POWIS. And also this means limit to be installed in first partition is gone. Now it should be on any disk and any partition.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    326
    159
    10
    #2954 Gelip, Feb 1, 2024
    Last edited: Feb 1, 2024
    @George King
    I'm trying to use ListDisk to find the EFI partition but I am not doing something:
    Code:
    @ECHO OFF
    
    REM Find the USB drive on which the needed files are
    for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist "%%a:\listdisk.exe" set drive=%%a:
    
    %drive%\listdisk
    for /f "tokens=6 delims= " %%p in ('echo listdisk ^| find "EFI System"') do set efi=%%p
    echo:
    echo EFI partition is %efi%
    echo:
    pause
    
    find_EFI.png
    P.S. Please fix ListDisk because data still not fit in WinPE window e.g. change Partition to Par or/and remove character | from table as diskpart displays:
    diskpart_fit_cmd_window.png
     
  15. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,454
    60
    @Gelip Just change default console settings width do 95. Table view is there for a reason to be able to parse output in scripts easily.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    326
    159
    10
    Unnecessary additional clicks :(
    It is not easier at all - diskpart displays the data very nicely without any characters and it is easier to search e.g.
    for /f "tokens= delims=
     
  17. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,003
    2,923
    150
    #2957 acer-5100, Feb 1, 2024
    Last edited: Feb 1, 2024
    No need to fight with the incredibly dumb pre W10 consolle

    ConEmu is a must have (also in W10 W11)

    upload_2024-2-1_17-22-1.png

    You get normal copy and paste (via CTRL+C/CTRL+V), tabs, dynamically resizable consolle, a ton of personalizations, and another huge list of features

    Optionally (but strongly suggested) you can also install the tiny Clink, and you get also the Bash like persistent history (invaluable IMO)

    AFAIR the last ConEmu version Working in Windows 5.1/5.2 is 180626, the last Clink working is 0.4.8

    @George King

    I tested listdisk on a stock Server 2003R2 it complains about missing msvcp140.dll (so VC 2015 I guess, which isn't officially supported in XP/2003).

    I ask myself, given it's aimed mainly to XP and is compiled from scratch, is 2015 really needed, wouldn't better to compile it with an older VC and make it working even on a freshly installed XP (plus a supported VC runtime)?
     
  18. George King

    George King MDL Expert

    Aug 5, 2009
    1,961
    2,454
    60
    @acer-5100 Yes, You need latest Visual C++ repack installed for listdisk. Yes, I this case I have downloaded Visual Studio 2010 Professional + SP1 + All updates from catalog. I would like to try it in future. But I quess there will be code compatibility issues.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. acer-5100

    acer-5100 MDL Guru

    Dec 8, 2018
    4,003
    2,923
    150
  20. Gelip

    Gelip MDL Senior Member

    Feb 28, 2011
    326
    159
    10
    @George King
    Your tool not mount EFI partition:
    Code:
    | Disk 1 | Partition 1 | GPT   |  100.00 MB | EFI System    | FAT32  |     | EFI              |
    | Disk 1 | Partition 2 | GPT   |   10.00 GB | Basic Data    | NTFS   | G:  | OS               |
    | Disk 1 | Partition 3 | GPT   |   29.90 GB | Basic Data    | NTFS   | Z:  | Data             |
    
    EFI partition on disk 1 is 1
    
    Volume not found for Disk 1, Partition 1
    Failed to mount Disk 1, Partition 1
    Press any key to continue . . .
    
    Code:
    @ECHO OFF
    
    REM Find the USB drive on which the needed files are
    for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist "%%a:\listdisk.exe" set drive=%%a:
    
    %drive%\listdisk
    for /f "tokens=3 delims= " %%p in ('%drive%\listdisk ^| find "EFI System"') do set disk=%%p
    for /f "tokens=6 delims= " %%p in ('%drive%\listdisk ^| find "EFI System"') do set par=%%p
    echo:
    echo EFI partition on disk %disk% is %par%
    echo:
    %drive%\listdisk /mount %disk% %par% U
    pause