tis-microsoft-office-2024-professional icon

Office LTSC Professional Plus 2024

Silent install package for Office LTSC Professional Plus 2024

16.0.17932.20540-16

package           : tis-microsoft-office-2024-professional
version           : 16.0.17932.20540-16
architecture      : x64
section           : base
priority          : optional
name              : Office LTSC Professional Plus 2024
categories        : Office
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ,Clément Baziret,Flavien Schelfaut
description       : Microsoft Office 2024 is a version of the Microsoft Office suite
depends           : 
conflicts         : tis-microsoft-access-2016-runtime,tis-microsoft-office-2016,tis-microsoft-office-2013,tis-microsoft-office-365-entreprise,tis-microsoft-office-2019-professional,tis-microsoft-office-2021-professional
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.3
sources           : https://www.microsoft.com/download/details.aspx?id=49117
installed_size    : 2362231960
impacted_process  : EXCEL,GROOVE,MSACCESS,MSPUB,ONENOTE,OUTLOOK,POWERPNT,WINWORD
description_fr    : Microsoft Office 2024 est une version de la suite Microsoft Office
description_pl    : Microsoft Office 2024 to wersja pakietu biurowego Microsoft Office
description_de    : Microsoft Office 2024 ist eine Version der Microsoft Office-Suite
description_es    : Microsoft Office 2024 es una versión del paquete Microsoft Office
description_pt    : O Microsoft Office 2024 é uma versão do pacote Microsoft Office
description_it    : Microsoft Office 2024 è una versione della suite Microsoft Office
description_nl    : Microsoft Office 2024 is een versie van de Microsoft Office-suite
description_ru    : Microsoft Office 2024 - это версия пакета Microsoft Office
audit_schedule    : 
editor            : Microsoft
keywords          : microsoft,office,2024,version,suite
licence           : proprietary_restricted,wapt_public
homepage          : https://www.office.com/
package_uuid      : 0d81079d-f3a3-4148-afeb-e2e075898e62
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 10.0
max_os_version    : 
icon_sha256sum    : 2ac98141bf5b6777083f2bcbeab3ab034c01dff77718e108774575aaaa54a144
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-09-10T03:41:11.000000
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
signature         : t385ZEbQLtuX8Xf9UPE9c0uJSPPVgz9J4Imd7VsH3LXq5xG1Sxg401FPxwWsdjligDawHycE69N8I0eDyIaoXhO/+RtWBv8rHmA0rB3hwibC23GrmUDbMWnnIRiIkYYKlN5IYlibjtJODRrs2AzBevLxrOsyR5+gIPc9ZeXfDdffWQEqAXMKsQ09wNH9FRt45bgLogPO6ycLOriq14U4kX3I4m9nA55kYvZCd1wGCtUnSl1bI+Al3d5YxulekEtDGp+fvFO5N5NEBxGAM1IyIXQCrIP/c7jjpJzlxFsPyZgZWvY+kpWYKTDI/sbL9IfkletyPEGskC5c8A564nFe2g==

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *
import tempfile

""" 
Ressources:
https://config.office.com/deploymentsettings
https://admx.help/?Category=Office2016&Policy=office16.Office.Microsoft.Policies.Windows::L_SCLCacheOverride
https://admx.help/?Category=Office2016&Policy=excel16.Office.Microsoft.Policies.Windows::L_SaveExcelfilesas

Office 2024 Deploy:
https://learn.microsoft.com/en-us/office/ltsc/2024/deploy
"""

app_uninstallkey = "ProPlus2024Volume - fr-fr"


def install():
    # Declaring local variables
    package_version = control.get_software_version()
    silentflags = "/configure configuration.xml"

    # uninstalling older versions of office if needed
    uninstall_mso2013_if_needed("Office15.STANDARD")
    uninstall_mso2016_if_needed("Office16.STANDARD")
    uninstall_other_office_edition(app_uninstallkey.split(" ")[0])

    # Installing the software
    install_exe_if_needed(
        "setup.exe",
        silentflags=silentflags,
        timeout=1200,
        accept_returncodes=[1641, 3010, 0],
        key=app_uninstallkey,
        min_version=package_version,
    )

    # TODO "setup.exe /customize configuration.xml if up-to-date"

    # Adding silent uninstall command
    quiet_uninstall = installed_softwares(uninstallkey=app_uninstallkey)[0]["uninstall_string"] + " DisplayLevel=False"
    if "OfficeClickToRun.exe" in quiet_uninstall:
        register_uninstall(
            uninstallkey=app_uninstallkey,
            quiet_uninstall_string=quiet_uninstall,
        )


def session_setup():
    print("Disabling: MSO telemetry")
    # https://admx.help/?Category=Office2016&Policy=office16.Office.Microsoft.Policies.Windows::L_OfficeOSMPreventedHostApplications
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedapplications", "wdsolution", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedapplications", "xlsolution", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedapplications", "pptsolution", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedapplications", "olksolution", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedapplications", "accesssolution", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedapplications", "projectsolution", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedapplications", "publishersolution", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedapplications", "visiosolution", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedapplications", "onenotesolution", 1)
    # https://admx.help/?Category=Office2016&Policy=office16.Office.Microsoft.Policies.Windows::L_OfficeOSMPreventedSolutionTypes
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedsolutiontypes", "documentfiles", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedsolutiontypes", "templatefiles", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedsolutiontypes", "comaddins", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedsolutiontypes", "appaddins", 1)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm\preventedsolutiontypes", "agave", 1)
    # https://admx.help/?Category=Office2016&Policy=office16.Office.Microsoft.Policies.Windows::L_EnableLogging
    # registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm", "enablelogging", 0)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm", "enableupload", 0)
    registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\osm", "enablefileobfuscation", 1)
    # # https://admx.help/?Category=Office2016&Policy=office16.Office.Microsoft.Policies.Windows::L_Onlinecontentoptions
    # registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\common\internet", "useonlinecontent", 0)
    # # https://admx.help/?Category=Office2016&Policy=office16.Office.Microsoft.Policies.Windows::L_ServiceLevelOptions
    # registry_set(HKEY_CURRENT_USER, r"software\policies\microsoft\office\16.0\common\internet", "serviceleveloptions", 0)


def uninstall_other_office_edition(edition_uninstallkey):
    # Initializing variables
    silent_uninstall_file_path = makepath(tempfile.gettempdir(), "remove_other_office.xml")
    uninstall_configuration_xml_content = r"""<Configuration>
    <Remove All="TRUE">
    </Remove>
    <Display Level="none" CompletionNotice="No" SuppressModal="Yes" AcceptEula="Yes" />
    <Setting Id="SETUP_REBOOT" Value="Never" />
    <Setting Id="REBOOT" Value="ReallySuppress"/>
</Configuration>
"""
    # Modify XML
    with open(silent_uninstall_file_path, "w") as xml_file:
        xml_file.write(uninstall_configuration_xml_content)

    # Uninstalling Office if needed
    for to_uninstall in installed_softwares():
        killalltasks(control.get_impacted_process_list())
        if ("OfficeClickToRun.exe" in to_uninstall["uninstall_string"]) and not (edition_uninstallkey in to_uninstall["key"]):
            print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
            app_uninstall_cmd = to_uninstall["uninstall_string"] + " DisplayLevel=False"
            run(app_uninstall_cmd)
            wait_uninstallkey_absent(to_uninstall["key"])


def uninstall_mso2016_if_needed(uninstallkey):
    # Initializing variables
    silent_uninstall_file_path = makepath(tempfile.gettempdir(), "remove_o2016.xml")
    uninstall_configuration_xml_content = r"""<Configuration>
    <Remove All="TRUE">
    </Remove>
    <Display Level="none" CompletionNotice="No" SuppressModal="Yes" AcceptEula="Yes" />
    <Setting Id="SETUP_REBOOT" Value="Never" />
    <Setting Id="REBOOT" Value="ReallySuppress"/>
</Configuration>
"""
    # Modify XML
    with open(silent_uninstall_file_path, "w") as xml_file:
        xml_file.write(uninstall_configuration_xml_content)

    # Uninstalling Office if needed
    for to_uninstall in installed_softwares(uninstallkey=uninstallkey):
        print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
        killalltasks(control.get_impacted_process_list())
        if "OfficeClickToRun.exe" in to_uninstall["uninstall_string"]:
            app_uninstall_cmd = to_uninstall["uninstall_string"] + " DisplayLevel=False"
            run(app_uninstall_cmd)
            wait_uninstallkey_absent(to_uninstall["key"])
        else:
            run(to_uninstall["uninstall_string"] + ' /config "%s"' % silent_uninstall_file_path)
            wait_uninstallkey_absent(to_uninstall["key"])


def uninstall_mso2013_if_needed(uninstallkey):
    # Initializing variables
    silent_uninstall_file_path = makepath(tempfile.gettempdir(), "remove_o2013.xml")
    uninstall_configuration_xml_content = r"""<Configuration>
    <Remove All="TRUE">
    </Remove>
    <Display Level="none" CompletionNotice="No" SuppressModal="Yes" AcceptEula="Yes" />
    <Setting Id="SETUP_REBOOT" Value="Never" />
    <Setting Id="REBOOT" Value="ReallySuppress"/>
</Configuration>
"""
    # Modify XML
    with open(silent_uninstall_file_path, "w") as xml_file:
        xml_file.write(uninstall_configuration_xml_content)

    # Uninstalling Office if needed
    for to_uninstall in installed_softwares(uninstallkey=uninstallkey):
        print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
        killalltasks(control.get_impacted_process_list())
        run(to_uninstall["uninstall_string"] + ' /config "%s"' % silent_uninstall_file_path)
        wait_uninstallkey_absent(to_uninstall["key"])

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *
import waptguihelper
import webbrowser
import os


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    extract_path = "extract"

    # if not the first run it will use the last setup downloaded if you want to get an updated one you can remove setup.exe and relaunch the update package
    if not isfile("setup.exe") and not params.get("running_as_luti"):
        waptguihelper.message_dialog(
            "You browser will open",
            "Please download Office Deployment Tool by clicking the download button",
        )
        webbrowser.open("https://www.microsoft.com/download/details.aspx?id=49117")
        waptguihelper.message_dialog("Waiting for download", "Click OK when the download is complete", waptguihelper.ID_OK)
        # Copy to pkg
        latest_bin = waptguihelper.filename_dialog(
            "Please provide downloaded Office Deployment Tool to copy in this package",
            makepath(user_home_directory, "Downloads"),
            "",
            "EXE Files|*.exe",
        )

        # Extract Office Deployment Tool
        print("Copying: " + latest_bin)
        run(rf'"{latest_bin}" /extract:"{extract_path}" /quiet"')

        print("Extract Office Deployment Tool")
        filecopyto(".\\extract\\setup.exe", basedir)
        remove_file(latest_bin)
        if isdir("extract"):
            remove_tree("extract")

    elif params.get("running_as_luti"):
        user_agent =  'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/88.0'
        data = [ u for u in json.loads(wgets('https://www.microsoft.com/en-us/download/details.aspx?id=49117',user_agent=user_agent,proxies=proxies).split('<script>window.__DLCDetails__=',1)[1].split('</script>')[0])["dlcDetailsView"]['downloadFile'] if u['name'].endswith('.exe')][0]
        download_url = data['url']
        latest_bin = download_url.split("/")[-1]
        wget(download_url, latest_bin, proxies=proxies)

        # Extract Office Deployment Tool
        print("Copying: " + latest_bin)
        run(rf'"{latest_bin}" /extract:"{extract_path}" /quiet"')

        print("Extract Office Deployment Tool")
        filecopyto(".\\extract\\setup.exe", basedir)
        remove_file(latest_bin)
        if isdir("extract"):
            remove_tree("extract")

    # if not the first run it will use the last XML used if you want to get a new one you can remove configuration.xml and relaunch the update package
    if not isfile("configuration.xml"):
        waptguihelper.message_dialog(
            "Your browser will open",
            "Please complete your deployment settings with the online Office Customization Tool and download it by clicking Export.\nNote that you can go back anytime on the online tool to edit your configuration (by clicking Import)",
        )
        webbrowser.open("https://config.office.com/deploymentsettings")
        waptguihelper.message_dialog("Waiting for download", "Click OK when the XML is completed and downloaded", waptguihelper.ID_OK)
        xml_configuration = waptguihelper.filename_dialog(
            "Please select your XML configuration file", basedir, "configuration.xml", "XML Files|*.xml"
        )  # makepath(user_home_directory, "Downloads")
        if not isfile("configuration.xml"):
            filecopyto(
                xml_configuration,
                basedir + "\\configuration.xml",
            )

    # Asking to remove the last downloaded sources
    if isdir("Office"):
        if not params.get("running_as_luti"):
            response = ask_message(control.package, "Do you want to remove the last downloaded sources?", 35)
            if response == 6:
                print("Removing last sources folder downloaded")
                remove_tree("Office")
        else:
            print("Removing last sources folder downloaded")
            remove_tree("Office")
    else:
        # Download Office with XML configuration
        print("Downloading Office with XML configuration")
        if windows_version() >= WindowsVersions.Windows10:
            run("setup.exe /download configuration.xml", timeout=2400)  # DisplayLevel=Full # not working
        else:
            error("MSO setup.exe can no longer be run on this OS")

    # Getting version from source dir
    version = glob.glob("Office/Data/**/")[0].split(os.sep)[1]

    # Changing version of the package
    if Version(version, 4) > Version(control.get_software_version(), 4):
        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()

    # Getting Product ID and Language ID from configuration.xml parsing file
    with open("configuration.xml", "r", encoding="utf8") as f:
        for line in f:
            if "OfficeClientEdition" in line:
                architecture = line.split('"')[1]
                print("OfficeClientEdition: %s" % architecture)
                if architecture == "64":
                    architecture = "x64"
                else:
                    architecture = "all"
            if "Product ID" in line:
                product_id = line.split('"')[1]
                print("Product ID: %s" % product_id)
            if "Language ID" in line:
                language_id = line.split('"')[1]
                print("Language ID: %s" % language_id)
                break

    if control.architecture != architecture:
        control.architecture = architecture
        control.save_control_to_wapt()

    # Asking pkg infos if needed
    if control.locale not in language_id and "-template" in control.package:
        control.locale = waptguihelper.input_dialog(control.package, "You may wanna change locale to: %s" % language_id.split("-")[0], "all")
        print("Changing locale to: %s in WAPT\\control" % control.locale)
        control.save_control_to_wapt()

    complete_control_categories(control)
    complete_control_name(control, control.name, params.get("running_as_luti"))
    complete_control_package(control, control.package, params.get("running_as_luti"), False)
    complete_control_description(control, control.description, params.get("running_as_luti"), "update_package")

    # changing uninstallkey:
    new_lines = []
    with open("setup.py", "r", encoding="utf8") as f:
        for line in f.readlines():
            if line.startswith("app_uninstallkey"):
                line = f'app_uninstallkey = "{product_id} - {language_id}"\n'
                print(f'uninstallkey in setup updated to app_uninstallkey = "{product_id} - {language_id}"\n')
            new_lines.append(line)
    with open("setup.py", "w", encoding="utf8", newline="\n") as f:
        f.writelines(new_lines)

    # Validating or not update-package-sources
    return package_updated

c100dd6fe6c67d7c1d72cbcb5a4a0a3d90bf01a8389fce7418ebac4d454ace93 : Office/Data/16.0.17932.20540/a640_exp.cab
9e25adeb0a1ceaef5107433e12f288d21435d545a07fd50e8cc310f11ef1b5d0 : Office/Data/16.0.17932.20540/i640.cab
6200cd1b860781b4f73280f8838298d097cb61193f4ad83b90b9e02aa8265c4a : Office/Data/16.0.17932.20540/i640.cab.cat
0f6a6c06b2ff7c0d1c776ccb63582e495218a3652a7cb86e2f097b0e60c9d13e : Office/Data/16.0.17932.20540/i641036.cab
632c8a868716b156d91e0bfbf73a9efdec50269facfa2817e3a1fb1ccf191390 : Office/Data/16.0.17932.20540/s640.cab
5ae0b2e4a4cb526a158e8e96e7ef5930a60de94d4a7c46f1781bd7d9408c7e4c : Office/Data/16.0.17932.20540/s641036.cab
b8ebfdaf764c8e664946fffb77891c5b1355bae8ffe606ae9a4d9f84487097b2 : Office/Data/16.0.17932.20540/stream.x64.fr-fr.dat
06e4bff05407b2e61d7dfffe17ce9f638ee5f224ed45cd0bbaa286925ff5bee8 : Office/Data/16.0.17932.20540/stream.x64.fr-fr.dat.cat
79d1028c0744cd7377855ac670ca71a0dbb98dc71d0ce53210e12eaa8fe8cc67 : Office/Data/16.0.17932.20540/stream.x64.x-none.dat
a5b4cd81a48e7a8ba95e50e36fbbf2b7a6531890bb2aa8f09dd26f164a600a73 : Office/Data/16.0.17932.20540/stream.x64.x-none.dat.cat
42adb5388afc7e97cbdae42f9957449a69e2916211c159f5c1c1692fb239b307 : Office/Data/v64.cab
42adb5388afc7e97cbdae42f9957449a69e2916211c159f5c1c1692fb239b307 : Office/Data/v64_16.0.17932.20540.cab
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
574defb499739fec8cbc3c9d3003be776458188bf4adc7fe89cf90799eeb342f : WAPT/control
2ac98141bf5b6777083f2bcbeab3ab034c01dff77718e108774575aaaa54a144 : WAPT/icon.png
a2cc0768f5cd836cd5952348c83b54394298d2725f344163f93cda0adfe9794d : configuration.xml
3070ca977316578cd951f2da837dad94ea5e021710d7a0c6d9dd8f4384db1f17 : luti.json
53e21c6cca1c3d9f54a7804ba05709e57b404823281e65d6dd4383f9d5bad9de : setup.exe
8eecbef0647860ce74ffc6718b9c694ed4014d1ed8ddbe600896e9ad6937eb8a : setup.py
ff3eca9f30b2ddbc22eb722c7fa58cf21eb30c24b0676118b0e8ee87f4a04360 : update_package.py