bugfixing for image handling

This commit is contained in:
Michael H.G. Schmidt 2023-01-22 20:09:39 +01:00
parent 6f07b340a0
commit d941f5eda0
6 changed files with 42 additions and 38 deletions

View File

@ -1,5 +1,4 @@
@echo off
set SOURCES=c:\TEMP\W10\sources
rem check for the image directory ...
if NOT EXIST image (
@ -10,13 +9,6 @@ if NOT EXIST image (
cd image
)
rem check for wim file ...
if NOT EXIST %SOURCES%\boot.wim (
echo ERROR: [ %SOURCES%\boot.wim ] NOT FOUND!
cd ..
exit /b
)
echo =========================================
echo START of BOOT image creation process ...
echo =========================================
@ -24,16 +16,12 @@ echo.
rem start scripts
for %%S in (
mount-boot.cmd
finish-boot.cmd
) do (
echo ########## calling [ %%S ] ##########
call %%S
call %%S || exit /b
echo.
)
rem go back ...
@ -43,4 +31,3 @@ echo.
echo ======
echo READY.
echo ======

View File

@ -1,6 +1,6 @@
@echo off
set ARG1=null
set SOURCES=c:\TEMP\W10\sources
set NTLITE="%ProgramFiles%\NTLite\NTLite.exe"
IF "%~1" NEQ "" set ARG1=%1
if /I %ARG1% == /? goto usage
@ -14,13 +14,6 @@ if NOT EXIST image (
cd image
)
rem check for wim file ...
if NOT EXIST %SOURCES%\install.wim (
echo ERROR: [ %SOURCES%\install.wim ] NOT FOUND!
cd ..
exit /b
)
echo =========================================
echo START of MAIN image creation process ...
echo =========================================
@ -32,11 +25,10 @@ for %%S in (
mount-image.cmd
) do (
echo ########## calling [ %%S ] ##########
call %%S
call %%S || exit /b
echo.
)
if /I %ARG1% == /R (
echo ########## calling [ remove-apps.cmd ] ##########
call remove-apps.cmd
@ -44,7 +36,7 @@ if /I %ARG1% == /R (
)
echo ########## calling [ finish-image.cmd ] ##########
call finish-image.cmd
call finish-image.cmd || exit /b
echo.
echo checking for NTLite ...
@ -73,3 +65,4 @@ echo " /R = remove apps from main image"
echo " /? = show help "
echo.
:END

View File

@ -16,8 +16,8 @@ if NOT EXIST %BOOT%\winsetup.exe (
)
echo setting language in boot image ...
dism /image:%BOOT% /Set-InputLocale:%LANG%
dism /image:%BOOT% /Set-SysLocale:%LANG%
dism /image:%BOOT% /Set-InputLocale:%LANG% || exit /b 1
dism /image:%BOOT% /Set-SysLocale:%LANG% || exit /b 1
echo replacing setup.exe with our installer utility ...
copy /Y installer.exe %BOOT%\setup.exe
@ -34,5 +34,5 @@ echo copy netuse helper script to boot image ...
copy /Y netuse.cmd %BOOT%
echo unmounting and committing changes to %SOURCES%\boot.wim ...
dism /Unmount-Wim /MountDir:%BOOT% /Commit
dism /Unmount-Wim /MountDir:%BOOT% /Commit || exit /b 1

View File

@ -2,15 +2,30 @@
set SOURCES=c:\TEMP\W10\sources
set BOOT=c:\TEMP\BOOT
rem check for wim file ...
if NOT EXIST %SOURCES%\boot.wim (
echo ERROR: [ %SOURCES%\boot.wim ] NOT FOUND!
exit /b
)
rem cleanup ...
rd /S /Q %BOOT% 2>nul
echo creating wim mountpoint for BOOT ...
mkdir %BOOT% 1>nul 2>nul
echo set write access for boot.wim ...
echo setting write access for boot.wim ...
attrib -R %SOURCES%\boot.wim
echo mounting boot.wim to %BOOT% ...
dism /Mount-Wim /WimFile:%SOURCES%\boot.wim /Name:"Microsoft Windows Setup (x64)" /MountDir:%BOOT%
dism /Mount-Wim /WimFile:%SOURCES%\boot.wim /Name:"Microsoft Windows Setup (x64)" /MountDir:%BOOT% || (
echo.
echo ERROR while mounting WIM file! Please unmount orphaned images:
dism /Get-MountedWimInfo
echo.
echo INFO. Use the following command to fix this problem:
echo "dism /Unmount-Wim /MountDir:<Mount Dir> /Discard"
exit /b 1
)

View File

@ -1,23 +1,31 @@
@echo off
set SOURCES=c:\TEMP\W10\sources
set IMAGE=c:\TEMP\IMAGE
set NTLITE="%ProgramFiles%\NTLite\NTLite.exe"
rem check for wim file ...
if NOT EXIST %SOURCES%\boot.wim (
echo ERROR: [ %SOURCES%\boot.wim ] NOT FOUND!
echo ABORT.
if NOT EXIST %SOURCES%\install.wim (
echo ERROR: [ %SOURCES%\install.wim ] NOT FOUND!
exit /b
) else (
cd image
)
rem cleanup ...
rd /S /Q %IMAGE% 2>nul
echo creating image mountpoint ...
mkdir %IMAGE% 1>nul 2>nul
rem set write access ...
echo setting write access for install.wim ...
attrib -R %SOURCES%\install.wim 2>nul
echo mounting install.wim to %IMAGE% ...
dism /Mount-IMAGE /IMAGEFile:%SOURCES%\install.wim /Name:"Windows 10 Pro" /MountDir:%IMAGE%
dism /Mount-IMAGE /IMAGEFile:%SOURCES%\install.wim /Name:"Windows 10 Pro" /MountDir:%IMAGE% || (
echo.
echo ERROR while mounting WIM file! Please unmount orphaned images:
dism /Get-MountedWimInfo
echo.
echo INFO. Use the following command to fix this problem:
echo "dism /Unmount-Wim /MountDir:<Mount Dir> /Discard"
exit /b 1
)

View File

@ -11,4 +11,5 @@ dism /Unmount-Wim /MountDir:%BOOT% /Discard
echo cleaning up ...
dism /Cleanup-Wim
dism /Cleanup-Mountpoints