[SOLVED] Edt Package v2022 build 0.3.0 / Pronote v2022 build 0.3.0

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
User avatar
Jonattend
Messages: 43
Registration: March 26, 2018 - 2:45 PM

February 24, 2022 - 11:51

Good morning,

For my part, I just did this:

setup.py:

Code: Select all

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

uninstallkey = []

def install():
    #install_exe_if_needed("fake_install.exe",'/VERYSILENT',key='',min_version='0.0.0')
    mkdirs("C:\install")
    filecopyto("Install_PRNclient_FR_2021.0.2.7_win64.exe","C:\install")
    filecopyto("install_pronote.cmd","C:\install")
    filecopyto("ClientPRONOTE.iss","C:\install")
    run("C:\install\install_pronote.cmd", timeout=1200)
install_pronote.cmd:

Code: Select all

C:\install\Install_PRNclient_FR_2021.0.2.7_win64.exe -s -f1C:\install\ClientPRONOTE.iss -f2C:\Windows\debug\pronote_install.log
I don't handle uninstalling, but in my case, it's not a big deal.

There are certainly cleaner ways, but this one has the merit of working :)

A+
WAPT Server version: 1.8.1 on Debian 10
WAPT Agent version: 1.8.1.6756
WAPT Setup version: 1.8.1.6756 on Windows10 v1909
WAPT Deploy version: 1.8.1.6756
SebAranel
Messages: 9
Registration: June 2, 2022 - 1:55 PM

June 2, 2022 - 2:05 PM

Hello,

I've just arrived at two schools, and there's currently a WAPT server running Debian 11, controlled via the WAPT console on Windows 7.

I'm not very experienced with package creation and need to deploy the latest Pronote update (0.2.9).

I'd appreciate some help finalizing a package for this version of Pronote. A package exists for version 0.2.8, but unfortunately, when I try to install it, I get many error messages from the PyScript.

Would you have a code I could use to customize it for each school?

Thank you in advance
Last edited by SebAranel on June 8, 2022 - 09:17, edited 1 time.
- Installed WAPT version: 2.2.1.11949 Discovery
- Server OS: Linux / Debian 11
- Administration/package creation machine OS: Windows 7
User avatar
dcardon
WAPT Expert
Messages: 1930
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

June 3, 2022 - 10:51

Hello SebAranel,

could you please confirm your WAPT version is 2.2.1.11949 Enterprise? Because normally, version 1.8.2 is compatible with version 2.2.1.

Did you install PyScripter version 3 or PyScripter 4? Personally, I recommend PyScripter version 3; version 4 uses the "Python Language Server" implementation for autocompletion and syntax analysis in the editor, and it's quite buggy.

Sincerely,

Denis Cardon
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
SebAranel
Messages: 9
Registration: June 2, 2022 - 1:55 PM

June 8, 2022 - 08:17

Hello Denis,

please excuse the rather long reply. I just checked and I'm apparently on a discovery version of wapt, 2.2.1.11949, and for pyscripter I'm on version 3.6. I've attached a screenshot.

Picture

I don't know if it makes a difference, but my console shows discovery.

Regards,

SebAranel
- Installed WAPT version: 2.2.1.11949 Discovery
- Server OS: Linux / Debian 11
- Administration/package creation machine OS: Windows 7
olaplanche
Messages: 178
Registration: January 26, 2017 - 11:11

June 8, 2022 - 11:14

Hello,

FYI, the Python v3 compatible code for EDT and Pronote version 0.2.10 is in the first post.
It also includes instructions for customizing it as you see fit.
I've also just corrected a few minor typos and checked all the functions myself without any errors.

Normally, all you need to do is copy/paste and change three variables.
- Installed WAPT version: 2.6.0.16795 Enterprise
- Server OS: Linux / Debian Bookworm
- Administration/package creation machine OS: Windows 10
SebAranel
Messages: 9
Registration: June 2, 2022 - 1:55 PM

June 8, 2022 - 12:09

Hello Olaplanche

Thank you for your reply and for your code, it worked with pyscripter using the wapt install on my post, however after trying to install it with the created package it returns all these errors.

Code: Select all

Installing gmwapt-client-pronote-2021-0210(=0.2.10-1)

Installing gmwapt-client-pronote-2021-0210(=0.2.10-1)

Installing: Install_PRNclient_FR_2021.0.2.10_win64.exe


Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\waptservice\service.py", line 1892, in run
    self.running_task.run()
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 653, in run
    self._run()
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 1126, in _run
    self.result.get('errors',[])))
Exception: Erreur lors de l'installation de [u'gmwapt-client-pronote-2021-0210(=0.2.10-1)']: erreurs dans les paquets [[PackageRequest(package=u'gmwapt-client-pronote-2021-0210',version=(Version('0.2.10.0'), 1),architectures=[u'x64'],locales=['fr'],maturities=[u'PROD'],target_os=[u'windows'],min_os_version=Version('10.0.19044'),max_os_version=Version('10.0.19044')), PackageEntry(u'gmwapt-client-pronote-2021-0210',u'0.2.10-1' architecture=u'x64',maturity=u'PROD'), u'Traceback (most recent call last):\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4952, in install\n    force=force\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 3962, in install_wapt\n    raise e\nUnicodeDecodeError: \'ascii\' codec can\'t decode byte 0xc3 in position 623: ordinal not in range(128)\n']]

Exception: Erreur lors de l'installation de [u'gmwapt-client-pronote-2021-0210(=0.2.10-1)']: erreurs dans les paquets [[PackageRequest(package=u'gmwapt-client-pronote-2021-0210',version=(Version('0.2.10.0'), 1),architectures=[u'x64'],locales=['fr'],maturities=[u'PROD'],target_os=[u'windows'],min_os_version=Version('10.0.19044'),max_os_version=Version('10.0.19044')), PackageEntry(u'gmwapt-client-pronote-2021-0210',u'0.2.10-1' architecture=u'x64',maturity=u'PROD'), u'Traceback (most recent call last):\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4952, in install\n    force=force\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 3962, in install_wapt\n    raise e\nUnicodeDecodeError: \'ascii\' codec can\'t decode byte 0xc3 in position 623: ordinal not in range(128)\n']]
Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\waptservice\service.py", line 1892, in run
    self.running_task.run()
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 653, in run
    self._run()
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 1126, in _run
    self.result.get('errors',[])))
Exception: Erreur lors de l'installation de [u'gmwapt-client-pronote-2021-0210(=0.2.10-1)']: erreurs dans les paquets [[PackageRequest(package=u'gmwapt-client-pronote-2021-0210',version=(Version('0.2.10.0'), 1),architectures=[u'x64'],locales=['fr'],maturities=[u'PROD'],target_os=[u'windows'],min_os_version=Version('10.0.19044'),max_os_version=Version('10.0.19044')), PackageEntry(u'gmwapt-client-pronote-2021-0210',u'0.2.10-1' architecture=u'x64',maturity=u'PROD'), u'Traceback (most recent call last):\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4952, in install\n    force=force\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 3962, in install_wapt\n    raise e\nUnicodeDecodeError: \'ascii\' codec can\'t decode byte 0xc3 in position 623: ordinal not in range(128)\n']]
I've put it in code form so you can see what it is.

I don't know if it's possible either, but I still have a lot of 32-bit posts. Would the code you made work on this type of post?.

I know in advance that the errors do not come from the code you provided me because there are no errors in my post.

Sincerely

SebAranel
- Installed WAPT version: 2.2.1.11949 Discovery
- Server OS: Linux / Debian 11
- Administration/package creation machine OS: Windows 7
olaplanche
Messages: 178
Registration: January 26, 2017 - 11:11

June 8, 2022 - 1:50 PM

Can I see the code in the setup.py and control files?

For the code to work with the 32-bit version, there are a few modifications to be made.
- Installed WAPT version: 2.6.0.16795 Enterprise
- Server OS: Linux / Debian Bookworm
- Administration/package creation machine OS: Windows 10
SebAranel
Messages: 9
Registration: June 2, 2022 - 1:55 PM

June 9, 2022 - 9:30 AM

Good morning

Here is the code for setup.py. There are the modifications that were made to the three lines with the college information. I just modified it to show you the code.

Code: Select all

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

uninstallkey = []

# Defining variables
bin_name_string = 'Install_PRNclient_FR_%s.%s_win64.exe'
app_uninstallkey = '{E20E5011-C887-40D8-8C26-99460A24F860}'
edition = 'v2021.0'
SERVERNAME = 'Adresse du serveur du college' # Le nom DNS du serveur pronote
SERVERPORT = 'Port du serveur' # Le port TCP du serveur pronote
NOMETAB = 'Nom du Collège' # Utilisé pour personnaliser le nom du raccourci sur le bureau

def install():
    # Initializing variables
    package_version = control.version.split('-',1)[0]
    bin_name = bin_name_string % (edition[1:5],package_version)

    print('Installing: %s' % bin_name)
    import tempfile
    import codecs
    pathinstallfile = makepath(tempfile.gettempdir(),'Setup.iss')
    if installed_softwares ('INDEX EDUCATION - Client PRONOTE 2020 - 64bit'):
        data = r"""[InstallShield Silent]
Version=v7.00
File=Response File
[File Transfer]
OverwrittenReadOnly=NoToAll
[{E20E5011-C887-40D8-8C26-99460A24F860}-DlgOrder]
Dlg0={E20E5011-C887-40D8-8C26-99460A24F860}-SdLicense2Rtf-0
Count=6
Dlg1={E20E5011-C887-40D8-8C26-99460A24F860}-SdAskDestPath-0
Dlg2={E20E5011-C887-40D8-8C26-99460A24F860}-AskOptions-0
Dlg3={E20E5011-C887-40D8-8C26-99460A24F860}-AskOptions-1
Dlg4={E20E5011-C887-40D8-8C26-99460A24F860}-AskOptions-2
Dlg5={E20E5011-C887-40D8-8C26-99460A24F860}-SdFinish-0
[{E20E5011-C887-40D8-8C26-99460A24F860}-SdLicense2Rtf-0]
Result=1
[{E20E5011-C887-40D8-8C26-99460A24F860}-SdAskDestPath-0]
szDir=C:\Program Files\Index Education\Pronote 2021\Réseau\Client
Result=1
[{E20E5011-C887-40D8-8C26-99460A24F860}-AskOptions-0]
Result=1
Sel-0=0
[{E20E5011-C887-40D8-8C26-99460A24F860}-AskOptions-1]
Result=1
Sel-0=1
Sel-1=0
Sel-2=0
Sel-3=0
[{E20E5011-C887-40D8-8C26-99460A24F860}-AskOptions-2]
Result=1
Sel-0=0
[{E20E5011-C887-40D8-8C26-99460A24F860}-SdFinish-0]
Result=1
bOpt1=0
bOpt2=0
"""
    else:
        data = r"""[InstallShield Silent]
Version=v7.00
File=Response File
[File Transfer]
OverwrittenReadOnly=NoToAll
[{E20E5011-C887-40D8-8C26-99460A24F860}-DlgOrder]
Dlg0={E20E5011-C887-40D8-8C26-99460A24F860}-SdLicense2Rtf-0
Count=5
Dlg1={E20E5011-C887-40D8-8C26-99460A24F860}-SdAskDestPath-0
Dlg2={E20E5011-C887-40D8-8C26-99460A24F860}-AskOptions-0
Dlg3={E20E5011-C887-40D8-8C26-99460A24F860}-AskOptions-1
Dlg4={E20E5011-C887-40D8-8C26-99460A24F860}-SdFinish-0
[{E20E5011-C887-40D8-8C26-99460A24F860}-SdLicense2Rtf-0]
Result=1
[{E20E5011-C887-40D8-8C26-99460A24F860}-SdAskDestPath-0]
szDir=C:\Program Files\Index Education\Pronote 2021\Réseau\Client
Result=1
[{E20E5011-C887-40D8-8C26-99460A24F860}-AskOptions-0]
Result=1
Sel-0=1
Sel-1=0
Sel-2=0
Sel-3=0
[{E20E5011-C887-40D8-8C26-99460A24F860}-AskOptions-1]
Result=1
Sel-0=0
[{E20E5011-C887-40D8-8C26-99460A24F860}-SdFinish-0]
Result=1
bOpt1=0
bOpt2=0
"""
    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=u'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 update_package():
    print('Downloading/Updating package content from upstream binary sources')

    # Initializing variables
    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 PRONOTE 2021' in line :
            version = line.split('- ')[-1].split(' <')[0]
            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 get_proxies():
    if platform.python_version_tuple()[0] == '3':
        from urllib.request import getproxies
    else:
        from urllib import getproxies
    return getproxies()


def get_version_from_binary(filename):
    if filename.endswith('.msi'):
        return get_msi_properties(filename)['ProductVersion']
    else:
        return get_file_properties(filename)['ProductVersion']


def remove_outdated_binaries(version, list_extensions=['exe','msi','deb','rpm','dmg','pkg'], list_filename_contain=None):
    if type(list_extensions) != list:
        list_extensions = [list_extensions]
    if list_filename_contain:
        if type(list_filename_contain) != list:
            list_filename_contain = [list_filename_contain]
    list_extensions = ['.' + ext for ext in list_extensions if ext[0] != '.']
    for file_ext in list_extensions:
        for bin_in_dir in glob.glob('*%s' % file_ext):
            if not version in bin_in_dir:
                remove_file(bin_in_dir)
            if list_filename_contain:
                for filename_contain in list_filename_contain:
                    if not filename_contain in bin_in_dir:
                        remove_file(bin_in_dir)

def get_proxies_from_wapt_console():
    proxies = {}
    if platform.system() == 'Windows':
        waptconsole_ini_path = makepath(user_local_appdata(), 'waptconsole', 'waptconsole.ini')
    else:
        waptconsole_ini_path = makepath(user_home_directory(), '.config', 'waptconsole', 'waptconsole.ini')
    if isfile(waptconsole_ini_path):
        proxy_wapt = inifile_readstring(waptconsole_ini_path, 'global', 'http_proxy')
        if proxy_wapt:
            proxies = {'http': proxy_wapt, 'https': proxy_wapt}
    return proxies

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
[{E20E5011-C887-40D8-8C26-99460A24F860}-DlgOrder]
Dlg0={E20E5011-C887-40D8-8C26-99460A24F860}-MessageBox-0
Count=2
Dlg1={E20E5011-C887-40D8-8C26-99460A24F860}-SdFinishReboot-0
[{E20E5011-C887-40D8-8C26-99460A24F860}-MessageBox-0]
Result=6
[{E20E5011-C887-40D8-8C26-99460A24F860}-SdFinishReboot-0]
Result=1
BootOption=0
"""
    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
    run('"MsiExec.exe" /X{775E087D-A428-428C-A5FD-000010008000} /qn')

And here's what's in control

Code: Select all

package           : gmwapt-client-pronote-2021-0210
version           : 0.2.10-1
architecture      : x64
section           : base
priority          : optional
name              : client-pronote-2021---64bit
categories        : 
maintainer        : winadmin
description       : Client PRONOTE 2021 - 64bit (Index Education)
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
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      : 692f5a90-88e4-4b2d-8cc0-3a5a7b35ed86
valid_from        :
valid_until       :
forced_install_on :
changelog         :
min_os_version    :
max_os_version    :
icon_sha256sum    :
signer            : wapt
signer_fingerprint: 3d98c6bd75c8444596edecb80c04dda1ac217d841674700541eb14fde7ddaad6
signature         : PB0R1D+WGx8L5CFEP4qp0P/Y9ypNZh5HVcV+HtFW1/f6a3Xu+K5X6Fwr62d33S2o2HdtsdOIuZT4n9w5lzz+6PgEA8rIF+aCpMIFoU/yRWQ2n71ecf7R9cehBRIBhCWBKpFgYNug0saL/Zk3Cag2b7ffuQibdHp4nKdmX6wilUpfbHXXtnskMTsvXAhaXZxCFe3yHjmPFML3URTEJX5/7LWKlAQ1u0W1PYx9vd8PH2nw6RaMjcQYgEgu4hZPscqm5RQqIq53jg+EutVPqNyBExKAJM2hOG0TJfNt6TFjxA/b/LnwJjBvHa1/GR0Vdm+fOTXKvhmmEsAwIrEYitbVNg==
signature_date    : 2022-06-08T11:54:39.301511
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
I retrieved it from PyScripter; I hope I haven't made a mistake and that this is what you wanted to see

Sincerely

SebAranel
- Installed WAPT version: 2.2.1.11949 Discovery
- Server OS: Linux / Debian 11
- Administration/package creation machine OS: Windows 7
olaplanche
Messages: 178
Registration: January 26, 2017 - 11:11

June 9, 2022 - 09:41

Hello,

that's correct, thank you. Could you please add the source code to your control file as indicated in the first post?
Then, delete the binary from the package's development folder and run the "update-package-sources" function from PyScripter.
If everything is OK, re-download the binary and name it correctly. Then, perform another installation test from PyScripter, and if it's still successful, build the package and upload it to the server to perform another deployment test.
- Installed WAPT version: 2.6.0.16795 Enterprise
- Server OS: Linux / Debian Bookworm
- Administration/package creation machine OS: Windows 10
SebAranel
Messages: 9
Registration: June 2, 2022 - 1:55 PM

June 9, 2022 - 10:04

What do you mean by deleting the binary from the package's development folder?
- Installed WAPT version: 2.2.1.11949 Discovery
- Server OS: Linux / Debian 11
- Administration/package creation machine OS: Windows 7
Locked