Building the most up-to-date Windows Vista ISO

Discussion in 'Windows Vista' started by TigTex, Feb 13, 2018.

  1. TigTex

    TigTex MDL Senior Member

    Oct 5, 2009
    474
    379
    10
    Right now I have a script that looks more or less like this and works

    Code:
    REM Check if ISO is present
    if not exist "%~dp0DVD\sources\install.wim" (
      ECHO.
      ECHO ================================================================
      ECHO                   Install media not found
      ECHO         Please extract Windows Vista ISO to DVD folder
      ECHO ================================================================
      ECHO.
      PAUSE >NUL
      goto end
    )
    
    REM GET Number of Windows editions inside ISO image
    set ImageStart=1
    for /f "tokens=2 delims=: " %%i in ('start "" /b dism /English /Get-WimInfo /WimFile:"%~dp0DVD\sources\install.wim" ^| findstr /i Index') do (set ImageCount=%%i)
    
    REM GET CPU architecture of Windows ISO
    for /f "tokens=2 delims=: " %%a in ('start "" /b dism /English /Get-WimInfo /WimFile:"%~dp0DVD\sources\install.wim" /Index:%ImageStart% ^| findstr /i Architecture') do (set ImageArchitecture=%%a)
    set PackagesArchitecture=amd64
    if "%ImageArchitecture%"=="x86" set PackagesArchitecture=x86
    
    REM GET Language of Windows ISO
    for /f "tokens=1 delims= " %%a in ('start "" /b dism /English /Get-WimInfo /WimFile:"%~dp0DVD\sources\install.wim" /Index:%ImageStart% ^| findstr /i "(Default)"') do (set ImageLanguage=%%a)
    for /f "tokens=1 delims= " %%a in ('echo %ImageLanguage%') do (set ImageLanguage=%%a)
    
    REM Check if Windows images are valid
    set checkErrors=0
    for /L %%i in (%ImageStart%, 1, %ImageCount%) do (
     dism /English /Get-WimInfo /WimFile:"%~dp0DVD\sources\install.wim" /Index:%%i | findstr /i Architecture | findstr /i "%ImageArchitecture%" >nul 2>&1
     if ERRORLEVEL 1 set checkErrors=1
     dism /English /Get-WimInfo /WimFile:"%~dp0DVD\sources\install.wim" /Index:%%i | find /i "Name :" | find /i "Windows Vista" >nul 2>&1
     if ERRORLEVEL 1 set checkErrors=1
     dism /English /Get-WimInfo /WimFile:"%~dp0DVD\sources\install.wim" /Index:%%i | findstr /i "(Default)" | findstr /i "%ImageLanguage%" >nul 2>&1
     if ERRORLEVEL 1 set checkErrors=1
    )
    
    if not "%checkErrors%"=="0" (
     ECHO.
     ECHO ================================================================
     ECHO                     Something is wrong!
     ECHO    This script requires clean original Windows Vista images!
     ECHO ================================================================
     ECHO.
     PAUSE >NUL
     goto end
    )
    
    setlocal ENABLEDELAYEDEXPANSION
    ECHO.
    ECHO ================================================================
    ECHO Found the following images:
    set ImageIndexes=
    for /L %%i in (%ImageStart%, 1, %ImageCount%) do (
     set "ImageIndexes=!ImageIndexes!%%i"
     ECHO.
     ECHO Index: %%i
     dism /English /Get-WimInfo /WimFile:"%~dp0DVD\sources\install.wim" /Index:%%i | find /i "Name :"
     ECHO Architecture: %ImageArchitecture%
     ECHO Language: %ImageLanguage%
    )
    ECHO.
    ECHO ================================================================
    
    if "%ImageStart%"=="%ImageCount%" goto skipSelectImage
    
    CHOICE /C A%ImageIndexes% /M "Choose image index (A = All)"
    set /a ImageIndex=%ERRORLEVEL%-1
    
    if %ImageIndex% GEQ 1 (
     if not "%ImageStart%"=="%ImageCount%" (
      ECHO.
      dism /Export-Image /SourceImageFile:"%~dp0DVD\sources\install.wim" /SourceIndex:%ImageIndex% /DestinationImageFile:"%~dp0DVD\sources\install_index_%ImageIndex%.wim" /CheckIntegrity
      move /y "%~dp0DVD\sources\install_index_%ImageIndex%.wim" "%~dp0DVD\sources\install.wim" >nul 2>&1
      ECHO.
      SET ImageStart=1
      SET ImageCount=1
     )
    )
    
    :skipSelectImage
    
    REM Mount image
    for /L %%i in (%ImageStart%, 1, %ImageCount%) do (
     ECHO.
     ECHO ================================================================
     ECHO Mounting image with index %%i
     ECHO Mount directory: %~dp0mount\%%i
     dism /English /Get-WimInfo /WimFile:"%~dp0DVD\sources\install.wim" /Index:%%i | find /i "Name :"
     ECHO ================================================================
    
     rd /s/q "%~dp0mount\%%i" >NUL 2>&1
     mkdir "%~dp0mount\%%i" >NUL 2>&1
     dism /Mount-Wim /WimFile:"%~dp0DVD\sources\install.wim" /index:%%i /MountDir:"%~dp0mount\%%i"
    )
    
    REM Apply UEFI fix to DVD by getting bootmgr from mounted point
    if "%ImageArchitecture%"=="x64" (
     if exist "%~dp0mount\%%i\Windows\Boot\EFI\bootmgfw.efi" (
      mkdir "%~dp0DVD\efi\boot" >nul 2>&1
      copy /b /y "%~dp0mount\%%i\Windows\Boot\EFI\bootmgfw.efi" "%~dp0DVD\efi\boot\bootx64.efi" >nul 2>&1
     )
    )
    
    ECHO.
    ECHO ================================================================
    ECHO Downloading missing Windows Updates...
    ECHO ================================================================
    ECHO.
    
    type "%~dp0hotfixes\hfixes_all.txt" | find /i "%ImageArchitecture%" > "%~dp0hotfixes\hfixes_%ImageArchitecture%.txt"
    type "%~dp0hotfixes\ie9_all.txt" | find /i "%ImageArchitecture%" | find /i "%ImageLanguage%" > "%~dp0hotfixes\ie9_%ImageArchitecture%_%ImageLanguage%.txt"
    cd /d "%~dp0hotfixes"
    
    FOR /F "eol=; tokens=1,2*" %%i in (hfixes_%ImageArchitecture%.txt) do if not exist "%~dp0hotfixes\%%i" "%~dp0tools\wget.exe" -q --show-progress --no-hsts --no-check-certificate -O "%%i" "%%j"
    FOR /F "eol=; tokens=1,2*" %%i in (ie9_%ImageArchitecture%_%ImageLanguage%.txt) do if not exist "%~dp0hotfixes\%%i" "%~dp0tools\wget.exe" -q --show-progress --no-hsts --no-check-certificate -O "%%i" "%%j"
    
    cd /d "%~dp0"
    del /q /f "%~dp0hotfixes\hfixes_%ImageArchitecture%.txt" >nul 2>&1
    del /q /f "%~dp0hotfixes\ie9_%ImageArchitecture%_%ImageLanguage%.txt" >nul 2>&1
    
    ECHO.
    ECHO Done.
    
    for /L %%i in (%ImageStart%, 1, %ImageCount%) do (
     ECHO.
     ECHO ================================================================
     ECHO Adding packages to image with index %%i
     ECHO ================================================================
     ECHO.
    "%~dp0tools\peimg.exe" /Image:"%~dp0mount\%%i" /import:"%~dp0hotfixes\%ImageArchitecture%\*.cab"
    )
    
    for /L %%i in (%ImageStart%, 1, %ImageCount%) do (
     ECHO.
     ECHO ================================================================
     ECHO Installing packages to image with index %%i
     ECHO ================================================================
     ECHO.
    "%~dp0tools\peimg.exe" /Image:"%~dp0mount\%%i" /install=*for_KB*
    )
    
    for /L %%i in (%ImageStart%, 1, %ImageCount%) do (
     ECHO.
     ECHO ================================================================
     ECHO Unounting image %%i of Install.wim
     ECHO ================================================================
     dism /Unmount-Wim /MountDir:"%~dp0mount\%%i" /commit
     rd /s/q "%~dp0mount\%%i" >nul 2>&1
    )
    
    ECHO.
    ECHO ================================================================
    ECHO Repacking install.wim
    ECHO ================================================================
    "%~dp0tools\imagex.exe" /export "%~dp0DVD\sources\install.wim" "*" "%~dp0DVD\sources\install_temp.wim" /CHECK /COMPRESS maximum
    move /y "%~dp0DVD\sources\install_temp.wim" "%~dp0DVD\sources\install.wim" >NUL
    
    ECHO ================================================================
    ECHO Creating new DVD image
    ECHO ================================================================
     if "%ImageArchitecture%"=="x86" "%~dp0tools\oscdimg.exe" -b"%~dp0DVD\boot\etfsboot.com" -h -m -u2 -udfver102 "%~dp0DVD" "%~dp0WindowsVista_x86_%ImageLanguage%.iso" -lWINVISTA32_SP2
     if "%ImageArchitecture%"=="x64" "%~dp0tools\oscdimg.exe" -bootdata:2#p0,e,b"%~dp0DVD\boot\etfsboot.com"#pEF,e,b"%~dp0DVD\efi\microsoft\boot\Efisys.bin" -h -m -u2 -udfver102 "%~dp0DVD" "%~dp0WindowsVista_x64_%ImageLanguage%.iso" -lWINVISTA64_SP2
    
    REM Clean DVD directory
    rd /s /q "%~dp0DVD" >nul 2>&1
    mkdir "%~dp0DVD" >nul 2>&1
    
    ECHO ================================================================
    ECHO All finished.
    ECHO Press any key to end the script.
    ECHO ================================================================
    PAUSE >NUL
    
    :end
    PAUSE >NUL
    
    It requires peimg.exe oscdimg and imagex. you can get it using "getwaiktools" and selecting waik tools for Vista

    Right now, it detects the install.wim, extracts the images, updates them according to the updates found in .txt files and creates a bootable iso.
    The problem is that I can't find a list of all updates for vista and I have no idea how to make one. I've spent the last 2 days with this
    I've integrated +/- 150 updates without problem from some random list I created using windows patch loader

    I can use wumt (windows update minitool) to grab a list of updates for windows XP and 7, but with windows vista, I have the 100% cpu usage bug and never finds any update, but windows update itself works...
    Right now I'm stuck with the update list
     
  2. CEW

    CEW MDL Senior Member

    Jan 21, 2011
    295
    155
    10
    #22 CEW, Apr 15, 2020
    Last edited: Apr 16, 2020

    Attached Files:

  3. TesterMachineOS

    TesterMachineOS MDL Addicted

    Apr 20, 2021
    564
    264
    30
    how about using vLite? so just place the updates to integrate and then save in iso
     
  4. Chuterix

    Chuterix MDL Senior Member

    Apr 18, 2022
    275
    124
    10
    i've tried the script; failed, and no support by any community members
    george king says already created one, likely of vista2esd of uncertain date
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Chuterix

    Chuterix MDL Senior Member

    Apr 18, 2022
    275
    124
    10
    ^...but i uses peimg to integrate updates and my script was broken in many ways
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. TesterMachineOS

    TesterMachineOS MDL Addicted

    Apr 20, 2021
    564
    264
    30
    the script seems to work fine, it just shows error with PEIMG "Failed to complete the operation with status code 0x8007003" when trying to integrate the updates