Skip to content

Commit

Permalink
Download correct WSA version (#712)
Browse files Browse the repository at this point in the history
The previous script was subject to a race condition, since it searched download links for multiple versions and the last one finishing was the one used

Co-authored-by: Howard Wu <HowardWu20@outlook.com>
  • Loading branch information
ricnava00 and Howard20181 committed Oct 24, 2023
1 parent 15f5d26 commit 8548114
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions scripts/generateWSALinks.py
Expand Up @@ -144,6 +144,13 @@ def send_req(i, v, out_file_name):

threads = []
wsa_build_ver = 0
for filename, values in identities.items():
if re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", filename):
tmp_wsa_build_ver = re.search(u'\d{4}.\d{5}.\d{1,}.\d{1,}', filename).group()
if(wsa_build_ver == 0):
wsa_build_ver = tmp_wsa_build_ver
elif version.parse(wsa_build_ver) < version.parse(tmp_wsa_build_ver):
wsa_build_ver = tmp_wsa_build_ver
for filename, values in identities.items():
if re.match(f"Microsoft\.UI\.Xaml\..*_{arch}_.*\.appx", filename):
out_file_name = f"{values[1]}_{arch}.appx"
Expand All @@ -156,13 +163,8 @@ def send_req(i, v, out_file_name):
out_file = download_dir / out_file_name
elif not skip_wsa_download and re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", filename):
tmp_wsa_build_ver = re.search(u'\d{4}.\d{5}.\d{1,}.\d{1,}', filename).group()
if(wsa_build_ver == 0):
wsa_build_ver = tmp_wsa_build_ver
else:
if version.parse(wsa_build_ver) < version.parse(tmp_wsa_build_ver):
wsa_build_ver = tmp_wsa_build_ver
else:
continue
if(wsa_build_ver != tmp_wsa_build_ver):
continue
version_splitted = wsa_build_ver.split(".")
major_ver = version_splitted[0]
minor_ver = version_splitted[1]
Expand Down

0 comments on commit 8548114

Please sign in to comment.