bugfix
This commit is contained in:
parent
21e6cdfaf2
commit
da40e2dc28
@ -5,12 +5,11 @@ set WIM=%SOURCES%\install.wim
|
|||||||
set W10PRO=%SOURCES%\w10pro.wim
|
set W10PRO=%SOURCES%\w10pro.wim
|
||||||
set STATEFILE=%SOURCES%\w10pro.txt
|
set STATEFILE=%SOURCES%\w10pro.txt
|
||||||
|
|
||||||
|
|
||||||
if EXIST %STATEFILE% (
|
if EXIST %STATEFILE% (
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo INFO: found %STATEFILE%
|
echo [%0] INFO: found %STATEFILE%
|
||||||
echo nothing todo. all work was already done.
|
echo [%0] OK: nothing todo. all work was already done.
|
||||||
echo READY.
|
echo READY.
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
@ -19,12 +18,12 @@ if EXIST %STATEFILE% (
|
|||||||
if EXIST %ESD% (
|
if EXIST %ESD% (
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo INFO: found %ESD%
|
echo [%0] INFO: found %ESD%
|
||||||
|
|
||||||
echo deleting "old" install.wim ...
|
echo [%0] INFO: deleting %WIM% ...
|
||||||
del %WIM% 1>nul 2>nul
|
del %WIM% 2>nul
|
||||||
|
|
||||||
echo exporting image from %ESD% ...
|
echo [%0] INFO: exporting image from %ESD% ...
|
||||||
dism /Export-Image ^
|
dism /Export-Image ^
|
||||||
/SourceImageFile:%ESD% ^
|
/SourceImageFile:%ESD% ^
|
||||||
/DestinationImageFile:%WIM% ^
|
/DestinationImageFile:%WIM% ^
|
||||||
@ -32,22 +31,26 @@ if EXIST %ESD% (
|
|||||||
/Compress:Max ^
|
/Compress:Max ^
|
||||||
/CheckIntegrity
|
/CheckIntegrity
|
||||||
|
|
||||||
|
if %ERRORLEVEL% NEQ 0 (
|
||||||
|
echo [%0] ERROR: while extracting %ESD%
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo READY.
|
echo READY.
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if EXIST %WIM% (
|
if EXIST %WIM% (
|
||||||
|
|
||||||
rem cleanup ...
|
rem cleanup ...
|
||||||
del /F %W10PRO% 1>nul 2>nul
|
del /F %W10PRO% 1>nul 2>nul
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo INFO: found %WIM%
|
echo [%0] INFO: found %WIM%
|
||||||
|
|
||||||
echo exporting image from %WIM% ...
|
echo [%0] INFO: exporting image from %WIM% ...
|
||||||
dism /Export-Image ^
|
dism /Export-Image ^
|
||||||
/SourceImageFile:%WIM% ^
|
/SourceImageFile:%WIM% ^
|
||||||
/DestinationImageFile:%W10PRO% ^
|
/DestinationImageFile:%W10PRO% ^
|
||||||
@ -55,9 +58,16 @@ if EXIST %WIM% (
|
|||||||
/Compress:Max ^
|
/Compress:Max ^
|
||||||
/CheckIntegrity
|
/CheckIntegrity
|
||||||
|
|
||||||
echo set write access for install.wim ..
|
if %ERRORLEVEL% NEQ 0 (
|
||||||
attrib -R %WIM%
|
echo [%0] ERROR: while extracting %WIM%
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
|
||||||
|
echo [%0] WARNING: removing original %WIM% ...
|
||||||
|
attrib -R %WIM% 2>nul
|
||||||
|
del /F %WIM% 1>nul 2>nul
|
||||||
|
|
||||||
|
echo [%0] INFO: renaming %W10PRO% ...
|
||||||
move /Y %W10PRO% %WIM%
|
move /Y %W10PRO% %WIM%
|
||||||
echo all done >%STATEFILE%
|
echo all done >%STATEFILE%
|
||||||
|
|
||||||
@ -67,5 +77,3 @@ if EXIST %WIM% (
|
|||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set ERRORLEVEL=9009
|
|
||||||
|
|
||||||
|
@ -1,43 +1,50 @@
|
|||||||
@echo off
|
@echo off
|
||||||
set SOURCES=c:\TEMP\W10\sources
|
set SOURCES=c:\TEMP\W10\sources
|
||||||
set IMAGE=c:\TEMP\IMAGE
|
set IMAGE=c:\TEMP\IMAGE
|
||||||
|
set ESD=%SOURCES%\install.esd
|
||||||
|
set WIM=%SOURCES%\install.wim
|
||||||
|
set FINAL=%SOURCES%\install_FINAL.esd
|
||||||
|
|
||||||
if NOT EXIST %SOURCES%\install.wim (
|
if NOT EXIST %WIM% (
|
||||||
echo.
|
echo.
|
||||||
echo [%0] ERROR: %SOURCES%\install.wim NOT found!
|
echo [%0] ERROR: %WIM% NOT found!
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
rd /S /Q %IMAGE%\Windows\Setup\scripts 1>nul 2>nul
|
rd /S /Q %IMAGE%\Windows\Setup\scripts 1>nul 2>nul
|
||||||
mkdir %IMAGE%\Windows\Setup\scripts 1>nul 2>nul
|
mkdir %IMAGE%\Windows\Setup\scripts 1>nul 2>nul
|
||||||
|
|
||||||
echo copying scripts to %IMAGE%\Windows\Setup\scripts ...
|
echo [%0] INFO: copying scripts to %IMAGE%\Windows\Setup\scripts ...
|
||||||
copy /Y SetupComplete.cmd %IMAGE%\Windows\Setup\scripts
|
copy /Y SetupComplete.cmd %IMAGE%\Windows\Setup\scripts
|
||||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
|
||||||
|
|
||||||
copy /Y StartCustomSetup.cmd %IMAGE%\Windows\Setup\scripts
|
copy /Y StartCustomSetup.cmd %IMAGE%\Windows\Setup\scripts
|
||||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
if %ERRORLEVEL% NEQ 0 (
|
||||||
|
echo [%0] ERROR: while copying scripts to IMAGE
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
|
||||||
echo showing directory contents :
|
echo [%0] INFO: showing directory contents :
|
||||||
dir %IMAGE%\Windows\Setup\scripts
|
dir %IMAGE%\Windows\Setup\scripts
|
||||||
|
|
||||||
echo doing cleanup on mountpoint %IMAGE% ...
|
echo [%0] INFO: doing cleanup on mountpoint %IMAGE% ...
|
||||||
dism /Image:%IMAGE% /Cleanup-Image /StartComponentCleanup /ResetBase
|
dism /Image:%IMAGE% /Cleanup-Image /StartComponentCleanup /ResetBase
|
||||||
|
|
||||||
echo unmounting and committing changes to %SOURCES%\install.wim ...
|
echo [%0] INFO: unmounting and committing changes to %WIM% ...
|
||||||
dism /Unmount-Wim /MountDir:%IMAGE% /Commit
|
dism /Unmount-Wim /MountDir:%IMAGE% /Commit
|
||||||
|
|
||||||
echo directory of %IMAGE% :
|
echo [%0] INFO: directory of %IMAGE% :
|
||||||
dir %IMAGE%
|
dir %IMAGE%
|
||||||
|
|
||||||
echo exporting %SOURCES%\install.wim to %SOURCES%\install_FINAL.esd ...
|
echo [%0] INFO: exporting %WIM% to %FINAL% ...
|
||||||
dism /Export-Image ^
|
dism /Export-Image ^
|
||||||
/SourceImageFile:%SOURCES%\install.wim ^
|
/SourceImageFile:%WIM% ^
|
||||||
/DestinationImageFile:%SOURCES%\install_FINAL.esd ^
|
/DestinationImageFile:%FINAL% ^
|
||||||
/SourceName:"Windows 10 Pro" ^
|
/SourceName:"Windows 10 Pro" ^
|
||||||
/Compress:Recovery ^
|
/Compress:Recovery ^
|
||||||
/CheckIntegrity
|
/CheckIntegrity
|
||||||
|
|
||||||
echo deleting old %SOURCES%\install.wim
|
rem delete wim file only in case there is an esd file ...
|
||||||
del /F %SOURCES%\install.wim
|
if EXIST %ESD% (
|
||||||
|
echo [%0] INFO: deleting %WIM%
|
||||||
|
del /F %SOURCES%\install.wim 2>nul
|
||||||
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user