

One example is KB4592440.Ī reboot is necessary before package KB4592440 can be changed to the Installed state. This may be necessary if you don't want to lock up your PC for half an hour (to install an update) and just need to reboot it quickly.Īlso having such option in your software may be a good thing to give your users control over their computers.When there was an update being installed and it required a restart, Azure VM restarted during off-hours, then it went into no response state. Note that I'm talking about preventing installation of updates during a reboot or shutdown only. Note that the InstallAtShutdown registry setting has no effect by itself if Windows updates are not downloaded, or otherwise are ready for an installation during a reboot. This means that your code doesn't have to run with administrative privileges to do what I showed above. Note that Microsoft actually set up a DACL on the InstallAtShutdown registry key to enable all authenticated users to set its value. If((dwR = RegSetValueEx(hKey, lpKeyValue, NULL, dwValueType, ( const BYTE *)pData, ncbDataSz)) = ERROR_SUCCESS) This may be necessary since Microsoft decided to have users click this button to finish installation of updates:Ĭ++ BOOL WriteValueToSystemRegistry( HKEY hIniKey, BOOL bWOW64, LPCTSTR lpSubKey, LPCTSTR lpKeyValue, DWORD dwValueType, const void* pData, int ncbDataSz)ĭwSam = KEY_SET_VALUE | (bWOW64 ? KEY_WOW64_64KEY : 0) ĭwR = RegCreateKeyEx(hIniKey, lpSubKey, NULL, NULL, 0, dwSam, NULL, &hKey, NULL)

May rely on internal implementation and may not work in the future. This article contains functions and features that are not documented by the original manufacturer.īy following advice in this article, you're doing so at your own risk.
