Jump to content

DeanMao

Members
  • Posts

    1
  • Joined

Posts posted by DeanMao

  1. :AddPackageKB2533552
    set KB2533552=!APP_HOME!\Updates\SpecialUpdates\KB976932\Windows6.1-KB2533552-!OS_ARCHITECTURE!.cab
    mkdir "%temp%\KB2533552"
    expand -F:* "!KB2533552!" "%temp%\KB2533552"
    copy "%temp%\KB2533552\update.mum" "%temp%\KB2533552\update.mum.bak"
    cscript "%APP_HOME%\SourceCode\Common\Utils\replace.vbs" "%temp%\KB2533552\update.mum"
    for /d %%c in (!WimIndexNo!) DO (!DISM! /Image:"!WimMountDir!\%%c" /add-package /packagepath:"%temp%\KB2533552\update.mum" /ignorecheck /NoRestart)
    set SRC="%temp%\KB2533552\update.mum.bak"
    for /d %%c in (!WimIndexNo!) DO (set DST=!WimMountDir!\%%c\Windows\servicing\Packages\Package_for_KB2533552~31bf3856ad364e35~amd64~~6.1.1.1.mum)
    takeown /F "%DST%" /A
    icacls "%DST%" /grant Administrators:F
    copy "%SRC%" "%DST%"
    icacls "%DST%" /setowner "NT SERVICE\TrustedInstaller"
    icacls "%DST%" /grant:r Administrators:RX
    call :ADD_UPDATE_ERROR_FIX
    rd /s /q "%temp%\KB2533552" >nul 2>&1
    goto :EOF
    
    
    :ADD_UPDATE_ERROR_FIX
    set "SetACL=%APP_HOME%\Bin\%PROCESSOR_ARCHITECTURE%\SetACL.exe"
    for /d %%c in (!WimIndexNo!) DO (
    	reg load HKLM\TempSoftware !WimMountDir!\%%c\Windows\System32\config\SOFTWARE
    	%SetACL% -on "HKLM\TempSoftware\Microsoft\Windows\CurrentVersion\Component Based Servicing\SessionsPending" -ot reg -actn setowner -ownr n:Administrators
    	%SetACL% -on "HKLM\TempSoftware\Microsoft\Windows\CurrentVersion\Component Based Servicing\SessionsPending" -ot reg -actn ace -ace n:Administrators;p:full
    	reg add "HKLM\TempSoftware\Microsoft\Windows\CurrentVersion\Component Based Servicing\SessionsPending" /v Exclusive /t REG_DWORD /d 0 /f
    	reg unload HKLM\TempSoftware
    )
    goto :EOF

    this is part of my code ,You can't run it directly,for reference only,wish it can help you.

×
×
  • Create New...