# -*- coding: utf-8 -*- from setuphelpers import * uninstallkey = [] # Service to disable disabled_services = [ 'Mcx2Svc', # Media Center Extender 'WerSvc', # Error reporting 'WPCSvc', # Parental control 'helpsvc', # Help service 'diagnosticshub.standardcollector.service', # Microsoft (R) Diagnostics Hub Standard Collector Service 'DiagTrack', # Diagnostics Tracking Service 'dmwappushservice', # WAP Push Message Routing Service (see known issues) 'HomeGroupListener', # HomeGroup Listener 'HomeGroupProvider', # HomeGroup Provider 'lfsvc', # Geolocation Service 'MapsBroker', # Downloaded Maps Manager 'NetTcpPortSharing', # Net.Tcp Port Sharing Service 'RemoteAccess', # Routing and Remote Access 'RemoteRegistry', # Remote Registry 'SharedAccess', # Internet Connection Sharing (ICS) 'TrkWks', # Distributed Link Tracking Client 'WMPNetworkSvc', # Windows Media Player Network Sharing Service 'XblAuthManager', # Xbox Live Auth Manager 'XblGameSave', # Xbox Live Game Save Service 'XboxNetApiSvc' # Xbox Live Networking Service ] def install(): print('Disabling unwanted services') for service in disabled_services: print(' Disabling %s' % service) run(r'sc config %s start= disabled' % service, accept_returncodes=[0,1060]) print('Enabling ping response') run(r'netsh firewall set icmpsetting 8 enable') print('Create our local adamin account') run(r'net user ehtrace /add', accept_returncodes=[0,2]) run(r'net localgroup Administrateurs ehtrace /add', accept_returncodes=[0,2]) if windows_version() > Version('10'): print('Disabling P2P updates delivery') registry_setstring(HKEY_LOCAL_MACHINE, r'SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization', 'DODownloadMode', 0, REG_DWORD) print('Disabling Cortana') registry_set(HKEY_LOCAL_MACHINE, r'SOFTWARE\Policies\Microsoft\Windows\Windows Search', r'AllowCortana', 0, REG_DWORD) remove_metroapp('Microsoft.Windows.Cortana') print('Install custom logo') filecopyto('waptexit-logo.png',makepath(programfiles32,'wapt','templates')) def uninstall(): print('Re enabling services') for service in disabled_services: print(' Enabling %s' % service) run(r'sc config %s start= auto' % service, accept_returncodes=[0,1060]) print('Removing DeliveryOptimization settings') with reg_openkey_noredir(HKEY_LOCAL_MACHINE, r'SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization', sam=KEY_WRITE) as reg_key: reg_delvalue(reg_key, 'DODownloadMode')