# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []

def install():
    print('installing WSUS')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate',r'WUServer',r'http://SERVEUR',type=REG_SZ)
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate',r'WUStatusServer',r'http://SERVEUR',type=REG_SZ)

    print('Configuring WSUS')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU',r'NoAutoUpdate',0,type=REG_DWORD)
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU',r'AUOptions',2,type=REG_DWORD)
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU',r'ScheduledInstallDay',0,type=REG_DWORD)
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU',r'ScheduledInstallTime',13,type=REG_DWORD)
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU',r'UseWUServer',1,type=REG_DWORD)
