General system settings for WAPT
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

setup.py 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # -*- coding: utf-8 -*-
  2. from setuphelpers import *
  3. uninstallkey = []
  4. # Service to disable
  5. disabled_services = [
  6. 'Mcx2Svc', # Media Center Extender
  7. 'WerSvc', # Error reporting
  8. 'WPCSvc', # Parental control
  9. 'helpsvc', # Help service
  10. 'diagnosticshub.standardcollector.service', # Microsoft (R) Diagnostics Hub Standard Collector Service
  11. 'DiagTrack', # Diagnostics Tracking Service
  12. 'dmwappushservice', # WAP Push Message Routing Service (see known issues)
  13. 'HomeGroupListener', # HomeGroup Listener
  14. 'HomeGroupProvider', # HomeGroup Provider
  15. 'lfsvc', # Geolocation Service
  16. 'MapsBroker', # Downloaded Maps Manager
  17. 'NetTcpPortSharing', # Net.Tcp Port Sharing Service
  18. 'RemoteAccess', # Routing and Remote Access
  19. 'RemoteRegistry', # Remote Registry
  20. 'SharedAccess', # Internet Connection Sharing (ICS)
  21. 'TrkWks', # Distributed Link Tracking Client
  22. 'WMPNetworkSvc', # Windows Media Player Network Sharing Service
  23. 'XblAuthManager', # Xbox Live Auth Manager
  24. 'XblGameSave', # Xbox Live Game Save Service
  25. 'XboxNetApiSvc' # Xbox Live Networking Service
  26. ]
  27. def install():
  28. print('Disabling unwanted services')
  29. for service in disabled_services:
  30. print(' Disabling %s' % service)
  31. run(r'sc config %s start= disabled' % service, accept_returncodes=[0,1060])
  32. print('Enabling ping response')
  33. run(r'netsh firewall set icmpsetting 8 enable')
  34. print('Create our local adamin account')
  35. run(r'net user rv /add', accept_returncodes=[0,2])
  36. run(r'net localgroup Administrateurs rv /add', accept_returncodes=[0,2])
  37. if windows_version() > Version('10'):
  38. print('Disabling P2P updates delivery')
  39. registry_setstring(HKEY_LOCAL_MACHINE, r'SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization', 'DODownloadMode', 0, REG_DWORD)
  40. print('Disabling Cortana')
  41. registry_set(HKEY_LOCAL_MACHINE, r'SOFTWARE\Policies\Microsoft\Windows\Windows Search', r'AllowCortana', 0, REG_DWORD)
  42. remove_metroapp('Microsoft.Windows.Cortana')
  43. print('Install custom logo')
  44. filecopyto('waptexit-logo.png',makepath(programfiles32,'wapt','templates'))
  45. def uninstall():
  46. print('Re enabling services')
  47. for service in disabled_services:
  48. print(' Enabling %s' % service)
  49. run(r'sc config %s start= auto' % service, accept_returncodes=[0,1060])
  50. print('Removing DeliveryOptimization settings')
  51. with reg_openkey_noredir(HKEY_LOCAL_MACHINE, r'SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization', sam=KEY_WRITE) as reg_key:
  52. reg_delvalue(reg_key, 'DODownloadMode')