tis-seafile

7.0.9-8
Windows client for cloud file storage Seafile
9773 downloads
Download

  Description 

  • package : tis-seafile
  • version : 7.0.9-8
  • architecture : all
  • categories : Office,Media
  • maintainer : WAPT Team,Jimmy PELÉ,Hubert TOUVET,Amelie LE JEUNE
  • description : Windows client for cloud file storage Seafile
  • locale : all
  • target_os : windows
  • min_os_version : 6.1
  • max_os_version :
  • min_wapt_version : 1.5
  • sources : https://www.seafile.com/en/download/
  • installed_size : 216985600
  • impacted_process : seafile-applet,seaf-daemon,shellext-fix
  • description_fr : Client Windows pour les système de partage de fichiers Seafile
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : Seafile Ltd
  • licence : GPL
  • signature_date : 2020-09-17T09:22:12.311697
  • Homepage : https://www.seafile.com/

  Setup.py 

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

uninstallkey = []

# Declaring specific app values (TO CHANGE)
bin_name_string = 'seafile-%s-en.msi'


def install():
    # Specific app values
    package_version = control.version.split('-')[0]

    # Installing the package
    install_msi_if_needed(bin_name_string % package_version
        ,min_version=package_version)

    uninstallkey.remove(get_msi_properties("seafile-%s-en.msi" % package_version)['ProductCode'])
    remove_desktop_shortcut('Seafile')


def uninstall():
    import time
    try:
        for seafile in installed_softwares('seafile'):
            run(uninstall_cmd(seafile['key']),timeout=20)
    except:
        killalltasks('seafile-applet.exe')
        time.sleep(30)
        if installed_softwares('seafile'):
            error('Error: Seafile is not uninstalled')


def session_setup():
    print('Session setup for %s' % control.asrequirement())
    print('Configuring: auto update check, base options')
    registry_setstring(HKEY_CURRENT_USER,r'Software\Seafile\Seafile Client\WinSparkle','CheckForUpdates','0')
    registry_setstring(HKEY_CURRENT_USER,r'Software\Seafile\Seafile Client\Misc','SparkleAlreadyEnableUpdateByDefault','true')
    registry_setstring(HKEY_CURRENT_USER,r'Software\Seafile','ShellExtDisabled','1')
    registry_setstring(HKEY_CURRENT_USER,r'Software\Seafile\Seafile Client\Behavior','hideMainWindowWhenStarted','true')
    registry_setstring(HKEY_CURRENT_USER,r'Software\Seafile\Seafile Client\Language','current','en')


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

    # Update transition from BeautifulSoup 3 to 4
    try:
        import bs4 as BeautifulSoup
    except:
        import BeautifulSoup

    # Getting proxy informations from WAPT settings
    proxy = {}
    if isfile(makepath(application_data(),'waptconsole','waptconsole.ini')):
        proxywapt = inifile_readstring(makepath(user_local_appdata(),'waptconsole','waptconsole.ini'),'global','http_proxy')
        if proxywapt :
            proxy = {'http':proxywapt,'https':proxywapt}		

    # Specific app values
    app_name = control.name
    url = control.sources

    # Getting latest version from official website
    page = requests.get(url).text
    bs = BeautifulSoup.BeautifulSoup(page)
    #bs = BeautifulSoup.BeautifulSoup(page,features="html.parser") # For bs4 only
    bs_raw_string = bs.find('a',{'class':'download-op'})
    version = bs_raw_string.text
    print(version)
    
    url_dl = bs_raw_string['href']
    latest_bin = bin_name_string % version

    print('Latest ' + app_name + ' version is: ' + version)
    print('Download url is: ' + url_dl)

    # Downloading latest binaries
    if not isfile(latest_bin):
        print('Downloading: ' + latest_bin)
        wget(url_dl,latest_bin,proxies=proxy)

        # 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 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)


										
  manifest.sha256 
[["seafile-7.0.9-en.msi","3f837823c23403ad2d5aec29f81028aaf1e86055e2fa45a8b67fcf94f59ddade"],["setup.py","eecf603599e56e2c49478cfd8fa57974dc16cd2167f6634792b3c24f4214fc1f"],["WAPT/icon.png","2fa8a089ab65b8b5746bf57908d847606256cde5d7da32929a132f18fb7df741"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/control","30718fb7fd3bb90e9c981e88c76960b21a48db426f7892cbed3c8834d62284f6"]]