[RESOLVED] Pronote Client Package preview v2023 build 0.1.1

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
olaplanche
Messages: 178
Registration: January 26, 2017 - 11:11

July 7, 2023 - 2:12 PM

Good morning,

I'm sharing my package for the Pronote v2023 x64 client:

:!: Remember to replace the SERVERNAME, SERVERPORT and NOMETAB variables with your values
The new code automatically handles the possible presence of the previous version as well as the def update_package() function to simplify the update.
Using the same code, it is therefore possible to install the latest version side-by-side with the previous version seamlessly.
To uninstall the previous version, you must therefore use the uninstall function of the package of the previous version. :!:

setup.py:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
import platform

uninstallkey = []

# Defining variables
bin_contains = "Install_PRNclient_FR_"
app_uninstallkey = "{02871376-45F6-4642-9D84-C7681ABE361F}"
edition = "v2023.0"
SERVERNAME = "RNE.index-education.net"  # Le nom DNS du serveur pronote
SERVERPORT = "49300"  # Le port TCP du serveur pronote
NOMETAB = "MonETAB"  # Utilisé pour personnaliser le nom du raccourci sur le bureau


def install():
    # Initializing variables
    package_version = control.version.split("-", 1)[0]
    bin_name = glob.glob("*%s*.exe" % bin_contains)[0]
    edition_old = str(int(edition[1:5]) - 1)

    print("Installing: %s" % bin_name)
    import tempfile
    import codecs

    pathinstallfile = makepath(tempfile.gettempdir(), "Setup.iss")
    if installed_softwares("INDEX EDUCATION - Client PRONOTE %s - 64bit" % edition_old):
        data = r"""[InstallShield Silent]
Version=v7.00
File=Response File
[File Transfer]
OverwrittenReadOnly=NoToAll
[%s-DlgOrder]
Dlg0=%s-SdLicense2Rtf-0
Count=6
Dlg1=%s-SdAskDestPath-0
Dlg2=%s-AskOptions-0
Dlg3=%s-AskOptions-1
Dlg4=%s-AskOptions-2
Dlg5=%s-SdFinish-0
[%s-SdLicense2Rtf-0]
Result=1
[%s-SdAskDestPath-0]
szDir=C:\Program Files\Index Education\Pronote %s\Réseau\Client
Result=1
[%s-AskOptions-0]
Result=1
Sel-0=0
[%s-AskOptions-1]
Result=1
Sel-0=1
Sel-1=0
Sel-2=0
Sel-3=0
[%s-AskOptions-2]
Result=1
Sel-0=0
[%s-SdFinish-0]
Result=1
bOpt1=0
bOpt2=0
""" % (
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            edition[1:5],
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
        )
    else:
        data = r"""[InstallShield Silent]
Version=v7.00
File=Response File
[File Transfer]
OverwrittenReadOnly=NoToAll
[%s-DlgOrder]
Dlg0=%s-SdLicense2Rtf-0
Count=5
Dlg1=%s-SdAskDestPath-0
Dlg2=%s-AskOptions-0
Dlg3=%s-AskOptions-1
Dlg4=%s-SdFinish-0
[%s-SdLicense2Rtf-0]
Result=1
[%s-SdAskDestPath-0]
szDir=C:\Program Files\Index Education\Pronote %s\Réseau\Client
Result=1
[%s-AskOptions-0]
Result=1
Sel-0=1
Sel-1=0
Sel-2=0
Sel-3=0
[%s-AskOptions-1]
Result=1
Sel-0=0
[%s-SdFinish-0]
Result=1
bOpt1=0
bOpt2=0
""" % (
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
            edition[1:5],
            app_uninstallkey,
            app_uninstallkey,
            app_uninstallkey,
        )
    fichier = codecs.open(pathinstallfile, "w", encoding="mbcs")
    fichier.write(data)
    fichier.close()
    install_exe_if_needed(
        bin_name, silentflags="-s -f1%s" % pathinstallfile, key=app_uninstallkey, min_version=package_version, killbefore="Client PRONOTE.exe"
    )
    uninstallkey.remove(app_uninstallkey)
    # Deleting response file
    remove_file(pathinstallfile)
    # Creating desktop shortcut for all users
    create_desktop_shortcut(
        r"Pronote%s - %s" % (edition[1:5], NOMETAB),
        target="C:\Program Files\Index Education\Pronote %s\Réseau\Client\Client PRONOTE.exe" % edition[1:5],
        arguments=r'-Adresse "%s" -PortTcp "%s"' % (SERVERNAME, SERVERPORT),
    )


def audit():
    if not installed_softwares("Mise à jour automatique"):
        print("Module de Mise à jour automatique manquant")
        return "ERROR"
    if not isfile(r"%s\InstallShield Installation Information\%s\setup.exe" % (programfiles32, app_uninstallkey)):
        print("Binaire de désinstallation manquant")
        return "WARNING"
    else:
        for soft in installed_softwares("Mise à jour automatique"):
            print(soft["name"] + " : " + soft["version"])
        return "OK"


def update_package():
    print("Downloading/Updating package content from upstream binary sources")

    # Initializing variables
    bin_name_string = "Install_PRNclient_FR_%s.%s_win64.exe"
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    url = control.sources
    app_arch = control.architecture
    if app_arch == "x64":
        dl_arch = "win64"
    else:
        dl_arch = "win32"

    # Getting latest version from official website
    page = wgets(control.sources, proxies=proxies)
    for line in page.splitlines():
        if ("CLIENT EDT %s - 0." % edition[1:5]) in line:
            version = line.split('-')[-1].split('<')[0].replace(" ","")
            break
    latest_bin = bin_name_string % (edition[1:5], version)
    url_dl = "https://tele3.index-education.com/telechargement/pn/%s/exe/Install_PRNclient_FR_%s.%s_%s.exe" % (
        edition,
        edition[1:5],
        version,
        dl_arch,
    )

    print("Latest %s version is: %s" % (app_name, version))
    print("Download url is: %s" % url_dl)

    # Downloading latest binaries
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(url_dl, latest_bin, proxies=proxies)

        # Checking version from file
        version_from_file = get_version_from_binary(latest_bin)
        if version != version_from_file:
            os.rename(latest_bin, bin_name_string % (edition[1:5], version_from_file))
            version = version_from_file

        # Changing version of the package
        control.version = "%s-%s" % (version, int(control.version.split("-")[-1]) + 1)
        control.save_control_to_wapt()
        print("Changing version to: %s in WAPT\\control" % control.version)

    # Deleting outdated binaries
    remove_outdated_binaries(version)


def uninstall():
    print("uninstalling: %s" % control.package)
    import tempfile

    pathuninstallfile = makepath(tempfile.gettempdir(), "Uninstall.iss")
    data = r"""[InstallShield Silent]
Version=v7.00
File=Response File
[File Transfer]
OverwrittenReadOnly=NoToAll
[%s-DlgOrder]
Dlg0=%s-MessageBox-0
Count=2
Dlg1=%s-SdFinishReboot-0
[%s-MessageBox-0]
Result=6
[%s-SdFinishReboot-0]
Result=1
BootOption=0
""" % (
        app_uninstallkey,
        app_uninstallkey,
        app_uninstallkey,
        app_uninstallkey,
        app_uninstallkey,
    )
    fichier = open(pathuninstallfile, "w")
    fichier.write(data)
    fichier.close()
    run(r'"%s\InstallShield Installation Information\%s\setup.exe" -s -uninst -f1%s' % (programfiles32, app_uninstallkey, pathuninstallfile))
    # Deleting response file
    remove_file(pathuninstallfile)
    # Removing desktop shortcut for all users
    remove_desktop_shortcut("Pronote%s - %s.lnk" % (edition[1:5], NOMETAB))
    # Uninstalling Auto Update Agent
    if uninstall_key_exists("{775E087D-A428-428C-A5FD-000010010000}"):
        run('"MsiExec.exe" /X{775E087D-A428-428C-A5FD-000010010000} /qn')
control:

Code: Select all

architecture      : x64
sources           : https://www.index-education.com/fr/telecharger-pronote-pre-version.php
- Installed WAPT version: 2.6.0.16795 Enterprise
- Server OS: Linux / Debian Bookworm
- Administration/package creation machine OS: Windows 10
brice73
Messages: 42
Registration: February 13, 2023 - 8:05 AM

July 25, 2023 - 11:28

Thanks for sharing. Apparently, the 2023 version server is not yet operational and clients cannot yet connect to it (a message of this type is displayed when opening the client and attempting to connect to the server).
WAPT Enterprise 2.6.1.17765
WAPT server under Debian 13
Administration/package creation under Windows 11/10
laurent.bost
Messages: 4
Registration: July 16, 2021 - 10:15

July 27, 2023 - 08:57

Hello,

When I try to install it I get the following error message:

2023-07-27 08:46:59,663 CRITICAL Fatal error in install script: 'ascii' codec can't decode byte 0xc3 in position 680

Pyscripter version: 3.6.4.0 X86
Waptconsole version: 1.8.2.7334

Regards,
Laurent.
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

July 27, 2023 - 09:42

Hello Laurent,

WAPT version 1.8.2 was based on Python 2.7, which handled encoding differently. You can remove all accented characters from the package to avoid the encoding problem, but you might encounter other issues (different setuphelpers, etc.).

WAPT version 1.8.2 Community has not been maintained by Tranquil IT for over a year, and no one has taken over its maintenance. I encourage you to upgrade. And as mentioned in the forum rules, only questions related to upgrading from 1.8.2 to 2.x are accepted on this forum. :-)

Sincerely,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
laurent.bost
Messages: 4
Registration: July 16, 2021 - 10:15

July 28, 2023 - 3:08 PM

Hello,

Thank you for your reply, and sorry for the question, I will proceed with the Wapt update.

Sincerely,
Laurent.
Locked