|
|
@ -18,13 +18,20 @@ if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(m |
|
|
|
variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))) |
|
|
|
variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))) |
|
|
|
|
|
|
|
|
|
|
|
def install(): |
|
|
|
def install(): |
|
|
|
filecopyto('autoconf.js',makepath(programfiles,'Mozilla Firefox','defaults','pref')) |
|
|
|
if isdir(makepath(programfiles,'Mozilla Firefox ESR')): |
|
|
|
filecopyto('override.ini',makepath(programfiles,'Mozilla Firefox')) |
|
|
|
dest=makepath(programfiles,'Mozilla Firefox ESR') |
|
|
|
|
|
|
|
elif isdir(makepath(programfiles,'Mozilla Firefox')): |
|
|
|
|
|
|
|
dest=makepath(programfiles,'Mozilla Firefox') |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
error('Firefox installation dir not found') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
filecopyto('autoconf.js',makepath(dest,'defaults','pref')) |
|
|
|
|
|
|
|
filecopyto('override.ini',dest) |
|
|
|
jinja2 = Environment( |
|
|
|
jinja2 = Environment( |
|
|
|
loader=FileSystemLoader(os.getcwd()), |
|
|
|
loader=FileSystemLoader(os.getcwd()), |
|
|
|
trim_blocks=True |
|
|
|
trim_blocks=True |
|
|
|
) |
|
|
|
) |
|
|
|
open(makepath(programfiles,'Mozilla Firefox','firefox.cfg'),'w').write( |
|
|
|
open(makepath(dest,'firefox.cfg'),'w').write( |
|
|
|
jinja2.get_template('firefox.cfg.j2').render( |
|
|
|
jinja2.get_template('firefox.cfg.j2').render( |
|
|
|
firefox_config_url = variables['firefox_config_url'], |
|
|
|
firefox_config_url = variables['firefox_config_url'], |
|
|
|
firefox_config_append_domain = variables['firefox_config_append_domain'] |
|
|
|
firefox_config_append_domain = variables['firefox_config_append_domain'] |
|
|
@ -32,15 +39,24 @@ def install(): |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
def uninstall(): |
|
|
|
def uninstall(): |
|
|
|
remove_file(makepath(programfiles,'Mozilla Firefox','defaults','pref','autoconf.js')) |
|
|
|
for dir in ['Mozilla Firefox', 'Mozilla Firefox ESR']: |
|
|
|
remove_file(makepath(programfiles,'Mozilla Firefox','override.ini')) |
|
|
|
remove_file(makepath(programfiles,dir,'defaults','pref','autoconf.js')) |
|
|
|
remove_file(makepath(programfiles,'Mozilla Firefox','firefox.cfg')) |
|
|
|
remove_file(makepath(programfiles,dir,'override.ini')) |
|
|
|
|
|
|
|
remove_file(makepath(programfiles,dir,'firefox.cfg')) |
|
|
|
|
|
|
|
|
|
|
|
def audit(): |
|
|
|
def audit(): |
|
|
|
|
|
|
|
if isdir(makepath(programfiles,'Mozilla Firefox ESR')): |
|
|
|
|
|
|
|
dest=makepath(programfiles,'Mozilla Firefox ESR') |
|
|
|
|
|
|
|
elif isdir(makepath(programfiles,'Mozilla Firefox')): |
|
|
|
|
|
|
|
dest=makepath(programfiles,'Mozilla Firefox') |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
print('Firefox installation dir not found') |
|
|
|
|
|
|
|
return "ERROR" |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
if ( |
|
|
|
not isfile(makepath(programfiles,'Mozilla Firefox','defaults','pref','autoconf.js')) or |
|
|
|
not isfile(makepath(dest,'defaults','pref','autoconf.js')) or |
|
|
|
not isfile(makepath(programfiles,'Mozilla Firefox','override.ini')) or |
|
|
|
not isfile(makepath(dest,'override.ini')) or |
|
|
|
not isfile(makepath(programfiles,'Mozilla Firefox','firefox.cfg')) |
|
|
|
not isfile(makepath(dest,'firefox.cfg')) |
|
|
|
): |
|
|
|
): |
|
|
|
print('At least one config file is missing') |
|
|
|
print('At least one config file is missing') |
|
|
|
return "ERROR" |
|
|
|
return "ERROR" |
|
|
|