Windows Update の再起動前に Windows の動作がおかしくなる原理について
Windows Update でシェルライブラリの置換が行われると一部のAPIが正しい結果を返さなくなるので、書いてるプログラムが正しいのに動かなくなる事があるのじゃ・ω・
その場合は、再起動して、Windows Update の適用が完了すると直るので、「煮詰まったときは一晩寝てから」というのは正しいのじゃよ— 黒翼猫|ω・)。o(や、やばた2000) (@BlackWingCat) November 28, 2018
プログラムを書いてる人にはあるあるの現象ですが
手抜きOS Windows 10 Part107 / 突然ファイル共有が使えなくなったら –
なぜこんなことがあるのか、元凶として考えられる最有力の候補について解説します
[Version]
Signature = "$Windows NT$"
NtServicePackVersion = 0
NtServicePackVersionText = "KB2918614"
NtServicePackVersionFullText = "Aggiornamento della protezione per Windows Server 2003 (KB2918614)"
NtServicePackPreviousVersion = 512
NtServicePackPreviousVersionText = "Nessun KB2918614"
IEVersion = "0.0.0.0"
DisplayTitle = "KB2918614"
SP_TITLE = "Aggiornamento della protezione per Windows Server 2003 (KB2918614)"
RebootRequired = 0
[SourceDisksNames]
1 = "Windows NT Service Pack Uninstall Directory"
[SourceDisksFiles]
crypt32.dll = 1
msi.dll = 1
msihnd.dll = 1
crypt32.dll = 1
msi.dll = 1
msihnd.dll = 1
[DestinationDirs]
"ProductCatalogsToInstall.delete.files" = 0, "ProductCatalogsToInstall"
"SystemRoot\system32.restore.files" = 10, "system32"
"SystemRoot\system32.restore.files.nodelay" = 10, "system32"
"SystemRoot\system32\dllcache.restore.files" = 10, "system32\dllcache"
[RestoreFiles]
CopyFiles = "SystemRoot\system32.restore.files"
CopyFiles = "SystemRoot\system32\dllcache.restore.files"
DelFiles = "ProductCatalogsToInstall.delete.files"
[RestoreFiles.NoDelay]
CopyFiles = "SystemRoot\system32.restore.files.nodelay"
[ProductCatalogsToInstall.delete.files]
kb2918614.cat
[SystemRoot\system32.restore.files]
crypt32.dll,,,8
[SystemRoot\system32.restore.files.nodelay]
msi.dll,,,8
msihnd.dll,,,8
[SystemRoot\system32\dllcache.restore.files]
crypt32.dll
msi.dll
msihnd.dll
[Reg.Restore.Keys]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MSI30-Beta1","",reg00001
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MSI30-Beta2","",reg00002
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MSI30-RC1","",reg00003
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MSI30-RC2","",reg00004
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB884016","",reg00005
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MSI30a-KB884016","",reg00006
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MSI30-KB884016","",reg00007
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MSI31-Beta","",reg00008
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MSI31-RC1","",reg00009
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB893803","",reg00010
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB893803v2","",reg00011
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB935695_Beta","",reg00012
HKCR,"CLSID\{000C101C-0000-0000-C000-000000000046}","",reg00013
HKCR,"CLSID\{000C101C-0000-0000-C000-000000000046}\ProgId","",reg00014
HKCR,"IMsiServer","",reg00015
HKCR,"IMsiServer\CLSID","",reg00016
HKCR,"APPID\{000C101C-0000-0000-C000-000000000046}","",reg00017
HKLM,"System\CurrentControlSet\Services\EventLog\Application\MsiInstaller","",reg00018
HKCR,"CLSID\{000C103E-0000-0000-C000-000000000046}","REG_SZ",reg00019
HKCR,"CLSID\{000C103E-0000-0000-C000-000000000046}\InProcServer32","REG_SZ",reg00020
[Reg.Delete.Keys]
HKCR,"TypeLib\{000C1092-0000-0000-C000-000000000046}\1.0\409\FLAGS"
HKCR,"TypeLib\{000C1092-0000-0000-C000-000000000046}\1.0\409\HELPDIR"
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\KB2918614"
HKLM,"SOFTWARE\Microsoft\Updates\Windows Server 2003\SP3\KB2918614"
[Reg.Restore.Values]
HKLM,"Software\Microsoft\Windows\CurrentVersion\Installer","","InstallerLocation",1,21,\
43,3a,5c,57,49,4e,44,4f,57,53,5c,73,79,73,74,65,6d,33,32,5c,00
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Setup","","LogLevel",4,4,\
00,00,00,20
HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System\Clussvc","","EventMessageFile",2,70,\
3b,25,73,79,73,74,65,6d,72,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,\
77,73,30,33,72,65,73,2e,64,6c,6c,3b,25,73,79,73,74,65,6d,72,6f,6f,74,\
25,5c,73,79,73,74,65,6d,33,32,5c,77,30,33,61,32,34,30,39,2e,64,6c,6c,\
00
[ProcessesToRunBeforeUninstall]
"%systemroot%\system32\spupdsvc.exe /install"
"%windir%\system32\regsvr32.exe /s /u %windir%\system32\msi.dll"
[ProcessesToRunBeforeUninstall.IA]
[ProcessesToRunAfterCopyingUninstall]
[ProcessesToRunAfterCopyingUninstall.IA]
[ProcessesToRunAfterUninstall]
[ProcessesToRunAfterUninstall.IA]
[ProcessesToRunAfterReboot]
[ProcessesToRunAfterReboot.IA]
[DeviceClassList]
[ProcessesToRunAfterReboot.RebootNotRequired]
"%windir%\system32\regsvr32.exe /s %windir%\system32\msi.dll"
|
これは KB2918614 の update.inf なのですが、赤字の部分に注目して下さい。
ProcessesToRunBeforeUninstall と言うのは、アンインストールの前に実行されるバッチ処理をさします。
ここでは、regsvr32 による OLE コントロール/COM オブジェクト ライブラリの解放が行われています。
そのまま、更新インストールが完了して、再登録されれば問題ないはずですが、更に下の部分を注目してみてください。
ProcessesToRunAfterReboot.RebootNotRequired とあります。
ここで、 regsvr32 で再登録されています。
ところが、これは、再起動は必須ではないが、再起動後に実行されるバッチ処理の事です。
要するに、再起動するまで、 特定の OLE コントロール/COM オブジェクト ライブラリ が実行できなくなります。
これが、Windows Update がバックグラウンドで行われた後、再起動するまで まともに動かなくなるメカニズムなのです ((((・ω・))))
困ったことに、こういった更新が行われているアップデートが時々あるのです。
流石、マイクロソフトですね ・ω・!


あーそれで、OSの動きが妙にカクカクしたりするのか
アプリの動作にまで影響与えてそうだなぁと
しかしこれどうするのが正しいんだろうな。
全部シャットダウンや再起動中にやるってのが一番問題を起こさないのだろうけど・・・
>>2
電源オプションにWindowsUpdateの黄色い盾のマークを発見したら速やかに再起動するとトラブルをさけられますが。
Windows Update を適用したせいで発生する問題が起こるかもしれないので、適用された更新プログラム(まだ再起動してないので最終適用されていない)が完全に入る前にインターネットで調べてから問題なければ再起動でいいと思います・ω・