Clean source code. Add r in registry path

This commit is contained in:
Kevin Guerineau
2019-06-02 18:31:53 +02:00
parent 6742aa2222
commit 57b3814fa7
+5 -20
View File
@@ -5,32 +5,17 @@ uninstallkey = []
def install(): def install():
print('installing %s' % control.asrequirement()) print('installing %s' % control.asrequirement())
registry_set(HKEY_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam','Value','Deny') registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam','Value','Deny')
def uninstall(): def uninstall():
print('uninstalling %s' % control.asrequirement()) print('uninstalling %s' % control.asrequirement())
registry_set(HKEY_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam','Value','Allow') registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam','Value','Allow')
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 <path-to-wapt-directory>
# 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(): def audit():
print('Auditing %s' % control.asrequirement()) print('Auditing %s' % control.asrequirement())
if registry_readstring(HKEY_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam','Value').lower() == 'deny': if registry_readstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam','Value').lower() == 'deny':
return 'OK' return 'OK'
else: else:
return 'Error' return 'Error'
if __name__ == '__main__':
update_package()