parent
fb16e1dfa1
commit
4326f5659e
3 changed files with 376 additions and 0 deletions
@ -0,0 +1,32 @@ |
|||||||
|
package : fws-system-settings |
||||||
|
version : 1 |
||||||
|
architecture : all |
||||||
|
section : base |
||||||
|
priority : optional |
||||||
|
maintainer : Daniel Berteaud |
||||||
|
description : General system settings |
||||||
|
depends : |
||||||
|
conflicts : |
||||||
|
maturity : DEV |
||||||
|
locale : all |
||||||
|
target_os : windows |
||||||
|
min_os_version : 5.0 |
||||||
|
max_os_version : |
||||||
|
min_wapt_version : 1.3.12 |
||||||
|
sources : |
||||||
|
installed_size : |
||||||
|
impacted_process : |
||||||
|
description_fr : |
||||||
|
description_pl : |
||||||
|
description_de : |
||||||
|
description_es : |
||||||
|
audit_schedule : 4w |
||||||
|
editor : |
||||||
|
keywords : |
||||||
|
licence : |
||||||
|
homepage : https://www.firewall-services.com/ |
||||||
|
package_uuid : |
||||||
|
signer : Daniel Berteaud |
||||||
|
signer_fingerprint: |
||||||
|
signature_date : |
||||||
|
signed_attributes : |
@ -0,0 +1,49 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from setuphelpers import * |
||||||
|
|
||||||
|
uninstallkey = [] |
||||||
|
|
||||||
|
# Service to disable |
||||||
|
disabled_services = [ |
||||||
|
'RemoteRegistry', # Remote access to reg |
||||||
|
'WMPNetworkSvc', # Windows Media Share |
||||||
|
'Mcx2Svc', # Media Center Extender |
||||||
|
'WerSvc', # Error reporting |
||||||
|
'WPCSvc', # Parental control |
||||||
|
'helpsvc', # Help service |
||||||
|
'DPS', # Windows Diag service |
||||||
|
'SysMain', # SuperFetcher |
||||||
|
] |
||||||
|
|
||||||
|
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 rv /add', accept_returncodes=[0,2]) |
||||||
|
run(r'net localgroup Administrateurs rv /add', accept_returncodes=[0,2]) |
||||||
|
|
||||||
|
print('Disabling Windows host script engine') |
||||||
|
with reg_openkey_noredir(HKEY_LOCAL_MACHINE,r'Software\Microsoft\Windows Script Host\Settings', sam=KEY_WRITE,create_if_missing=True) as reg_key: |
||||||
|
reg_setvalue(reg_key, 'Enabled', 0, REG_DWORD) |
||||||
|
if iswin64(): |
||||||
|
with reg_openkey_noredir(HKEY_LOCAL_MACHINE,r'SOFTWARE\WOW6432Node\Microsoft\Windows Script Host\Settings', sam=KEY_WRITE,create_if_missing=True) as reg_key: |
||||||
|
reg_setvalue(reg_key, 'Enabled', 0, REG_DWORD) |
||||||
|
|
||||||
|
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('Enabling Windows Host Script engine') |
||||||
|
with reg_openkey_noredir(HKEY_LOCAL_MACHINE,r'Software\Microsoft\Windows Script Host\Settings', sam=KEY_WRITE,create_if_missing=True) as reg_key: |
||||||
|
reg_setvalue(reg_key, 'Enabled', 1, REG_DWORD) |
||||||
|
if iswin64(): |
||||||
|
with reg_openkey_noredir(HKEY_LOCAL_MACHINE,r'SOFTWARE\WOW6432Node\Microsoft\Windows Script Host\Settings', sam=KEY_WRITE,create_if_missing=True) as reg_key: |
||||||
|
reg_setvalue(reg_key, 'Enabled', 1, REG_DWORD) |
Loading…
Reference in new issue