From 3a2d03073e94a600a3e093dc82ad363dc195aaa0 Mon Sep 17 00:00:00 2001 From: Kevin Guerineau Date: Sun, 2 Jun 2019 18:10:59 +0200 Subject: [PATCH] Add r to registry path --- .../setup.py | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/kg-disable-access-appdiagnostics-wapt/setup.py b/kg-disable-access-appdiagnostics-wapt/setup.py index 372d2fc..a132483 100644 --- a/kg-disable-access-appdiagnostics-wapt/setup.py +++ b/kg-disable-access-appdiagnostics-wapt/setup.py @@ -3,33 +3,21 @@ from setuphelpers import * uninstallkey = [] + def install(): print('installing %s' % control.asrequirement()) - registry_set(HKEY_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics','Value','Deny') + registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics','Value','Deny') + def uninstall(): print('uninstalling %s' % control.asrequirement()) - registry_set(HKEY_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics','Value','Deny') + registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics','Value','Deny') -def session_setup(): - print('Session setup for %s' % control.asrequirement()) - # put here what to do when package is configured inside a user session - # implicit context variables are WAPT, control, user, params - -def update_package(): - print('Update package content from upstream binary sources') - # put here what to do to update package content with newer installers. - # launched with command wapt-get update-package-sources - # implicit context variables are WAPT, basedir, control, user, params, run - # if attributes in control are changed, they should be explicitly saved to package file with control.save_control_to_wapt() def audit(): print('Auditing %s' % control.asrequirement()) - if registry_readstring(HKEY_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics','Value').lower() == 'deny': + if registry_readstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics','Value').lower() == 'deny': return 'OK' else: return 'Error' -if __name__ == '__main__': - update_package() -