tis-microsoft-photos
2023.10030.27002.0-41
Microsoft Photos is a rich media experience that empowers you to do more with your photos and videos
9774 downloads
See build result See VirusTotal scan

Description
- package : tis-microsoft-photos
- name : Microsoft Windows Photos
- version : 2023.10030.27002.0-41
- categories : Utilities,Media
- maintainer : WAPT Team,Tranquil IT,Jimmy Pelé,Pierre Cosson
- installed_size : 209619175
- editor : Microsoft
- licence :
- signature_date : 2023-06-04T14:01:38.744440
- size : 289.96 Mo
- locale : all
- target_os : windows
- impacted_process : Microsoft.Photos
- architecture : all
- Homepage : https://apps.microsoft.com/store/detail/9WZDNCRFJBH4
control
package : tis-microsoft-photos
version : 2023.10030.27002.0-41
architecture : all
section : base
priority : optional
name : Microsoft Windows Photos
categories : Utilities,Media
maintainer : WAPT Team,Tranquil IT,Jimmy Pelé,Pierre Cosson
description : Microsoft Photos is a rich media experience that empowers you to do more with your photos and videos
depends :
conflicts :
maturity : PROD
locale : all
target_os : windows
min_wapt_version : 2.2
sources : https://apps.microsoft.com/store/detail/9WZDNCRFJBH4
installed_size : 209619175
impacted_process : Microsoft.Photos
description_fr : Microsoft Photos est une expérience multimédia enrichie qui vous permet d'en faire plus avec vos photos et vidéos
description_pl : Microsoft Photos to bogate doświadczenie multimedialne, które pozwala zrobić więcej ze zdjęciami i filmami
description_de : Microsoft Fotos ist ein reichhaltiges Medienerlebnis, das es Ihnen ermöglicht, mehr aus Ihren Fotos und Videos zu machen
description_es : Microsoft Photos es una experiencia multimedia enriquecida que te permite hacer más cosas con tus fotos y vídeos
description_pt : Microsoft Photos é uma experiência multimédia rica que lhe dá poder para fazer mais com as suas fotos e vídeos
description_it : Microsoft Photos è un'esperienza multimediale ricca che consente di fare di più con le foto e i video
description_nl : Microsoft Photos is een rijke media-ervaring waarmee u meer kunt doen met uw foto's en video's
description_ru : Microsoft Photos - это богатый мультимедийный опыт, который позволяет вам делать больше с вашими фотографиями и видео
audit_schedule :
editor : Microsoft
keywords :
licence :
homepage : https://apps.microsoft.com/store/detail/9WZDNCRFJBH4
package_uuid : 4677a716-014f-43b1-9476-c75d0f4376c7
valid_from :
valid_until :
forced_install_on :
changelog :
min_os_version : 10.0.17763
max_os_version : 10.0.22000.0
icon_sha256sum : 03c7e27fb44ef99dd8440cfd18e881e272766fdc4cedd1c7b2ba09076713d771
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature : gyvUY1WaTI2EL9UAnmQVQCDpOc8O3sEyBcHO60q+QiRKQ1+QrLYgixLOBK07YdTeOhu4bQx5b639igYxqHhnEGJPLabQcPd11ZFjniiPDG1xxyfOd/bciYP7HEJt6aS/Sx0PvgKf8kaz10VO2VXGiVtv3Pg3Ikx/AuNKrStdscCsssL0jO3tU/KYsxY9iQws0ZJnmomkt3/PfvS+09AO7lVLTHO4MkrrFsO7x2FRLV9q01tQot6Vj7DOh3vmm6srhXJbfiMUiLSYSVhVSJREkY9vJbBMI0XNgBqVrc6ZY90N9aT93yKm5FofdXnJmtf9WzkGVWLQggiegvNhB9EUIw==
signature_date : 2023-06-04T14:01:38.744440
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
Setup.py
# -*- coding: utf-8 -*-
from setuphelpers import *
appx_package_name = "Microsoft.Windows.Photos"
appx_dir = makepath(programfiles, "WindowsAppsInstallers")
allow_remove = False
def install():
# Declare local variables
bins_dir = control.package.split("-", 1)[1]
appx_bins_dir = makepath(appx_dir, bins_dir)
# Remove from old path
for appx_file in glob.glob(makepath(appx_dir, "%s_*" % appx_package_name)):
remove_file(appx_file)
# Placing bins for session-setup installs
if isdir(appx_bins_dir):
remove_tree(appx_bins_dir)
mkdirs(appx_bins_dir)
print(f"Creating: {appx_bins_dir}")
for f in glob.glob(bins_dir + "/*"):
filecopyto(f, appx_bins_dir)
for f in glob.glob(appx_bins_dir + "/*"):
fname = f.split(os.sep)[-1]
if control.architecture == "all":
if "x86" in glob.glob(makepath(appx_bins_dir, f"{appx_package_name}_*"))[0].split(os.sep)[-1]:
if not "x86" in fname and not "neutral" in fname:
remove_file(f)
else:
if not get_host_architecture() in fname and not "neutral" in fname:
remove_file(f)
else:
if not control.architecture in fname and not "neutral" in fname:
remove_file(f)
def session_setup():
# Declare local variables
bins_dir = control.package.split("-", 1)[1]
appx_bins_dir = makepath(appx_dir, bins_dir)
bin_path = glob.glob(makepath(appx_bins_dir, f"{appx_package_name}_*"))[0]
dependencies_pathes = ",".join([f'"{a}"' for a in glob.glob(makepath(appx_bins_dir, "*")) if not appx_package_name in a])
# Installing the UWP application in the user environment
appx_version = get_powershell_str("Get-AppxPackage -Name %s" % appx_package_name, "Version")
if not appx_version or Version(appx_version) < Version(control.get_software_version()) or force:
print("Installing: %s" % bin_path.split("\\")[-1])
killalltasks(control.get_impacted_process_list())
add_appx_cmd = f'Add-AppxPackage -Path "{bin_path}"'
if dependencies_pathes:
add_appx_cmd += f" -DependencyPath {dependencies_pathes}"
run_powershell(add_appx_cmd)
else:
print("%s is installed in correct version (%s)" % (appx_package_name, appx_version))
def uninstall():
# Declare local variables
bins_dir = control.package.split("-", 1)[1]
appx_bins_dir = makepath(appx_dir, bins_dir)
if allow_remove:
remove_appx(appx_package_name)
if isdir(appx_bins_dir):
print("Remove: %s" % (appx_bins_dir))
remove_tree(appx_bins_dir)
if dir_is_empty(appx_dir):
print("Remove: %s since it is empty" % (appx_dir))
remove_tree(appx_dir)
def get_host_architecture():
if isARM64():
return "arm64"
elif isARM():
return "arm"
elif is64():
return "x64"
elif is32():
return "x86"
update_package.py
# -*- coding: utf-8 -*-
from setuphelpers import *
import requests
try:
from setupdevhelpers import *
except:
from bs4 import BeautifulSoup
import waptguihelper
import re
import json
def update_package():
# Declaring local variables
package_updated = False
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
store_url = control.sources
if not store_url:
store_id = waptguihelper.input_dialog(
"Choice of app", "Enter the windows store app id (foundable in package url: https://apps.microsoft.com/store/apps)", store_url
).split("/")[-1]
else:
store_id = store_url.split("/")[-1]
store_id = store_id.split("?")[0]
if store_id:
url_ms = "https://apps.microsoft.com/store/detail/%s" % store_id
control.sources = url_ms
control.save_control_to_wapt()
package_prefix = control.package.split("-")[0]
selected = None
# check setup.py incase the package name doesnt match the installer file
appx_package_name = ""
with open("setup.py", "r", encoding="utf8") as f:
for line in f.readlines():
if line.startswith("appx_package_name"):
appx_package_name = line.split("=")[1].split('"')[1]
break
# Getting info from adguard api
res = requests.post(
"https://store.rg-adguard.net/api/GetFiles",
"type=ProductId&url=%s&ring=RP&lang=fr-FR" % store_id,
headers={"content-type": "application/x-www-form-urlencoded"},
proxies=proxies,
)
all_files = []
page = BeautifulSoup.BeautifulSoup(res.content, features="html.parser")
for bs_search in page.find_all("a"):
if not "BlockMap" in bs_search.text and not "eappxbundle" in bs_search.text and not "emsixbundle" in bs_search.text:
bin_name = bs_search.text.replace("~", "_")
if not isfile_has_extension(bin_name):
continue
version = bs_search.text.split("_")[1]
download_url = bs_search["href"]
pkg_splitted = re.split(r"_\d+\.", bin_name)[0]
package_name = package_prefix + "-" + pkg_splitted.split("_")[0].replace(".", "-").lower()
software_name = bin_name.split("_")[0].replace("-", " ").replace(".", " ")
package_arch = get_uwp_filename_arch(bin_name, appx_package_name)
file_dict = {
"version": version,
"bin_name": bin_name,
"package_name": package_name,
"software_name": software_name,
"package_arch": package_arch,
"download_url": download_url,
}
all_files.append(file_dict)
if (
"template-microsoft-store" in control.package
or not appx_package_name
or not len([a for a in all_files if appx_package_name in a["bin_name"]]) != 0
):
if not all_files:
error(f"API returned an empty list for URL: {url_ms}, please try again")
selected = waptguihelper.grid_dialog(
"Please select any line of the App",
json.dumps(all_files),
waptguihelper.GRT_SELECTED,
'{"columns":[{"propertyname":"version","datatype":"String","required":false,"readonly":false,"width":130},{"propertyname":"bin_name","datatype":"String","required":false,"readonly":false,"width":420},{"propertyname":"package_name","datatype":"String","required":false,"readonly":false,"width":190},{"propertyname":"software_name","datatype":"String","required":false,"readonly":false,"width":172},{"propertyname":"package_arch","datatype":"String","required":false,"readonly":false,"width":88},{"propertyname":"download_url","datatype":"String","required":false,"readonly":false,"width":1472}]}',
)
appx_package_name = selected[0]["bin_name"].split("_")[0]
def download_app_files(all_files, appx_package_name, proxies=None, ignored_versions=[]):
for app_file in all_files:
latest_bin = app_file["bin_name"]
if not latest_bin.startswith(f"{appx_package_name}_"): # ignore other files
continue
if latest_bin.split(".")[-1].lower().startswith("e"): # ignore encrypted UWP apps
continue
if any(
Version(app_file["version"], len(ignored_version.split("."))) == Version(ignored_version, len(ignored_version.split(".")))
for ignored_version in ignored_versions
):
continue
download_url = app_file["download_url"]
if download_url.split("/")[2].endswith("microsoft.com"):
if not isfile(latest_bin):
print("Downloading: %s" % latest_bin)
wget(download_url, latest_bin, proxies=proxies)
else:
print("Binary is present: %s" % latest_bin)
else:
error("ERROR: The retrieved URL will not download from Microsoft's servers")
# Downloading app files
download_app_files(all_files, appx_package_name, proxies=proxies, ignored_versions=["2017", "2018", "2019", "2020"])
# Import xmltodict for make_uwp_app_dict()
if not isfile("xmltodict.py"):
pip_download_xmltodict = "waptpython -m pip download xmltodict -d %s" % basedir
if proxies:
pip_download_xmltodict += " --proxy %s" % proxies["http"]
run(pip_download_xmltodict)
unzip(glob.glob("*.whl")[0], ".", "xmltodict.py")
remove_file(glob.glob("*.whl")[0])
import sys
sys.path.append(basedir)
# Keep app files
uwp_app_dict = make_uwp_app_dict(appx_package_name)
newer_uwp_app = get_newer_uwp_app(uwp_app_dict)
version = newer_uwp_app["Version"]
# Downloading dependency files
dependencies_to_download = []
if newer_uwp_app["Dependencies"]:
for dependency in newer_uwp_app["Dependencies"]:
dependencies_to_download.append(get_newer_uwp_depency(dependency, all_files, min_version=dependency["MinVersion"]))
if dependencies_to_download:
for dependency_file in all_files:
latest_bin = dependency_file["bin_name"]
if not True in [d in latest_bin for d in dependencies_to_download]: # ignore unecessary dependencies
continue
if control.architecture != "all":
if not control.architecture in latest_bin and not "neutral" in latest_bin:
continue
if latest_bin.split(".")[-1].lower().startswith("e"): # ignore encrypted uwp apps
continue
download_url = dependency_file["download_url"]
if download_url.split("/")[2].endswith("microsoft.com"):
if not isfile(latest_bin):
print("Downloading: %s" % latest_bin)
wget(download_url, latest_bin, proxies=proxies)
else:
print("Binary is present: %s" % latest_bin)
else:
error("ERROR: The retrieved URL will not download from microsoft's servers")
# No dependencies since it will be contained
control.depends = ""
control.save_control_to_wapt()
# Applying or asking control information if needed
set_control_os_version_uwp_app(newer_uwp_app)
ask_control_categories()
ask_control_package(
selected[0]["package_name"] if selected is not None else control.package,
"template-microsoft-store",
remove_base_files=True,
)
ask_control_name(selected[0]["software_name"] if selected is not None else control.name, "Template Microsoft Store")
ask_control_description("update_package")
# Changing setup.py appx_package_name variable
new_lines = []
with open("setup.py", "r", encoding="utf8") as f:
for line in f.readlines():
if line.startswith("appx_package_name"):
line = 'appx_package_name = "%s"\n' % appx_package_name
new_lines.append(line)
with open("setup.py", "w", encoding="utf8") as f:
f.writelines(new_lines)
# Get icon.png
icon_png = []
if "b4:Dependencies" in newer_uwp_app:
if newer_uwp_app["b4:Dependencies"]:
unzip(newer_uwp_app["FileName"], ".", newer_uwp_app["b4:Dependencies"][0]["FileName"], False)
icon_png = unzip(newer_uwp_app["b4:Dependencies"][0]["FileName"], ".", "*.targetsize-48_altform-unplated.png", False)
if not icon_png:
icon_png = unzip(newer_uwp_app["b4:Dependencies"][0]["FileName"], ".", "*.targetsize-48.png", False)
if icon_png:
shutil.move(icon_png[0], "WAPT\\icon.png")
if not icon_png:
icon_png = unzip(newer_uwp_app["FileName"], ".", "*.targetsize-48_altform-unplated.png", False)
if not icon_png:
icon_png = unzip(newer_uwp_app["FileName"], ".", "*.targetsize-48.png", False)
if icon_png:
shutil.move(icon_png[0], "WAPT\\icon.png")
[remove_file(a) for a in glob.glob("*.png")]
# Placing binaries in a dir ["appxbundle", "msixbundle", "appx", "msix]
bins_dir = control.package.split("-", 1)[1]
if isdir(bins_dir):
remove_tree(bins_dir)
mkdirs(bins_dir)
for uwp_file in glob.glob(f'{newer_uwp_app["Name"]}*{newer_uwp_app["Version"]}*.*'):
if not isfile(makepath(bins_dir, uwp_file)):
shutil.move(uwp_file, bins_dir)
if uwp_app_dict[newer_uwp_app["FileName"]]["Dependencies"] is not None:
for l in [glob.glob(a["Name"] + "_*") for a in uwp_app_dict[newer_uwp_app["FileName"]]["Dependencies"]]:
for f in l:
if not isfile(makepath(bins_dir, f)):
shutil.move(f, bins_dir)
# Removing remaining files ["appxbundle", "msixbundle", "appx", "msix]
for f in glob.glob("*.appxbundle") + glob.glob("*.msixbundle") + glob.glob("*.appx") + glob.glob("*.msix"):
remove_file(f)
# Changing version of the package
if Version(version) > Version(control.get_software_version()):
print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
package_updated = True
else:
print("Software version up-to-date (%s)" % Version(version))
control.set_software_version(version)
control.save_control_to_wapt()
# Validating or not update-package-sources
return package_updated
def get_uwp_filename_arch(appx_filename, appx_package_name=None):
if not appx_package_name:
appx_package_name = None
if len(glob.glob(f'{appx_package_name}*{appx_filename.split("_")[1]}*')) > 1:
pass
elif "arm64" in appx_filename:
return "arm64"
elif "arm" in appx_filename:
return "arm"
elif "x64" in appx_filename:
return "x64"
if appx_filename is not None and "x86" in appx_filename and (appx_package_name is None or not appx_package_name in appx_filename):
return "x86"
return "all"
def get_newer_uwp_app(uwp_app_dict, version_prefix=None, min_version=None, max_version=None, tdf_list=["Windows.Universal", "Windows.Desktop"]):
newer_version = "0"
for uwp_app in uwp_app_dict.values():
to_skip = True
if version_prefix is not None and Version(uwp_app["Version"], len(version_prefix.split("."))) != Version(
version_prefix, len(version_prefix.split("."))
):
continue
if tdf_list is not None or uwp_app["TargetDeviceFamily"] is not None:
if not uwp_app["TargetDeviceFamily"]:
continue
for tdf in tdf_list:
for uwp_app_tdf in uwp_app["TargetDeviceFamily"]:
if (
tdf == uwp_app_tdf["Name"]
and (min_version is None or Version(min_version, 3) == Version(uwp_app_tdf["MinVersion"], 3))
and (max_version is None or Version(max_version, 3) == Version(uwp_app_tdf["MaxVersionTested"], 3))
):
to_skip = False
else:
to_skip = False
if to_skip:
continue
if control.max_os_version:
if not Version(uwp_app["MinVersion"], 3) < Version(control.max_os_version, 3):
continue
if Version(newer_version) < Version(uwp_app["Version"]):
newer_uwp_app = uwp_app
newer_version = newer_uwp_app["Version"]
return newer_uwp_app
def get_newer_uwp_depency(dependency_dict, all_files_dict, version_prefix=None, min_version=None):
"""Returns a list of the bin_name of the latest required dependencies"""
newer_version = "0"
for uwp_app in all_files_dict:
if not uwp_app["bin_name"].startswith(f'{dependency_dict["Name"]}_'):
continue
if version_prefix is not None and Version(uwp_app["version"], len(version_prefix.split("."))) != Version(
version_prefix, len(version_prefix.split("."))
):
continue
if Version(newer_version) < Version(uwp_app["version"]):
newer_uwp_depency = uwp_app
newer_version = uwp_app["version"]
return newer_uwp_depency["bin_name"].split(newer_version + "_")[0] + newer_version + "_"
def make_uwp_app_dict(appx_package_name):
import xmltodict
ms_app_db = {}
# for ms_app_file in (
# glob.glob("*.appxbundle")
# + glob.glob("*.msixbundle")
# + glob.glob("*.appx")
# + glob.glob("*.msix")
# ):
for ms_app_file in (
glob.glob(f"{appx_package_name}*.appxbundle")
+ glob.glob(f"{appx_package_name}*.msixbundle")
+ glob.glob(f"{appx_package_name}*.appx")
+ glob.glob(f"{appx_package_name}*.msix")
):
data_dict = {}
before_dependencies = []
sub_dependencies = []
manifest = unzip(ms_app_file, ".", "AppxManifest.xml", False)
bundle_manifest = unzip(ms_app_file, ".", "AppxMetadata\\AppxBundleManifest.xml", False)
ms_app_info = {
"FileName": ms_app_file,
}
if not manifest:
if bundle_manifest:
with open(bundle_manifest[0], encoding="utf8") as xml_file:
data_dict = xmltodict.parse(xml_file.read(), attr_prefix="")
if type(data_dict["Bundle"]["Packages"]["Package"]) == dict:
data_dict["Bundle"]["Packages"]["Package"] = [dict(data_dict["Bundle"]["Packages"]["Package"])]
for app_pkg in list(data_dict["Bundle"]["Packages"]["Package"]):
if app_pkg["Type"] == "application":
before_dependency_info = {
"FileName": app_pkg["FileName"],
"Version": app_pkg["Version"],
"Architecture": app_pkg["Architecture"],
}
before_dependencies.append(before_dependency_info)
if before_dependencies:
for dependency in before_dependencies:
unzip(
ms_app_file,
".",
makepath(
dependency["FileName"],
),
False,
)
manifest = unzip(dependency["FileName"], ".", makepath("AppxManifest.xml"), False)
if isfile(dependency["FileName"]):
remove_file(dependency["FileName"])
with open(manifest[0], encoding="utf8") as xml_file:
dependency_data_dict = xmltodict.parse(xml_file.read(), attr_prefix="")
if "PackageDependency" in dependency_data_dict["Package"]["Dependencies"]:
sub_dependencies = list(dependency_data_dict["Package"]["Dependencies"]["PackageDependency"])
if type(dependency_data_dict["Package"]["Dependencies"]["PackageDependency"]) == dict:
sub_dependencies = [dict(dependency_data_dict["Package"]["Dependencies"]["PackageDependency"])]
if type(dependency_data_dict["Package"]["Dependencies"]["PackageDependency"]) == list:
sub_dependencies = dependency_data_dict["Package"]["Dependencies"]["PackageDependency"]
if "TargetDeviceFamily" in dependency_data_dict["Package"]["Dependencies"]:
if not "TargetDeviceFamily" in ms_app_info:
if type(dependency_data_dict["Package"]["Dependencies"]["TargetDeviceFamily"]) == dict:
ms_app_info["TargetDeviceFamily"] = [dict(dependency_data_dict["Package"]["Dependencies"]["TargetDeviceFamily"])]
if type(dependency_data_dict["Package"]["Dependencies"]["TargetDeviceFamily"]) == list:
ms_app_info["TargetDeviceFamily"] = dependency_data_dict["Package"]["Dependencies"]["TargetDeviceFamily"]
else:
error("nothing to parse")
else:
manifest = unzip(ms_app_file, ".", makepath("AppxManifest.xml"), False)
with open(manifest[0], encoding="utf8") as xml_file:
dependency_data_dict = xmltodict.parse(xml_file.read(), attr_prefix="")
if "Dependencies" in dependency_data_dict["Package"]:
if "PackageDependency" in dependency_data_dict["Package"]["Dependencies"]:
sub_dependencies = list(dependency_data_dict["Package"]["Dependencies"]["PackageDependency"])
if type(dependency_data_dict["Package"]["Dependencies"]["PackageDependency"]) == dict:
sub_dependencies = [dict(dependency_data_dict["Package"]["Dependencies"]["PackageDependency"])]
if type(dependency_data_dict["Package"]["Dependencies"]["PackageDependency"]) == list:
sub_dependencies = dependency_data_dict["Package"]["Dependencies"]["PackageDependency"]
if "TargetDeviceFamily" in dependency_data_dict["Package"]["Dependencies"]:
if not "TargetDeviceFamily" in ms_app_info:
if type(dependency_data_dict["Package"]["Dependencies"]["TargetDeviceFamily"]) == dict:
ms_app_info["TargetDeviceFamily"] = [dict(dependency_data_dict["Package"]["Dependencies"]["TargetDeviceFamily"])]
if type(dependency_data_dict["Package"]["Dependencies"]["TargetDeviceFamily"]) == list:
ms_app_info["TargetDeviceFamily"] = dependency_data_dict["Package"]["Dependencies"]["TargetDeviceFamily"]
else:
ms_app_info.update({"Dependencies": None})
if "TargetDeviceFamily" in ms_app_info:
ms_app_info.update(
{
"MinVersion": ms_app_info["TargetDeviceFamily"][0]["MinVersion"],
"MaxVersionTested": ms_app_info["TargetDeviceFamily"][0]["MaxVersionTested"],
}
)
else:
ms_app_info.update({"TargetDeviceFamily": None})
if data_dict:
ms_app_info.update(data_dict["Bundle"]["Identity"])
else:
ms_app_info.update(dependency_data_dict["Package"]["Identity"])
if "ProcessorArchitecture" in ms_app_info:
ms_app_info.update({"Architecture": ms_app_info["ProcessorArchitecture"]})
if before_dependencies:
ms_app_info["b4:Dependencies"] = before_dependencies
else:
ms_app_info.update({"b4:Dependencies": None})
if sub_dependencies:
ms_app_info["Dependencies"] = sub_dependencies
else:
ms_app_info.update({"Dependencies": None})
ms_app_db[ms_app_file] = ms_app_info
for xml_file in glob.glob("AppxManifest.xml") + glob.glob("AppxBundleManifest.xml"):
remove_file(xml_file)
return ms_app_db
def ask_control_description(blank_str=None):
"""Requesting that the user supply package description for the control.description field
Args:
blank_str (str): The description will be cleared if it includes the specified string to avoid using the template description (default: do not clear description)
"""
old_control_description = control.description
if not control.description:
control.description = waptguihelper.input_dialog("Description", "Please fill the description", "")
if blank_str is not None and blank_str in control.description:
control.description = waptguihelper.input_dialog("Description", "Please fill the description", "")
# Erase translations if description changed
if old_control_description != control.description:
for d in control.all_attributes:
if d.startswith("description_"):
control[d] = ""
# Retire dot in the end of the string
if control.description.endswith("."):
control.description = control.description.rsplit(".", 1)[0]
control.save_control_to_wapt()
return control.description
def ask_control_categories():
"""Requesting that the user supply package categories for the control.categories field if empty or Template is selected"""
if control.categories == "" or control.categories == "Template":
categories = waptguihelper.grid_dialog(
"Select package categories",
[
"Internet",
"Utilities",
"Messaging",
"Security",
"System and network",
"Media",
"Development",
"Office",
"Drivers",
"Education",
"Configuration",
"CAD",
"Template",
"Dependency",
"Extension",
],
waptguihelper.GRT_SELECTED,
)
if categories:
control.categories = ",".join([a["unknown"] for a in categories])
else:
control.categories = ""
control.save_control_to_wapt()
return control.categories
def ask_control_package(control_package=None, conditionnal_package_name=None, remove_base_files=False):
"""Requesting that the user provide a package name to be entered into the control.package field, and offering the possibility of removing the base files (icon.png and changelog.txt) for template package usage
Args:
control_package (str) : prefilled control_package (default: actual control_package)
conditionnal_package_name (str) : only ask when the control.package contains conditionnal_package_name (default: always ask for control_package)
remove_base_files (bool) : removes base files if parameter is True and conditionnal_package_name is provided (default: False)
"""
if conditionnal_package_name is None or conditionnal_package_name in control.package:
control.package = waptguihelper.input_dialog(
control.package,
"You can redefine the package name",
control_package.replace(conditionnal_package_name, "") if conditionnal_package_name is not None else control_package,
)
control.save_control_to_wapt()
# Removing template files
if conditionnal_package_name in control.package and remove_base_files:
if isfile("WAPT\\changelog.txt"):
remove_file("WAPT\\changelog.txt")
if isfile("WAPT\\icon.png"):
remove_file("WAPT\\icon.png")
return control.package
def ask_control_name(control_name=None, conditionnal_package_name=None):
"""Requesting that the user provide a package name to be entered into control.name field
Args:
control_name (str) : prefilled control_name (default: control.name)
conditionnal_package_name (str) : only ask when the control.name contains conditionnal_package_name (default: always ask for control_name)
"""
if conditionnal_package_name is None or conditionnal_package_name in control.name:
control.name = waptguihelper.input_dialog(control.name, "You can redefine the name for the self-service", control_name)
control.save_control_to_wapt()
return control.name
def set_control_os_version_uwp_app(
newer_uwp_app, force_values=False, priority_windows=WindowsVersions.Windows11, eol_windows=WindowsVersions.Windows10v2004
):
control.architecture = get_uwp_filename_arch(newer_uwp_app["FileName"], newer_uwp_app["Name"])
if newer_uwp_app["TargetDeviceFamily"] is not None:
control.min_os_version = ".".join(newer_uwp_app["MinVersion"].split(".")[:3])
# MaxVersionTested value is not reliable, no longer automatically change control.max_os_version, printing instead
if not Version(newer_uwp_app["MaxVersionTested"], 3) <= eol_windows: # Ignore end-of-life Windows versions
if (
Version(newer_uwp_app["MinVersion"], 3) < priority_windows
and Version(newer_uwp_app["MaxVersionTested"], 3) <= priority_windows
and not Version(newer_uwp_app["MinVersion"]) == Version(newer_uwp_app["MaxVersionTested"])
):
if control.max_os_version != ".".join(newer_uwp_app["MaxVersionTested"].split(".")[:3]):
if force_values:
control.max_os_version = ".".join(newer_uwp_app["MaxVersionTested"].split(".")[:3])
else:
print(
f'INFO: You may wanna change "control.max_os_version" by "{".".join(newer_uwp_app["MaxVersionTested"].split(".")[:3])}"'
)
else:
if control.max_os_version != "":
if force_values:
control.max_os_version = ""
else:
print(f'INFO: You may wanna change "control.max_os_version" by {""}')
control.save_control_to_wapt()
def isfile_has_extension(filename):
filename = filename.split(os.sep)[-1]
return "." in filename and filename.rindex(".") < len(filename) - 1
2861fd383600f5e9b2456f158f715d8407fd46967fc51577e27264448f0435a2 : setup.py
2689217ed23cfb28a3d63a076ddf6a00ab5d28f2907782cce0b9126fed457d52 : update_package.py
e8dd4ba88bb065e6c47a7aa490119eaaca1eaac13d5a2428c86ab7a1e200932d : microsoft-photos/Microsoft.VCLibs.140.00.UWPDesktop_14.0.32530.0_x64__8wekyb3d8bbwe.appx
aafd6f9ef11a2b1ddc72c44db0f5f276cde997008c2e9004a607ce853e329183 : microsoft-photos/Microsoft.VCLibs.140.00_14.0.32530.0_x64__8wekyb3d8bbwe.appx
e5a3f50abe704ff748e89fe3eee9d3f1dde0e524c9a3ecd28c03ed0d537707e6 : microsoft-photos/Microsoft.VCLibs.140.00.UWPDesktop_14.0.32530.0_arm__8wekyb3d8bbwe.appx
47de27af62a9a31d123a522c4a74056b8a10d15307de9ebead0adf684f3df45d : microsoft-photos/Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_arm64__8wekyb3d8bbwe.appx
e2cb0daaed84b542dd43e3d283f10d3ea4725b0937961e0ac2ce89173c069510 : microsoft-photos/Microsoft.Windows.Photos_2023.10030.27002.0_neutral___8wekyb3d8bbwe.appxbundle
b33c87d60a9c868ec239b7e6a62575151628f29f45e4307ef4a17298dc185008 : microsoft-photos/Microsoft.NET.Native.Framework.2.2_2.2.29512.0_arm64__8wekyb3d8bbwe.appx
70ea39797e8dd768c1788ade54fa45d9b94fd7d359a60f7d367f488cde28a9c6 : microsoft-photos/Microsoft.VCLibs.140.00_14.0.32530.0_arm__8wekyb3d8bbwe.appx
d0d184f3e05c2c989d573ccabc2f7a65d0f1ac5aa1d91e5f82aee2342c970280 : microsoft-photos/Microsoft.VCLibs.140.00.UWPDesktop_14.0.32530.0_x86__8wekyb3d8bbwe.appx
0fea426d0bc75a02bcd9528969cf19dfbe13c2cbb4e21d78380c6ce1ec78a92a : microsoft-photos/Microsoft.VCLibs.140.00_14.0.32530.0_arm64__8wekyb3d8bbwe.appx
20c07c2cff22ceb6bc3da19478c1a253b8c139eea649d90ed6159e1b00d03384 : microsoft-photos/Microsoft.VCLibs.140.00_14.0.32530.0_x86__8wekyb3d8bbwe.appx
114bbf6617820e7c9bb4f332dbd8c3bb3faf273f5da5d347219b07d3824ee672 : microsoft-photos/Microsoft.UI.Xaml.2.7_7.2208.15002.0_arm64__8wekyb3d8bbwe.appx
e4c5dff287b59e27eb9da6ccd02ed1c76d3f6001eceb0f20e71eebd507b3aad2 : microsoft-photos/Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x86__8wekyb3d8bbwe.appx
7ccf4ef1815d479570fdcf4e462bd7d80f1bc9ae3c39c93220fdb40cc0ebaca9 : microsoft-photos/Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_arm__8wekyb3d8bbwe.appx
ec7e811dca0cb511c69859c65aa1d94ccd5cc3cab3ec7f9d6bab95abb03149a8 : microsoft-photos/Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x86__8wekyb3d8bbwe.appx
27fae660d8c609e020703bb463b6601e62811dc75db19975bcb7d68d959b527d : microsoft-photos/Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe.appx
2b56a3c3c2b4642fc11a78fc893bffd5dd7cf6d7b12f39b9d16b0c6197434ae6 : microsoft-photos/Microsoft.VCLibs.140.00.UWPDesktop_14.0.32530.0_arm64__8wekyb3d8bbwe.appx
5a809587e9ddfb0000e4fd6124b8ed18ce4dd1ed111c7c970ea366f9d8129db9 : microsoft-photos/Microsoft.UI.Xaml.2.7_7.2208.15002.0_x86__8wekyb3d8bbwe.appx
c195047f4af9c3ff3d92c40e55a901cf7cfa08a679b8ca2543bb104bab2f7ff1 : microsoft-photos/Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe.appx
efa0b1396a134a654c41bd9f4b9f084a5dfe19ad6d492cd99313b0b898a0767f : microsoft-photos/Microsoft.UI.Xaml.2.7_7.2208.15002.0_x64__8wekyb3d8bbwe.appx
123af7a74e14cb3cf1b4cd794d59a48b44b9808589b2c8fb5ba810fcff176f5f : microsoft-photos/Microsoft.UI.Xaml.2.7_7.2208.15002.0_arm__8wekyb3d8bbwe.appx
bdf9c70e4966a4f7ce00ca7fc5179962239514be879f2aa3c1794076b7ff9bc6 : microsoft-photos/Microsoft.NET.Native.Framework.2.2_2.2.29512.0_arm__8wekyb3d8bbwe.appx
03c7e27fb44ef99dd8440cfd18e881e272766fdc4cedd1c7b2ba09076713d771 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
578a76d3737a2c01d93156df140189e8e3dab03ba5e8c02746bc515a7200fd0a : xmltodict.py
72a387fc3731060dd9c2286cf74635cc28de9de9ca754b9642226107852f8861 : luti.json
5d469c33ef95e5c4337cbe31ace818c487a833cc130eabe5dc95730c7b2ed94f : WAPT/control