parent
2f856da20a
commit
39586e5876
10 changed files with 517 additions and 0 deletions
@ -0,0 +1 @@ |
|||||||
|
*.msi filter=lfs diff=lfs merge=lfs -text |
@ -0,0 +1 @@ |
|||||||
|
https://support.google.com/chrome/a/answer/7679408 |
@ -0,0 +1,38 @@ |
|||||||
|
package : fws-chrome |
||||||
|
version : 78.0.3904.108-6 |
||||||
|
architecture : all |
||||||
|
section : base |
||||||
|
priority : optional |
||||||
|
name : Google Chrome |
||||||
|
categories : Internet |
||||||
|
maintainer : Daniel Berteaud <daniel@firewall-services.com> |
||||||
|
description : Google Chrome is a web browser created by Google and based on the open source project Chromium |
||||||
|
depends : |
||||||
|
conflicts : |
||||||
|
maturity : PROD |
||||||
|
locale : all |
||||||
|
target_os : windows |
||||||
|
min_os_version : 6.1 |
||||||
|
max_os_version : |
||||||
|
min_wapt_version : 1.7 |
||||||
|
sources : https://cloud.google.com/chrome-enterprise/browser/download/ |
||||||
|
installed_size : |
||||||
|
impacted_process : chrome.exe |
||||||
|
description_fr : Google Chrome est un navigateur web créé par Google et basé sur le projet open source Chromium |
||||||
|
description_pl : |
||||||
|
description_de : |
||||||
|
description_es : |
||||||
|
audit_schedule : |
||||||
|
editor : Google |
||||||
|
keywords : browser,navigateur,Google,Chrome,Chromium |
||||||
|
licence : Freeware |
||||||
|
homepage : https://www.google.com/chrome/ |
||||||
|
package_uuid : a154eb6c-cd7d-4e19-9d75-43596d8595a7 |
||||||
|
valid_from : |
||||||
|
valid_until : |
||||||
|
forced_install_on : |
||||||
|
signer : Daniel Berteaud |
||||||
|
signer_fingerprint: 3c9415559e2dedbc4390e3faa2c28d3b67265baa5b35902d2764d9e41c3b3f0a |
||||||
|
signature : tZph2uBpBxXMgtr7lxh6/Qa5U3UEaeK67CS7NAwx0/hmI9hlSmtWTPYrhOUAa6rDjTOwY1hR76ojdLlYLRK4W7yzZG0ej6QxammWEh3qzh47mHADMwXiVxzktvYfrBj/mVRjdX/G5Z0hPHqCyAlMraXZkVa9HnWqY/FNswkOyYmayEW5HTJg+K9JE8yEGnd5VAnzKqrBIXo2aTcwCDcctiNqrTEOhcrNBZfA0gcC/yHwbKkmeP3Z1zLdMOUyIazsxZ5qqfeHRzVHXAG9u1wPFaQjNJt70eMUdXZ4UlmVWTMzBNlcMJnDo65LjL+LkRiunTYVKNSUSKzG8WyS3wygmg== |
||||||
|
signature_date : 2019-11-21T11:12:26.124000 |
||||||
|
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,signer,signer_fingerprint,signature_date,signed_attributes |
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,30 @@ |
|||||||
|
{ |
||||||
|
"homepage": "{{ web_home_page }}", |
||||||
|
"homepage_is_newtabpage": false, |
||||||
|
"browser": { |
||||||
|
"show_home_button": true |
||||||
|
}, |
||||||
|
"bookmark_bar": { |
||||||
|
"show_on_all_tabs": true |
||||||
|
}, |
||||||
|
"sync_promo": { |
||||||
|
"show_on_first_run_allowed": false |
||||||
|
}, |
||||||
|
"distribution": { |
||||||
|
"skip_first_run_ui" : true, |
||||||
|
"import_bookmarks": false, |
||||||
|
"import_history": false, |
||||||
|
"import_home_page": false, |
||||||
|
"import_search_engine": false, |
||||||
|
"suppress_first_run_bubble": true, |
||||||
|
"do_not_create_desktop_shortcut": true, |
||||||
|
"do_not_create_quick_launch_shortcut": true, |
||||||
|
"do_not_launch_chrome": true, |
||||||
|
"do_not_register_for_update_launch": true, |
||||||
|
"make_chrome_default": false, |
||||||
|
"make_chrome_default_for_user": false, |
||||||
|
"suppress_first_run_default_browser_prompt": true, |
||||||
|
"system_level": true, |
||||||
|
"verbose_logging": false |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,143 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from setuphelpers import * |
||||||
|
from jinja2 import Environment, FileSystemLoader |
||||||
|
|
||||||
|
uninstallkey = [] |
||||||
|
|
||||||
|
variables = { |
||||||
|
'web_home_page': 'https://google.fr' |
||||||
|
} |
||||||
|
|
||||||
|
# Declaring specific app values (TO CHANGE) |
||||||
|
chrome_app_path=makepath(programfiles32,'Google','Chrome','Application') |
||||||
|
chrome_bin_path=makepath(chrome_app_path,'chrome.exe') |
||||||
|
bin_name = 'googlechromestandaloneenterprise64.msi' if iswin64() else 'googlechromestandaloneenterprise.msi' |
||||||
|
|
||||||
|
# Read local variables file if available |
||||||
|
if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')): |
||||||
|
print('Reading local encrypted variables file') |
||||||
|
from cryptography.fernet import Fernet |
||||||
|
import yaml |
||||||
|
f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()) |
||||||
|
variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))) |
||||||
|
|
||||||
|
def install(): |
||||||
|
print('Installing %s' % control.asrequirement()) |
||||||
|
|
||||||
|
# Specific app values |
||||||
|
package_version = control['version'].split('-',1)[0] |
||||||
|
skip = False |
||||||
|
|
||||||
|
# Getting the used storage on programfiles before installation (place it on the top) |
||||||
|
get_disk_free_space_before = get_disk_free_space(programfiles) |
||||||
|
|
||||||
|
if isfile(chrome_bin_path): |
||||||
|
if Version(get_file_properties(chrome_bin_path)['ProductVersion']) >= Version(package_version): |
||||||
|
print('File %s version is : %s ' % (chrome_bin_path,get_file_properties(chrome_bin_path)['ProductVersion'])) |
||||||
|
print('Package version is : %s ' % package_version) |
||||||
|
uninstallkey_from_file = get_msi_properties(bin_name)['ProductCode'] |
||||||
|
if uninstall_key_exists(uninstallkey_from_file): |
||||||
|
uninstallkey.append(uninstallkey_from_file) |
||||||
|
skip = True |
||||||
|
|
||||||
|
if (not skip) or (force == True) : |
||||||
|
def get_version_chrome(key): |
||||||
|
return get_file_properties(chrome_bin_path)['ProductVersion'] |
||||||
|
install_msi_if_needed(bin_name |
||||||
|
,min_version=package_version |
||||||
|
,get_version=get_version_chrome) |
||||||
|
|
||||||
|
# Disabling Google Chrome auto updates |
||||||
|
for task in ['GoogleUpdateTaskMachineCore', 'GoogleUpdateTaskMachineUA']: |
||||||
|
if task_exists(task): |
||||||
|
disable_task(task) |
||||||
|
|
||||||
|
registry_setstring(HKEY_LOCAL_MACHINE,'SOFTWARE\\Policies\\Google\\Update','UpdateDefault',0,type=REG_DWORD) |
||||||
|
registry_setstring(HKEY_LOCAL_MACHINE,'SOFTWARE\\Policies\\Google\\Update','DisableAutoUpdateChecksCheckboxValue',1,type=REG_DWORD) |
||||||
|
registry_setstring(HKEY_LOCAL_MACHINE,'SOFTWARE\\Policies\\Google\\Update','AutoUpdateCheckPeriodMinutes',0,type=REG_DWORD) |
||||||
|
if iswin64(): |
||||||
|
registry_setstring(HKEY_LOCAL_MACHINE,'SOFTWARE\\Wow6432Node\\Google\\Update','UpdateDefault',0,type=REG_DWORD) |
||||||
|
registry_setstring(HKEY_LOCAL_MACHINE,'SOFTWARE\\Wow6432Node\\Google\\Update','DisableAutoUpdateChecksCheckboxValue',1,type=REG_DWORD) |
||||||
|
registry_setstring(HKEY_LOCAL_MACHINE,'SOFTWARE\\Wow6432Node\\Google\\Update','AutoUpdateCheckPeriodMinutes',0,type=REG_DWORD) |
||||||
|
|
||||||
|
# Disabling Google Chrome telemtry |
||||||
|
registry_setstring(HKEY_LOCAL_MACHINE,'SOFTWARE\\Policies\\Explorer\\DisallowRun','chrome_telemetry','Software_Reporter_Tool.exe',type=REG_SZ) |
||||||
|
|
||||||
|
# Adding master preferences file |
||||||
|
jinja2 = Environment( |
||||||
|
loader=FileSystemLoader(os.getcwd()), |
||||||
|
trim_blocks=True |
||||||
|
) |
||||||
|
open(makepath(chrome_app_path,'master_preferences'),'w').write( |
||||||
|
jinja2.get_template('master_preferences.j2').render( |
||||||
|
web_home_page = variables['web_home_page'] |
||||||
|
) |
||||||
|
) |
||||||
|
|
||||||
|
# Return used storage of the program. (place it on the bottom) |
||||||
|
get_disk_free_space_after = get_disk_free_space(programfiles) |
||||||
|
free_space_after_diff = get_disk_free_space_before - get_disk_free_space_after |
||||||
|
print("Storage used: " + str(free_space_after_diff)) |
||||||
|
|
||||||
|
|
||||||
|
def uninstall(): |
||||||
|
print('uninstalling %s' % control.asrequirement()) |
||||||
|
|
||||||
|
if uninstall_key_exists('Google Chrome'): |
||||||
|
if not "msiexec" in ' '.join(list(uninstall_cmd('Google Chrome'))).lower(): |
||||||
|
versionsoft = get_file_properties(chrome_bin_path)['ProductVersion'] |
||||||
|
run('"%s" --uninstall --system-level --force-uninstall --qn' % makepath(install_location('Google Chrome'),versionsoft,'Installer','setup.exe'),accept_returncodes=[19]) |
||||||
|
|
||||||
|
|
||||||
|
def session_setup(): |
||||||
|
print('Session setup for %s' % control.asrequirement()) |
||||||
|
print('Disabling Telemetry') |
||||||
|
|
||||||
|
swreporter_path=makepath(user_local_appdata,'Google','Chrome','User Data','SwReporter') |
||||||
|
|
||||||
|
if isdir(swreporter_path): |
||||||
|
remove_tree(swreporter_path) |
||||||
|
|
||||||
|
|
||||||
|
def update_package(): |
||||||
|
print('Update package content from upstream binary sources') |
||||||
|
from waptpackage import PackageEntry |
||||||
|
import requests |
||||||
|
import json |
||||||
|
|
||||||
|
# Get latest version number from official website |
||||||
|
latest_version = json.loads(wgets('http://omahaproxy.appspot.com/all.json?os=win64&channel=stable'))[0]['versions'][0]['version'] |
||||||
|
pe = PackageEntry() |
||||||
|
control = pe.load_control_from_wapt(os.getcwd()) |
||||||
|
current_version = control['version'].split('-',1)[0] |
||||||
|
|
||||||
|
base_url = 'https://dl.google.com/tag/s/dl/chrome/install/' |
||||||
|
if Version(latest_version) > Version(current_version): |
||||||
|
print('Latest ' + control.name + ' version is: ' + latest_version) |
||||||
|
|
||||||
|
for file in ['googlechromestandaloneenterprise64.msi', 'googlechromestandaloneenterprise.msi']: |
||||||
|
url_dl = base_url + file |
||||||
|
|
||||||
|
# Downloading latest binaries |
||||||
|
if isfile(file): |
||||||
|
remove_file(file) |
||||||
|
|
||||||
|
print('Downloading ' + file + ' from ' + url_dl) |
||||||
|
wget(url_dl, file) |
||||||
|
|
||||||
|
pe.version = latest_version + '-0' |
||||||
|
pe.maturity = 'PREPROD' |
||||||
|
pe.save_control_to_wapt(os.getcwd()) |
||||||
|
print('Package updated to %s' % latest_version) |
||||||
|
|
||||||
|
else: |
||||||
|
print('This package is already up-to-date') |
||||||
|
for file in ['googlechromestandaloneenterprise64.msi', 'googlechromestandaloneenterprise.msi']: |
||||||
|
if not isfile(file): |
||||||
|
url_dl = base_url + file |
||||||
|
print('%s file is missing, downloading it from %s' % (file, url_dl)) |
||||||
|
wget(url_dl, file) |
||||||
|
|
||||||
|
if __name__ == '__main__': |
||||||
|
update_package() |
||||||
|
|
Loading…
Reference in new issue