mirror of
https://github.com/slorelee/wimbuilder2.git
synced 2025-05-06 18:25:51 +08:00
somehow dism can't unmount the mounted folder completely, remove it before mounting
This commit is contained in:
parent
0f5951dcc0
commit
e7864b1fdc
@ -2,6 +2,20 @@ if "x%3"=="x" goto :EOF
|
||||
if not "x%~4"=="x" set %~4=
|
||||
|
||||
call WB_LOG "[%WB_PROJECT%] --- MOUNT [%~1:%2] -%%gt:%% [%~3]"
|
||||
|
||||
rem remove uncompleted mounted folder first.
|
||||
set chk_file=
|
||||
if exist "%~3" (
|
||||
for /f "delims=" %%i in ('dir /b "%~3"') do (
|
||||
set "chk_file=%%i"
|
||||
)
|
||||
)
|
||||
|
||||
if "x%chk_file%"=="x" (
|
||||
rd /q "%~3"
|
||||
)
|
||||
set chk_file=
|
||||
|
||||
if not exist "%~3" mkdir "%~3"
|
||||
call DismX /mount-wim /wimfile:"%~1" /index:%2 /mountdir:"%~3"
|
||||
|
||||
|
@ -20,10 +20,11 @@ if "x%1"=="x0" (
|
||||
set UNMNT_OPT=/commit
|
||||
)
|
||||
|
||||
if exist X:\ SUBST X: /D
|
||||
|
||||
if exist "%_WB_MNT_DIR%\Windows" (
|
||||
call WIM_UnMounter.bat "%_WB_MNT_DIR%" %UNMNT_OPT% base_wim_mounted
|
||||
)
|
||||
|
||||
if exist X:\ SUBST X: /D
|
||||
|
||||
echo Cleanup finished.
|
||||
|
Loading…
x
Reference in New Issue
Block a user