diff --git a/WindowsUpdate.DisableAutoRestart/WindowsUpdate.DisableAutoRestart.nuspec b/WindowsUpdate.DisableAutoRestart/WindowsUpdate.DisableAutoRestart.nuspec new file mode 100644 index 0000000..3a98e24 --- /dev/null +++ b/WindowsUpdate.DisableAutoRestart/WindowsUpdate.DisableAutoRestart.nuspec @@ -0,0 +1,28 @@ + + + + WindowsUpdate.DisableAutoRestart + Disable Windows Update Auto-Restart + 0.0.1 + Microsoft + Ethan Brown + Prevent your system from automatically restarting after automatically installing Windows Updates. + Prevent your system from automatically restarting after automatically installing Windows Updates. + + Sets the registry key HKLM:Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoRebootWithLoggedOnUsers to 1 + + Alternatively, group policy can be used to set this as well: + http://kevinjameshall.wordpress.com/2012/12/26/windows-8-updates-disable-auto-restart/ + + http://support.microsoft.com/kb/555444 + Windows WindowsUpdate + http://opensource.org/licenses/MIT + false + https://github.com/Iristyle/ChocolateyPackages/raw/master/WindowsUpdate.DisableAutoRestart/windows8.png + + + + + + + diff --git a/WindowsUpdate.DisableAutoRestart/tools/chocolateyInstall.ps1 b/WindowsUpdate.DisableAutoRestart/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000..5556eee --- /dev/null +++ b/WindowsUpdate.DisableAutoRestart/tools/chocolateyInstall.ps1 @@ -0,0 +1,22 @@ +$package = 'WindowsUpdate.DisableAutoRestart' + +try { + # http://support.microsoft.com/kb/555444 + # alternate using GPO: http://kevinjameshall.wordpress.com/2012/12/26/windows-8-updates-disable-auto-restart/ + $setRegistryKey = @" + `$params = @{ + Path = 'HKLM:Software\Policies\Microsoft\Windows\WindowsUpdate\AU'; + Name = 'NoAutoRebootWithLoggedOnUsers'; + Value = 1 + }; + if (!(Test-Path `$params.Path)) { New-Item -Path `$params.Path -Force | Out-Null }; + Set-ItemProperty @params +"@ + + Start-ChocolateyProcessAsAdmin $setRegistryKey + + Write-ChocolateySuccess $package +} catch { + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +} diff --git a/WindowsUpdate.DisableAutoRestart/windows8.png b/WindowsUpdate.DisableAutoRestart/windows8.png new file mode 100644 index 0000000..294fd97 Binary files /dev/null and b/WindowsUpdate.DisableAutoRestart/windows8.png differ