Skip to content

Commit

Permalink
Merge pull request #178 from teeminus/update
Browse files Browse the repository at this point in the history
  • Loading branch information
teeminus authored Oct 2, 2022
2 parents 0c2bc8f + 59de5d9 commit b96f1c6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@
"//third_party/icu:icudata",
--- a/chrome/tools/build/win/create_installer_archive.py
+++ b/chrome/tools/build/win/create_installer_archive.py
@@ -172,8 +172,14 @@ def GenerateDiffPatch(options, orig_file
@@ -171,12 +171,14 @@ def GenerateDiffPatch(options, orig_file
RunSystemCommand(cmd, options.verbose)

def GetLZMAExec(build_dir):
if sys.platform == 'win32':
- lzma_exec = os.path.join(build_dir, "..", "..", "third_party",
- "lzma_sdk", "bin", "win64", "7za.exe")
+ # Taken from ungoogled-chromium's _extraction.py file, modified for Python 2
+ import winreg
+ sub_key_7zfm = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\7zFM.exe'
+
+ with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, sub_key_7zfm) as key_handle:
+ sevenzipfm_dir = winreg.QueryValueEx(key_handle, 'Path')[0]
- executable = '7za'
- if sys.platform == 'win32':
- executable += '.exe'
+ # Taken from ungoogled-chromium's _extraction.py file, modified for Python 2
+ import winreg
+ sub_key_7zfm = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\7zFM.exe'

- return os.path.join(build_dir, "..", "..", "third_party", "lzma_sdk", "bin",
- "host_platform", executable)
+ with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, sub_key_7zfm) as key_handle:
+ sevenzipfm_dir = winreg.QueryValueEx(key_handle, 'Path')[0]
+
+ lzma_exec = os.path.join(sevenzipfm_dir, "7z.exe")
elif sys.platform == 'darwin':
lzma_exec = os.path.join(build_dir, "..", "..", "third_party",
"lzma_sdk", "bin", "mac64", "7zz")
+ return os.path.join(sevenzipfm_dir, "7z.exe")

def GetPrevVersion(build_dir, temp_dir, last_chrome_installer, output_name):
if not last_chrome_installer:
2 changes: 1 addition & 1 deletion ungoogled-chromium

0 comments on commit b96f1c6

Please sign in to comment.