| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import base64 | 5 import base64 |
| 6 import hashlib | 6 import hashlib |
| 7 import os | 7 import os |
| 8 import string | 8 import string |
| 9 import win32api | 9 import win32api |
| 10 import win32com.client | 10 import win32com.client |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 installation directory. | 65 installation directory. |
| 66 * $CHROME_HTML_PROG_ID: 'ChromeHTML' (or 'ChromiumHTM'). | 66 * $CHROME_HTML_PROG_ID: 'ChromeHTML' (or 'ChromiumHTM'). |
| 67 * $CHROME_LONG_NAME: 'Google Chrome' (or 'Chromium'). | 67 * $CHROME_LONG_NAME: 'Google Chrome' (or 'Chromium'). |
| 68 * $CHROME_LONG_NAME_SXS: 'Google Chrome SxS' if $SUPPORTS_SXS. | 68 * $CHROME_LONG_NAME_SXS: 'Google Chrome SxS' if $SUPPORTS_SXS. |
| 69 * $CHROME_SHORT_NAME: 'Chrome' (or 'Chromium'). | 69 * $CHROME_SHORT_NAME: 'Chrome' (or 'Chromium'). |
| 70 * $CHROME_SHORT_NAME_SXS: 'ChromeCanary' if $SUPPORTS_SXS. | 70 * $CHROME_SHORT_NAME_SXS: 'ChromeCanary' if $SUPPORTS_SXS. |
| 71 * $CHROME_UPDATE_REGISTRY_SUBKEY: the registry key, excluding the root | 71 * $CHROME_UPDATE_REGISTRY_SUBKEY: the registry key, excluding the root |
| 72 key, of Chrome for Google Update. | 72 key, of Chrome for Google Update. |
| 73 * $CHROME_UPDATE_REGISTRY_SUBKEY_SXS: the registry key, excluding the | 73 * $CHROME_UPDATE_REGISTRY_SUBKEY_SXS: the registry key, excluding the |
| 74 root key, of Chrome SxS for Google Update. | 74 root key, of Chrome SxS for Google Update. |
| 75 * $LAUNCHER_UPDATE_REGISTRY_SUBKEY: the registry key, excluding the root | |
| 76 key, of the app launcher for Google Update if $SUPPORTS_SXS. | |
| 77 * $LOCAL_APPDATA: the unquoted path to the Local Application Data | 75 * $LOCAL_APPDATA: the unquoted path to the Local Application Data |
| 78 folder. | 76 folder. |
| 79 * $MINI_INSTALLER: the unquoted path to the mini_installer. | 77 * $MINI_INSTALLER: the unquoted path to the mini_installer. |
| 80 * $MINI_INSTALLER_FILE_VERSION: the file version of the mini_installer. | 78 * $MINI_INSTALLER_FILE_VERSION: the file version of the mini_installer. |
| 81 * $PROGRAM_FILES: the unquoted path to the Program Files folder. | 79 * $PROGRAM_FILES: the unquoted path to the Program Files folder. |
| 82 * $SUPPORTS_SXS: a boolean indicating whether or not SxS installs | 80 * $SUPPORTS_SXS: a boolean indicating whether or not SxS installs |
| 83 are supported by the mini_installer under test. | 81 are supported by the mini_installer under test. |
| 84 * $USER_SPECIFIC_REGISTRY_SUFFIX: the output from the function | 82 * $USER_SPECIFIC_REGISTRY_SUFFIX: the output from the function |
| 85 _GetUserSpecificRegistrySuffix(). | 83 _GetUserSpecificRegistrySuffix(). |
| 86 * $VERSION_[XP/SERVER_2003/VISTA/WIN7/WIN8/WIN8_1/WIN10]: a 2-tuple | 84 * $VERSION_[XP/SERVER_2003/VISTA/WIN7/WIN8/WIN8_1/WIN10]: a 2-tuple |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 'CHROME_CLIENT_STATE_KEY': ( | 124 'CHROME_CLIENT_STATE_KEY': ( |
| 127 'Software\\Google\\Update\\ClientState\\' | 125 'Software\\Google\\Update\\ClientState\\' |
| 128 '{8A69D345-D564-463c-AFF1-A69D9E530F96}'), | 126 '{8A69D345-D564-463c-AFF1-A69D9E530F96}'), |
| 129 'SUPPORTS_SXS': True, | 127 'SUPPORTS_SXS': True, |
| 130 'CHROME_DIR_SXS': 'Google\\Chrome SxS', | 128 'CHROME_DIR_SXS': 'Google\\Chrome SxS', |
| 131 'CHROME_LONG_NAME_SXS': 'Google Chrome SxS', | 129 'CHROME_LONG_NAME_SXS': 'Google Chrome SxS', |
| 132 'CHROME_SHORT_NAME_SXS': 'ChromeCanary', | 130 'CHROME_SHORT_NAME_SXS': 'ChromeCanary', |
| 133 'CHROME_UPDATE_REGISTRY_SUBKEY_SXS': ( | 131 'CHROME_UPDATE_REGISTRY_SUBKEY_SXS': ( |
| 134 'Software\\Google\\Update\\Clients\\' | 132 'Software\\Google\\Update\\Clients\\' |
| 135 '{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}'), | 133 '{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}'), |
| 136 'LAUNCHER_UPDATE_REGISTRY_SUBKEY': ( | |
| 137 'Software\\Google\\Update\\Clients\\' | |
| 138 '{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}') | |
| 139 }) | 134 }) |
| 140 elif mini_installer_product_name == 'Chromium Installer': | 135 elif mini_installer_product_name == 'Chromium Installer': |
| 141 self._variable_mapping.update({ | 136 self._variable_mapping.update({ |
| 142 'BINARIES_UPDATE_REGISTRY_SUBKEY': 'Software\\Chromium Binaries', | 137 'BINARIES_UPDATE_REGISTRY_SUBKEY': 'Software\\Chromium Binaries', |
| 143 'CHROME_DIR': 'Chromium', | 138 'CHROME_DIR': 'Chromium', |
| 144 'CHROME_HTML_PROG_ID': 'ChromiumHTM', | 139 'CHROME_HTML_PROG_ID': 'ChromiumHTM', |
| 145 'CHROME_LONG_NAME': 'Chromium', | 140 'CHROME_LONG_NAME': 'Chromium', |
| 146 'CHROME_SHORT_NAME': 'Chromium', | 141 'CHROME_SHORT_NAME': 'Chromium', |
| 147 'CHROME_UPDATE_REGISTRY_SUBKEY': 'Software\\Chromium', | 142 'CHROME_UPDATE_REGISTRY_SUBKEY': 'Software\\Chromium', |
| 148 'CHROME_CLIENT_STATE_KEY': 'Software\\Chromium', | 143 'CHROME_CLIENT_STATE_KEY': 'Software\\Chromium', |
| (...skipping 12 matching lines...) Expand all Loading... |
| 161 variables must be escaped with $$, otherwise a KeyError or a ValueError will | 156 variables must be escaped with $$, otherwise a KeyError or a ValueError will |
| 162 be raised. | 157 be raised. |
| 163 | 158 |
| 164 Args: | 159 Args: |
| 165 str: A string. | 160 str: A string. |
| 166 | 161 |
| 167 Returns: | 162 Returns: |
| 168 A new string created by replacing variables with their values. | 163 A new string created by replacing variables with their values. |
| 169 """ | 164 """ |
| 170 return string.Template(str).substitute(self._variable_mapping) | 165 return string.Template(str).substitute(self._variable_mapping) |
| OLD | NEW |