Good to Know Database

Windows 7 SP1 Installations-DVD mit mehreren zusätzlichen Sprachen ausstatten


Auf die Anfrage eines Lesers hin habe ich das auf der Seite Windows 7 SP1 Installations-DVD mit einer zusätzlichen Sprache ausstatten vorgestellte Batch-Skript ein wenig erweitert. Durch die Änderungen können jetzt beliebig viele Multilingual User Interface Packs im Batch-Skript angegeben werden, welche dann automatisch in die Windows 7 SP1 Installations-DVD integriert werden.

Hinweis: Bitte beachten Sie die auf der Seite Windows 7 SP1 Installations-DVD mit einer zusätzlichen Sprache ausstatten aufgeführten Voraussetzungen und Hinweise.

@echo off

rem
rem Create multilingual Windows 7 x86/x64 SP1 DVD
rem
rem 20120324 v1.0    Create multilingual Windows 7 x86/x64 SP1 DVD
rem 20120514 v1.1    Add support of multiple language packs
rem

rem Current working directory where also the language pack executables are located
rem Please don't touch!
set WORKDIR=%~dp0

rem Drive letter of your DVD drive (e.g. "F:")
set DVDDRIVE=F:

rem Architecture of the Windows 7 SP1 DVD
rem Set "x86" for 32 bit architecture
rem Set "amd64" for 64 bit architecture
set WIN7ARCH=amd64

rem Temporary directory to store the Windows 7 DVD content (e.g. "D:\Win7_SP1_DVD")
set WIN7DVDDIR=D:\Win7_SP1_%WIN7ARCH%_DVD

rem Path and filename for the ISO output file (e.g. "D:\Win7_SP1_MUI_DVD.iso")
set WIN7DVDISO=D:\Win7_SP1_%WIN7ARCH%_MUI_DVD.iso

rem Number of language packs to implement
set LANGUAGES=7

rem File names of the language pack executables without the file extension (e.g. "windows6.1-kb2483139-x64-en-us_9b9c8a867baff2920507fbf1e1b4a158572b9b87")
set LPFILENAME1=windows6.1-kb2483139-x64-en-us_9b9c8a867baff2920507fbf1e1b4a158572b9b87
set LPFILENAME2=windows6.1-kb2483139-x64-it-it_6d8223c065d6974d833d0eaa162f3ceb7680850f
set LPFILENAME3=windows6.1-kb2483139-x64-fr-fr_0f18e2a244dd9ff04664112a82776d2bd2177798
set LPFILENAME4=windows6.1-kb2483139-x64-es-es_fdbdf4061b960324efb9eedf7106df543ed8ce33
set LPFILENAME5=windows6.1-kb2483139-x64-pt-pt_78485491088298110a3e78b7a5f95e55ff7808df
set LPFILENAME6=windows6.1-kb2483139-x64-pt-br_f8035731c55d774c95c7c673aedfd42d52479294
set LPFILENAME7=windows6.1-kb2483139-x64-sr-latn-cs_5f487007933585def54c67087895e74e25e699a9
set LPFILENAME8=
set LPFILENAME9=

rem Language of the language packs (e.g. "de-de" or "en-us")
set LANGUAGE1=en-us
set LANGUAGE2=it-it
set LANGUAGE3=fr-fr
set LANGUAGE4=es-es
set LANGUAGE5=pt-pt
set LANGUAGE6=pt-br
set LANGUAGE7=sr-latn-cs
set LANGUAGE8=
set LANGUAGE9=

rem Some temporary working directories
set TEMPDIR=D:\Win7_SP1_%WIN7ARCH%_MUI
set EXTRACTDIR=%TEMPDIR%\extract
set MOUNTDIR=%TEMPDIR%\mount

rem Path to the Windows AIK or Windows OPK
set KITPATH=
if exist "C:\Program Files\Windows AIK" set KITPATH=C:\Program Files\Windows AIK
if exist "C:\Program Files\Windows OPK" set KITPATH=C:\Program Files\Windows OPK
if "%KITPATH%"=="" goto E_KITPATH

rem ###################################################################
rem # NORMALLY THERE IS NO NEED TO CHANGE ANYTHING BELOW THIS COMMENT #
rem ###################################################################

setlocal EnableDelayedExpansion

echo.
echo Remove temporary directories if they already exist
echo.
if exist "%WIN7DVDDIR%" rmdir /s /q "%WIN7DVDDIR%"
if errorlevel 1 goto E_DELDIR
if exist "%TEMPDIR%" rmdir /s /q "%TEMPDIR%"
if errorlevel 1 goto E_DELDIR

echo.
echo Create temporary directories
echo.
mkdir "%WIN7DVDDIR%"
if errorlevel 1 goto E_MKDIR
mkdir "%TEMPDIR%"
if errorlevel 1 goto E_MKDIR
mkdir "%EXTRACTDIR%"
if errorlevel 1 goto E_MKDIR
mkdir "%MOUNTDIR%"
if errorlevel 1 goto E_MKDIR

echo.
echo Copy Windows 7 SP1 DVD to the temporary directory
echo.
echo Please insert the Windows 7 SP1 %WIN7ARCH% DVD into the DVD drive %DVDDRIVE%
echo.
pause
xcopy %DVDDRIVE%\*.* /E /F "%WIN7DVDDIR%"

set /A COUNTER=1
:LOOP
echo.
echo Extract %COUNTER%. language pack executable
echo.
if not exist "%WORKDIR%\!LPFILENAME%COUNTER%!.exe" goto E_LPFILE
start %WORKDIR%\!LPFILENAME%COUNTER%!.exe

:WAIT
rem Wait if lp.cab doesn't exist
if not exist lp.cab goto WAIT

:RETRY
rem Rename lp.cab after extraction has finished
rename lp.cab !LPFILENAME%COUNTER%!.cab
if exist lp.cab goto RETRY

echo.
echo Move extracted language pack to %TEMPDIR%
echo.
move !LPFILENAME%COUNTER%!.cab "%TEMPDIR%\!LPFILENAME%COUNTER%!.cab"
set /A COUNTER+=1
if %COUNTER% LEQ %LANGUAGES% goto LOOP

rem Set count of available Windows 7 versions
if "%WIN7ARCH%"=="x86"   set VERSIONS=5
if "%WIN7ARCH%"=="amd64" set VERSIONS=4

rem Add language pack files to the installation images
for /L %%i in (1, 1, %VERSIONS%) do (
  echo.
  echo Add language pack files to the installation image %%i of %VERSIONS%
  echo.
  "%KITPATH%\Tools\x86\Servicing\Dism.exe" /Mount-Wim /Wimfile:"%WIN7DVDDIR%\sources\install.wim" /Index:%%i /MountDir:"%MOUNTDIR%"
  if errorlevel 1 goto E_MOUNT
  for /L %%j in (1, 1, %LANGUAGES%) do (
    "%KITPATH%\Tools\x86\Servicing\Dism.exe" /Image:"%MOUNTDIR%" /Add-Package /PackagePath:"%TEMPDIR%\!LPFILENAME%%j!.cab"
    "%KITPATH%\Tools\x86\Servicing\Dism.exe" /Image:"%MOUNTDIR%" /Gen-LangIni /Distribution:"%WIN7DVDDIR%"
    "%KITPATH%\Tools\x86\Servicing\Dism.exe" /Image:"%MOUNTDIR%" /Set-AllIntl:!LANGUAGE%%j!
    "%KITPATH%\Tools\x86\Servicing\Dism.exe" /Image:"%MOUNTDIR%" /Set-TimeZone:"Central Europe Standard Time"
    "%KITPATH%\Tools\x86\Servicing\Dism.exe" /Image:"%MOUNTDIR%" /Set-SetupUILang:!LANGUAGE%%j! /Distribution:"%WIN7DVDDIR%"
    "%KITPATH%\Tools\x86\Servicing\Dism.exe" /Image:"%MOUNTDIR%" /Gen-LangIni /Distribution:"%WIN7DVDDIR%"
    "%KITPATH%\Tools\x86\Servicing\Dism.exe" /Image:"%MOUNTDIR%" /Get-Packages /Format:Table
    "%KITPATH%\Tools\x86\Servicing\Dism.exe" /Image:"%MOUNTDIR%" /Get-Intl
  )
  "%KITPATH%\Tools\x86\Servicing\Dism.exe" /Unmount-Wim /MountDir:"%MOUNTDIR%" /Commit
  if errorlevel 1 goto E_UNMOUNT
)

echo.
echo Add language pack files to the Windows 7 SP1 DVD
echo.
for /L %%i in (1, 1, %LANGUAGES%) do (
  expand "%TEMPDIR%\!LPFILENAME%%i!.cab" -F:* "%EXTRACTDIR%"
  xcopy "%EXTRACTDIR%\setup\sources\!LANGUAGE%%i!\*" "%WIN7DVDDIR%\sources\!LANGUAGE%%i!" /cherkyi
  xcopy "%EXTRACTDIR%\sources\license\!LANGUAGE%%i!\*" "%WIN7DVDDIR%\sources\license\!LANGUAGE%%i!" /cherkyi
)

echo.
echo Add language pack files to the boot image
echo.
"%KITPATH%\Tools\x86\Servicing\Dism.exe" /Mount-Wim /WimFile:"%WIN7DVDDIR%\sources\boot.wim" /Index:2 /MountDir:"%MOUNTDIR%"
if errorlevel 1 goto E_MOUNT
for /L %%i in (1, 1, %LANGUAGES%) do (
  xcopy "%EXTRACTDIR%\setup\sources\!LANGUAGE%%i!\*" "%MOUNTDIR%\sources\!LANGUAGE%%i!" /cherkyi
  xcopy "%EXTRACTDIR%\sources\license\!LANGUAGE%%i!\*" "%MOUNTDIR%\sources\license\!LANGUAGE%%i!" /cherkyi
  copy "%WIN7DVDDIR%\sources\lang.ini" "%MOUNTDIR%\sources\lang.ini"
)
"%KITPATH%\Tools\x86\Servicing\Dism.exe" /Unmount-Wim /MountDir:"%MOUNTDIR%" /Commit
if errorlevel 1 goto E_UNMOUNT

echo.
echo Create Windows 7 SP1 %WIN7ARCH% MUI ISO image
echo.
"%KITPATH%\Tools\x86\oscdimg.exe" -u1 -b"%WIN7DVDDIR%\boot\etfsboot.com" "%WIN7DVDDIR%" "%WIN7DVDISO%"
if errorlevel 1 goto E_CREATEISO

echo.
echo Remove temporary directories
echo.
if exist "%WIN7DVDDIR%" rmdir /s /q "%WIN7DVDDIR%"
if errorlevel 1 goto E_DELDIR
if exist "%TEMPDIR%" rmdir /s /q "%TEMPDIR%"
if errorlevel 1 goto E_DELDIR

goto DONE

:E_KITPATH
set MESSAGE=Could not find the AIK/OPK directory!
goto END

:E_DELDIR
set MESSAGE=Could not delete temporary directory!
goto END

:E_MKDIR
set MESSAGE=Could not create temporary directory!
goto END

:E_LPFILE
set MESSAGE=Could not find language pack executable!
goto END

:E_MOUNT
set MESSAGE=Could not mount WIM image!
goto END

:E_UNMOUNT
set MESSAGE=Could not unmount WIM image!
goto END

:E_CREATEISO
set MESSAGE=Could not create "%WIN7DVDISO%"!
goto END

:DONE
cls
set MESSAGE=Done
goto END

:END
echo.
echo %MESSAGE%
echo.
pause
exit

Weiterführende Tutorials

Windows 7 Multilingual User Interface Pack entpacken
Windows 7 SP1 Installations-DVD mit einer zusätzlichen Sprache ausstatten
Windows 7 Installations-DVD mit Versionsauswahl erstellen oder Standardversion ändern


Dieser Eintrag wurde am 27.05.2012 erstellt und zuletzt am 24.01.2016 bearbeitet.

Direkter Link zu dieser Seite: http://www.gtkdb.de/index_17_1644.html

[ Zur Startseite ]   [ Zur Kategorie ]


Valid XHTML 1.0 Transitional Valid CSS Valid Atom 1.0

© 2004-2018 by Georg Kainzbauer