Page 1 of 1

[SOLVED] tis-add-fonts problem

Published: October 19, 2023 - 8:45 AM
by skoizer
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

Re: tis-add-fonts problem

Published: October 19, 2023 - 12:15 PM
by jpele
Hello,
I just tested it and I'm not having any problems. Could you please copy the error message for us?

Regards,
Jimmy

Re: tis-add-fonts problem

Published: October 19, 2023 - 5:08 PM
by skoizer
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)

Re: tis-add-fonts problem

Published: October 25, 2023 - 2:28 PM
by jpele
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")