Página 1 de 1

[RESUELTO] Paquete para Orca

Publicado: 16 de diciembre de 2024 - 10:36
por bastien30
Buen día,

Aquí hay un paquete para Orca (editor MSI).

configuración.py:

Código: Seleccionar todo

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

"""
Package version is corresponding to Windows SDK version because :
- Orca is only distributed through Windows SDK
- Orca installer does not have a ProductVersion
- Orca does not have a public changelog
- Orca is listed in registry with Windows SDK version
"""

sdk_dir = r'winsdk'
sdk_installers_dir = makepath(sdk_dir, "Installers")
orca_bin_path = makepath(sdk_installers_dir, r'Orca-x86_en-us.msi')

def install():
    appver = control.get_software_version()
    install_msi_if_needed(orca_bin_path, min_version=appver)

def update_package():
    appver = control.get_software_version()
    url = control.sources
    binary = r'winsdksetup.exe'

    # Checking latest version of SDK from release notes -> not reliable, version seems wrong on website
    # changelog_section = bs_find(url, "div", "id", "faq-section-2")
    # for version in bs_find(changelog_section, "summary", "class", "details-summary"):
    #     latest_version = version.split("Build ")[1].split(" ")[0]

    # Download latest binary to check version
    for link in bs_find_all(url, "a", "href"):
        if r'Download the installer' in link.text:
            url_dl = link["href"]
            break
    wget(url_dl, binary)
    latest_version = get_version_from_binary(binary)

    if Version(latest_version) > Version(appver):
        print(r'Latest version is %s' % latest_version)

        # Remove old SDK directory
        if isdir(sdk_dir):
            remove_tree(sdk_dir)

        # Extract needed features to get Orca
        run(r'%s /features OptionId.MSIInstallTools /quiet /norestart /layout %s' % (binary, sdk_dir))
        while isrunning(r'winsdksetup.exer'):
            time.sleep(2)

        # Remove useless dotNetFx installer(s) to reduce package size
        for dotnet_bin in glob.glob(r'%s\dotNetFx*' % sdk_installers_dir):
            remove_file(dotnet_bin)

        # Changing version of the package
        control.version = '%s-%s'%(latest_version, control.version.split('-')[-1])
        control.save_control_to_wapt()
        print('Changing version to: %s in WAPT\\control' % control.version)
    else:
        print("Already up to date")

    # Remove useless installer
    remove_file(binary)
control:

Código: Seleccionar todo

package           : xxx-orca
version           : 10.1.26100.1742-0
architecture      : all
section           : base
priority          : optional
name              : Orca
categories        : System and network
maintainer        : XXXX
description       : Orca est un éditeur de tables de base de données permettant de créer et d'éditer des packages Windows Installer (MSI) et des modules de fusion. L'outil fournit une interface graphique pour la validation, mettant en évidence les entrées particulières où se produisent des erreurs de validation ou des avertissements. (upok)
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 
sources           : https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/
installed_size    : 
impacted_process  : orca
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : Microsoft
keywords          : 
licence           : proprietary_free
homepage          : https://learn.microsoft.com/en-us/windows/win32/msi/orca-exe
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 

Re: [RESUELTO] Paquete para Orca

Publicado: 17 de diciembre de 2024 - 16:36
por fschelfaut
Hola Bastien,

¡gracias por compartir el código!

He añadido Orca a la tienda WAPT; estará disponible en 5 días.
Mientras tanto, puedes encontrar la versión de preproducción aquí

, Flavien.