tis-foxit

10.1.3.37598-20
Foxit Reader is a PDF tool that can create, view, edit, digitally sign, and print PDF files
5645 downloads
Download

  Description 

  • package : tis-foxit
  • version : 10.1.3.37598-20
  • architecture : all
  • categories : Office
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • description : Foxit Reader is a PDF tool that can create, view, edit, digitally sign, and print PDF files
  • locale : all
  • target_os : windows
  • min_wapt_version : 1.7
  • sources : https://www.foxitsoftware.com/downloads/
  • installed_size :
  • impacted_process : FoxitReader,64BitMailAgent,FoxitReaderConnectedPDFService,FoxitReaderUpdateService,FoxitUpdater,SendCrashReport,ServiceMiniNotice,TrackReview,FoxitPreviewhost
  • description_fr : Foxit Reader est un outil PDF permettant de créer, lire, modifier, signer numériquement et imprimer des fichiers PDF
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : Foxit Software Inc.
  • licence : Proprietary
  • signature_date : 2021-03-29T12:48:15.641514
  • Homepage : https://www.foxitsoftware.com/
  • Conflicts :

  Setup.py 

# -*- coding: utf-8 -*-
from setuphelpers import *
import requests
import platform
try:
    import bs4 as BeautifulSoup
except:
    import BeautifulSoup
import wmi

uninstallkey = []

# Defining variables
bin_name_string = 'FoxitReader_%s_Setup.exe'
silent_args_string = '/ForceInstall /VERYSILENT DESKTOP_SHORTCUT="0" MAKEDEFAULT="0" VIEWINBROWSER="0" LAUNCHCHECKDEFAULT="0" AUTO_UPDATE="0" /passive /norestart /LANG=%s'
app_uninstallkey = 'Foxit Reader_is1'


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

    # Installing the package
    print('Installing: %s' % bin_name)
    install_exe_if_needed(bin_name,
        silentflags=silent_args_string % lang,
        key=app_uninstallkey,
        min_version=package_version)

    # Disable updater service
    if get_service_start_mode('FoxitReaderUpdateService') != 'Disabled':
        try:
            set_service_start_mode('FoxitReaderUpdateService', 'Disabled')
        except:
            print("Unable to disable the service: FoxitReaderUpdateService")


def session_setup():
    print("Disabling: auto-update-check, updater, registration dialog")

    # Initializing variables
    package_version = control.version.split('-',1)[0]
    split_package_version = package_version.split('.')
    short_package_version = '%s.%s'% (split_package_version[0],split_package_version[1])

    # Disabling update-check
    registry_setstring(HKEY_CURRENT_USER,r'Software\Foxit Software\Foxit Reader %s\plugins\Updater' % short_package_version,'UpdateMode','0')
    registry_setstring(HKEY_CURRENT_USER,r'Software\Foxit Software\Foxit Reader %s\Preferences\Registration' % short_package_version,'bShowRegisterDlg','0')

    # Removing FoxitReaderUpdater
    updater_path = makepath(user_appdata,'Foxit Software','Addon','Foxit Reader','FoxitReaderUpdater.exe')
    if isfile(updater_path):
        killalltasks('FoxitReaderUpdater.exe')
        remove_file(updater_path)


def update_package():
    print('Download/Update package content from upstream binary sources')

    # Getting proxy informations 
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()

    # Specific app values
    app_name = control.name
    url = 'https://www.foxitsoftware.com/pdf-reader/version-history.php'

    # Getting latest version from official website
    page = requests.get(url,headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'},proxies=proxies).text
    bs = BeautifulSoup.BeautifulSoup(page)
    #bs = BeautifulSoup.BeautifulSoup(page,features="html.parser") # For bs4 only
    bs_raw_string = bs.find('h3').text
    version = bs_raw_string.split(' ')[-1]

    # Do not use the URL: "language=English" (it will not download language packs)
    url_dl = 'https://www.foxitsoftware.com/downloads/latest.php?product=Foxit-Reader&platform=Windows&package_type=exe&language=French'
    latest_bin = bin_name_string % version

    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,connect_timeout=20)

        # Get version from file
        version_from_file = get_file_properties(latest_bin)['ProductVersion']
        if version != version_from_file and version_from_file != '':
            version = version_from_file
            old_latest_bin = latest_bin
            latest_bin = bin_name_string % version
            if isfile(latest_bin):
                remove_file(latest_bin)
            os.rename(old_latest_bin,latest_bin)

        # 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
    for bin_in_dir in glob.glob('*.exe') or glob.glob('*.msi'):
        if bin_in_dir != latest_bin :
            print('Outdated binary: %s Deleted' % bin_in_dir)
            remove_file(bin_in_dir)




def set_service_start_mode(service_name, start_mode):
    """Changing start mode of a service
    Usable values: 'Automatic', 'Manual', 'Disabled'
    Informations: https://msdn.microsoft.com/en-us/library/aa384896(v=vs.85).aspx
    """
    for svc in wmi.WMI().Win32_Service(Name=service_name):
        svc.ChangeStartMode(StartMode=start_mode)
        if start_mode == 'Disabled':
            service_stop(service_name)


def get_service_start_mode(service_name):
    """Getting actual start mode of a service
    Returned values: 'Auto', 'Manual', 'Disabled'
    """
    for svc in wmi.WMI().Win32_Service(Name=service_name):
        return svc.StartMode


def get_proxies():
    if platform.python_version_tuple()[0] == '3':
        from urllib.request import getproxies
    else:
        from urllib import getproxies
    return getproxies()


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

										

  Changelog 



Changelog software url : https://www.foxitsoftware.com/pdf-reader/version-history.php



No changelog.txt.
									
  manifest.sha256