[SOLVED] tis-add-fonts problem

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
Answer
skoizer
Messages: 54
Registration: June 19, 2018 - 4:45 PM

October 19, 2023 - 8:45 AM

Good morning,
I'm on Wapt 2.4 Enterprise

I would like to use tis-add-fonts to install fonts on my Windows PCs
https://wapt.tranquil.it/store/fr/tis-add-fonts

Code: Select all

def install():
    # Declaring local variables
    if iswin64():
        bin_name = "FontReg64.exe"
    else:
        bin_name = "FontReg32.exe"
    fonts_path = os.path.abspath("fonts")
    bin_path = makepath(fonts_path, bin_name)

    # Installing the fonts
    for zip in glob.glob("*.zip"):
        unzip(zip, "fonts", "*.ttf", extract_with_full_paths=False)
    for font in glob.glob(f"{fonts_path}/*.ttf"):
        print("Installing Font: %s" % font.split("\\")[-1])
    run(f'"{bin_path}" /copy')
    print("INFO: The PC must be rebooted for the fonts to appear")
This line of code doesn't seem to work
run(f'"{bin_path}" /copy')
The FontReg64.exe file, located in fonts/, contains the extracted *.ttf files in that directory
If I use the command line to run "FontReg64.exe /copy", it works, but not in the script
an idea
User avatar
jpele
Messages: 156
Registration: March 4, 2019 - 12:01
Location: Nantes

October 19, 2023 - 12:15

Hello,
I just tested it and I'm not having any problems. Could you please copy the error message for us?

Regards,
Jimmy
skoizer
Messages: 54
Registration: June 19, 2018 - 4:45 PM

October 19, 2023 - 5:08 PM

I have no errors

Code: Select all

Ligne de Commande : install "c:\waptdev\tis-add-fonts_2.1.3.0-5_windows_PROD\WAPT\.."
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Installing WAPT files c:\waptdev\tis-add-fonts_2.1.3.0-5_windows_PROD
Installing Font: Lato-Regular.ttf
INFO: The PC must be rebooted for the fonts to appear

Results :

 === install packages ===
  c:\waptdev\tis-add-fonts_2.1.3.0-5_windows_PROD | cd12-add-fonts (2.1.3.0-5)
>>> 
reboot
nothing in c:\windows\fonts
I do have the ttf file in \fonts\

if I add this

Code: Select all

    run(f'"{bin_path}" /copy')
    print( "%s /copy" % bin_path)
I do have a c:\waptdev\tisadd-fonts_2.1.3.0-6_windows_PROD\fonts\FontReg64.exe /copy

I also tried with PowerShell

Code: Select all

run_powershell("%s /copy" % bin_path)
User avatar
jpele
Messages: 156
Registration: March 4, 2019 - 12:01
Location: Nantes

October 25, 2023 - 2:28 PM

Indeed, it doesn't work.
Extensive fix in 2.1.3.0-8
Thank you again for your feedback, here is the code in the meantime:

Code: Select all

    # Installing the fonts
    os.chdir(fonts_path)
    run(f'"{bin_name}" /copy')
    print("INFO: The PC must be rebooted for the fonts to appear")
Answer