| 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. |
| 75 * $LOCAL_APPDATA: the unquoted path to the Local Application Data | 77 * $LOCAL_APPDATA: the unquoted path to the Local Application Data |
| 76 folder. | 78 folder. |
| 77 * $MINI_INSTALLER: the unquoted path to the mini_installer. | 79 * $MINI_INSTALLER: the unquoted path to the mini_installer. |
| 78 * $MINI_INSTALLER_FILE_VERSION: the file version of the mini_installer. | 80 * $MINI_INSTALLER_FILE_VERSION: the file version of the mini_installer. |
| 79 * $PROGRAM_FILES: the unquoted path to the Program Files folder. | 81 * $PROGRAM_FILES: the unquoted path to the Program Files folder. |
| 80 * $SUPPORTS_SXS: a boolean indicating whether or not SxS installs | 82 * $SUPPORTS_SXS: a boolean indicating whether or not SxS installs |
| 81 are supported by the mini_installer under test. | 83 are supported by the mini_installer under test. |
| 82 * $USER_SPECIFIC_REGISTRY_SUFFIX: the output from the function | 84 * $USER_SPECIFIC_REGISTRY_SUFFIX: the output from the function |
| 83 _GetUserSpecificRegistrySuffix(). | 85 _GetUserSpecificRegistrySuffix(). |
| 84 * $VERSION_[XP/SERVER_2003/VISTA/WIN7/WIN8/WIN8_1/WIN10]: a 2-tuple | 86 * $VERSION_[XP/SERVER_2003/VISTA/WIN7/WIN8/WIN8_1/WIN10]: a 2-tuple |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 'CHROME_SHORT_NAME': 'Chrome', | 122 'CHROME_SHORT_NAME': 'Chrome', |
| 121 'CHROME_UPDATE_REGISTRY_SUBKEY': ( | 123 'CHROME_UPDATE_REGISTRY_SUBKEY': ( |
| 122 'Software\\Google\\Update\\Clients\\' | 124 'Software\\Google\\Update\\Clients\\' |
| 123 '{8A69D345-D564-463c-AFF1-A69D9E530F96}'), | 125 '{8A69D345-D564-463c-AFF1-A69D9E530F96}'), |
| 124 'SUPPORTS_SXS': True, | 126 'SUPPORTS_SXS': True, |
| 125 'CHROME_DIR_SXS': 'Google\\Chrome SxS', | 127 'CHROME_DIR_SXS': 'Google\\Chrome SxS', |
| 126 'CHROME_LONG_NAME_SXS': 'Google Chrome SxS', | 128 'CHROME_LONG_NAME_SXS': 'Google Chrome SxS', |
| 127 'CHROME_SHORT_NAME_SXS': 'ChromeCanary', | 129 'CHROME_SHORT_NAME_SXS': 'ChromeCanary', |
| 128 'CHROME_UPDATE_REGISTRY_SUBKEY_SXS': ( | 130 'CHROME_UPDATE_REGISTRY_SUBKEY_SXS': ( |
| 129 'Software\\Google\\Update\\Clients\\' | 131 'Software\\Google\\Update\\Clients\\' |
| 130 '{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}') | 132 '{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}'), |
| 133 'LAUNCHER_UPDATE_REGISTRY_SUBKEY': ( |
| 134 'Software\\Google\\Update\\Clients\\' |
| 135 '{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}') |
| 131 }) | 136 }) |
| 132 elif mini_installer_product_name == 'Chromium Installer': | 137 elif mini_installer_product_name == 'Chromium Installer': |
| 133 self._variable_mapping.update({ | 138 self._variable_mapping.update({ |
| 134 'BINARIES_UPDATE_REGISTRY_SUBKEY': 'Software\\Chromium Binaries', | 139 'BINARIES_UPDATE_REGISTRY_SUBKEY': 'Software\\Chromium Binaries', |
| 135 'CHROME_DIR': 'Chromium', | 140 'CHROME_DIR': 'Chromium', |
| 136 'CHROME_HTML_PROG_ID': 'ChromiumHTM', | 141 'CHROME_HTML_PROG_ID': 'ChromiumHTM', |
| 137 'CHROME_LONG_NAME': 'Chromium', | 142 'CHROME_LONG_NAME': 'Chromium', |
| 138 'CHROME_SHORT_NAME': 'Chromium', | 143 'CHROME_SHORT_NAME': 'Chromium', |
| 139 'CHROME_UPDATE_REGISTRY_SUBKEY': 'Software\\Chromium', | 144 'CHROME_UPDATE_REGISTRY_SUBKEY': 'Software\\Chromium', |
| 140 'SUPPORTS_SXS': False | 145 'SUPPORTS_SXS': False |
| (...skipping 11 matching lines...) Expand all Loading... |
| 152 variables must be escaped with $$, otherwise a KeyError or a ValueError will | 157 variables must be escaped with $$, otherwise a KeyError or a ValueError will |
| 153 be raised. | 158 be raised. |
| 154 | 159 |
| 155 Args: | 160 Args: |
| 156 str: A string. | 161 str: A string. |
| 157 | 162 |
| 158 Returns: | 163 Returns: |
| 159 A new string created by replacing variables with their values. | 164 A new string created by replacing variables with their values. |
| 160 """ | 165 """ |
| 161 return string.Template(str).substitute(self._variable_mapping) | 166 return string.Template(str).substitute(self._variable_mapping) |
| OLD | NEW |