Hello, here is the action script:
begin prefetch block
if {((free space of drive of windows folder)/(102410241024) > 6 )}
add prefetch item name =en_windows_10_business_editions_version_21h1_x64_dvd_ec5a76c1.iso sha1=BDE4DBA4B702A17880F5E17935B3CAA212FD2C0A size=5694537728 url={value of setting “_BESClient_AllowCustomRepoDownloads” of client | “http://MANUAL_BES_CACHING_REQUIRED/”}en_windows_10_business_editions_version_21h1_x64_dvd_ec5a76c1.iso sha256=0FC1B94FA41FD15A32488F1360E347E49934AD731B495656A0A95658A74AD67F
endif
end prefetch block
parameter “workISO” = "{pathname of client folder of current site & “__Download\en_windows_10_business_editions_version_21h1_x64_dvd_ec5a76c1.iso”}"
continue if {exists file (parameter “workISO”)}
// prepare a workpath to temporary files.
parameter “workPath” = "{(value of variable “SystemDrive” of environment) & “\win10_upgrade_temp”}"
waithidden cmd /C rmdir /S /Q "{parameter “workPath”}"
waithidden cmd /C mkdir “{parameter “workPath”}”
// Create the cleanup file.
delete __appendfile
delete __Download\setupcomplete.cmd
appendfile @echo off
appendfile SET WindowsISO="{parameter “workISO”}“
appendfile powershell.exe “Dismount-DiskImage “”%WindowsISO%””"
appendfile rmdir /S /Q “{parameter “workPath”}”
move __appendfile __Download\setupcomplete.cmd
// Create a debug invocation batch to help in case of failures.
// This batch does not perform an update but with the scanonly option allows you to determine what the problem is.
delete __appendfile
appendfile @echo off
appendfile SET WindowsISO="{parameter “workISO”}“
appendfile FOR /F “skip=3” %%I IN ('powershell.exe “Get-DiskImage “””%WindowsISO%”"" | Get-Volume | Select-Object {{$_.DriveLetter}"’) DO “%%I:\setup.exe” ‘/auto upgrade /Compat ScanOnly /DynamicUpdate disable /noreboot’"
appendfile echo %errorlevel% > “{parameter “workPath”}\out.log”
move __appendfile “{(parameter “workPath”) & “/upgradeCheck.bat”}”
// Create the actual invocation script
// Sleep and Dir were added or command would fail with %errorlevel% 183. Possibly a delay on mount.
delete __appendfile
delete mount.and.install.bat
appendfile @echo on
appendfile SET WindowsISO="{parameter “workISO”}“
appendfile powershell.exe “Mount-DiskImage “”%WindowsISO%””“
appendfile TIMEOUT 10
appendfile FOR /F “skip=3” %%I IN ('powershell.exe “Get-DiskImage “””%WindowsISO%”"" | Get-Volume | Select-Object {{$_.DriveLetter}"’) DO dir %%I: > “{parameter “workPath”}\dir.log” && “%%I:\setup.exe” ‘/auto upgrade /Quiet /DynamicUpdate disable /noreboot /postoobe’ "{pathname of client folder of current site & “__Download\setupcomplete.cmd”}"
appendfile echo %errorlevel% > "{parameter “workPath”}\out.log"
move __appendfile mount.and.install.bat
wait mount.and.install.bat > “{parameter “workPath”}\cmd.log”
wait __Download\setupcomplete.cmd >"{parameter “workPath”}\setupcomplete.log"
// setup must finish with RC=0 at this stage if things are ok. If that is not the case content of C:"\win10_upgrade_temp dir holds useful info.
// Apart from log files, you can run upgradeCheck manually to check with the UI what the problem is.
action requires restart “BDE4DBA4B702A17880F5E17935B3CAA212FD2C0A”