tis-seadrive icon

SeaDrive

Paquet d’installation silencieuse pour SeaDrive

1.0.12-34

  • package: tis-seadrive
  • name: SeaDrive
  • version: 1.0.12-34
  • categories: Utilities
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • editor: Seafile Ltd.
  • licence: GPLv2
  • locale: all
  • target_os: windows
  • impacted_process: seadrive,seadrive-gui
  • architecture: all
  • signature_date:
  • size: 92.81 Mo
  • installed_size: 271.18 Mo
  • homepage : https://www.seafile.com/
  • depends:

package           : tis-seadrive
version           : 1.0.12-34
architecture      : all
section           : base
priority          : optional
name              : SeaDrive
categories        : Utilities
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : SeaDrive enables you to access files on the server without syncing to local disk. It works like a network drive.
depends           : tis-vcredist
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.0
sources           : https://www.seafile.com/en/download/
installed_size    : 271183872
impacted_process  : seadrive,seadrive-gui
description_fr    : SeaDrive vous permet d'accéder aux fichiers sur le serveur sans synchronisation avec le disque local. Il fonctionne comme un lecteur réseau
description_pl    : SeaDrive umożliwia dostęp do plików na serwerze bez konieczności synchronizacji na dysku lokalnym. Działa jak dysk sieciowy
description_de    : Mit SeaDrive können Sie auf Dateien auf dem Server zugreifen, ohne sie mit der lokalen Festplatte zu synchronisieren. Es funktioniert wie ein Netzlaufwerk
description_es    : SeaDrive permite acceder a los archivos del servidor sin necesidad de sincronizarlos con el disco local. Funciona como una unidad de red
description_pt    : SeaDrive permite o acesso a ficheiros no servidor sem sincronização com o disco local. Funciona como uma unidade de rede
description_it    : SeaDrive consente di accedere ai file sul server senza sincronizzare il disco locale. Funziona come un'unità di rete
description_nl    : Met SeaDrive hebt u toegang tot bestanden op de server zonder ze naar de lokale schijf te synchroniseren. Het werkt als een netwerkschijf
description_ru    : SeaDrive позволяет получить доступ к файлам на сервере без синхронизации с локальным диском. Он работает как сетевой диск
audit_schedule    : 
editor            : Seafile Ltd.
keywords          : sharing,file,seafile,drive,sea
licence           : GPLv2
homepage          : https://www.seafile.com/
package_uuid      : 3016059d-f469-46b2-8a69-9d10e7e1d6e4
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://manual.seafile.com/changelog/drive-client-changelog/
min_os_version    : 6.1
max_os_version    : 
icon_sha256sum    : 095bf254df112880418ca67754fab61e3d80467a8218bf911530a9a9aeade66b
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : NFDZGauqbGm45jBErsRIriNwRhcW6l59AzrFuqHBc09PdqyJkOHiYOTAQgIl/Mx/S+M7MgzXtaU/gyZ8TQ+7YXJw+ed/vJ458p5e68JGlwnhR1CUJ3PBXNBat+JicItW2/xb+voIg361e8w5F8Qf7EtS0xb1OHKXB9D29yNWSZOs9rksGJtcl+vUJ38hWVdiaqg9koRZlJWYCTuR7j64bpSMSRr4wYvb3w0LL1KVQL4yTV0vtxmiktbE+wJb/K966uvYM0OnjKfJnOo8RWZOPvPQ41TcfD2os/SLXrxGAcLRBi660ZuT9TUU9Fz6haxtDghNkU6hrC7Wt2dZkMqzoA==
signature_date    : 2022-07-31T02:36:54.686483
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

# -*- coding: utf-8 -*-
from setuphelpers import *
import psutil
import time
import threading

# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
app_uninstallkey = "{82442898-8FE9-44E8-8F50-D2EACBB80848}"
kb_fname = "Windows6.1-KB3033929-x64.msu"


def install():
    # Declaring local variables
    package_version = control.get_software_version()
    bin_name = glob.glob("*seadrive*.exe")[0]
    app_name = control.name

    if need_install(key=app_uninstallkey, min_version=package_version):
        # if windows_version() >= WindowsVersions.Windows7 and windows_version() < WindowsVersions.Windows8:
        #    if not is_kb_installed('KB3033929'):
        #        print('Instaling required KB3033929')
        #        with EnsureWUAUServRunning():
        #            # 2359302 : patch already installed
        #            run('wusa.exe /quiet /norestart %s' % kb_fname,accept_returncodes=[0,3010,2359302])
        #    else:
        #        print('Skipping install of KB3033929')

        # Installing the package
        # if not is_pending_reboot():
        print("Installing: %s" % bin_name)
        install_exe_if_needed(
            bin_name,
            key=app_uninstallkey,
            silentflags="/install /passive /quiet /norestart",
            min_version=package_version,
            accept_returncodes=[0, 3010, 1638, 1641],
        )
        uninstallkey.remove(app_uninstallkey)
    # else:
    #    error("ERROR: Installation cannot continue since this PC is in pending reboot state.")
    else:
        print("%s is already installed and up-to-date" % app_name)


def uninstall():

    # Uninstalling the SeaDrive dependency called Dokan Library
    for uninstall in installed_softwares("Dokan Library"):
        print("Removing: %s" % uninstall["name"])
        run(uninstall_cmd(uninstall["key"]))

    # Uninstalling SeaDrive
    for uninstall in installed_softwares("SeaDrive"):
        if uninstall["key"] == app_uninstallkey:
            continue
        print("Removing: %s" % uninstall["name"])
        t = threading.Thread(target=killseadrive)
        t.start()
        run(uninstall_cmd(uninstall["key"]))


def session_setup():
    print("Disabling auto-update check and configuring base options")
    registry_setstring(HKEY_CURRENT_USER, r"SOFTWARE\Seafile\Seafile Drive Client\WinSparkle", "CheckForUpdates", "0")
    registry_setstring(HKEY_CURRENT_USER, r"SOFTWARE\SeaDrive\Seafile Drive Client\Language", "current", "en")
    registry_setstring(HKEY_CURRENT_USER, r"SOFTWARE\SeaDrive\Seafile Drive Client\Misc", "SparkleAlreadyEnableUpdateByDefault", "true")
    registry_setstring(HKEY_CURRENT_USER, r"SOFTWARE\SeaDrive", "ShellExtDisabled", "1")
    registry_setstring(HKEY_CURRENT_USER, r"SOFTWARE\SeaDrive\Seafile Drive Client\Settings", "diskLetter", "S:")
    if not reg_value_exists(HKEY_CURRENT_USER, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "SeaDrive"):
        print("Now auto starting SeaDrive after login")
        app_exe = makepath(programfiles32, "SeaDrive", "bin", "seadrive-gui.exe")
        registry_setstring(HKEY_CURRENT_USER, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "SeaDrive", app_exe)
        if not isrunning("seadrive-gui.exe"):
            # run(app_exe, wait=False)
            psutil.Popen([app_exe])
            print("You may need to manually run SeaDrive for the first time")


def is_pending_reboot():
    r"""Check whether operating system is on pending reboot

    Returns:
        boolean

    >>> is_pending_reboot()
    True
    """

    if (
        reg_key_exists(HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired")
        or reg_key_exists(HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending")
        or reg_value_exists(HKEY_LOCAL_MACHINE, r"SYSTEM\CurrentControlSet\Control\Session Manager", "PendingFileRenameOperations")
        or reg_value_exists(HKEY_LOCAL_MACHINE, r"SYSTEM\CurrentControlSet\Control\Session Manager", "PendingFileRenameOperations2")
        or reg_key_exists(HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Updates\UpdateExeVolatile")
    ):
        return True
    return False


def killseadrive():
    time.sleep(15)
    killalltasks("seadrive-gui.exe")
    time.sleep(15)
    killalltasks("seadrive-gui.exe")
    time.sleep(15)
    killalltasks("seadrive-gui.exe")

# -*- coding: utf-8 -*-
from setuphelpers import *
import bs4 as BeautifulSoup

# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_contains = "seadrive"
kb_fname = "Windows6.1-KB3033929-x64.msu"


def update_package():
    # Declaring local variables
    result = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    url = "https://www.seafile.com/en/download/"
    bin_name_sub = bin_contains + "-%s.exe"
    url_dl_kb = "https://download.microsoft.com/download/C/8/7/C87AE67E-A228-48FB-8F02-B2A9A1238099/Windows6.1-KB3033929-x64.msu"

    # Getting latest version from official website
    for bs_search in bs_find_all(url, "a", "class", "download-op", proxies=proxies):
        latest_bin = bs_search["href"].split("/")[-1]
        if latest_bin.startswith(bin_contains) and latest_bin.endswith(".exe"):
            url_dl = bs_search["href"]
            version = bs_search.string
            break

    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) != Version(version_from_file) and version_from_file != "":
            print("Changing version to the version number of the binary (from: %s to: %s)" % (version, version_from_file))
            os.rename(latest_bin, bin_name_sub % version_from_file)
            version = version_from_file

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        result = True
    control.version = "%s-%s" % (Version(version), control.version.split("-", 1)[-1])
    # control.set_software_version(Version(version))
    control.save_control_to_wapt()

    # Deleting outdated binaries
    remove_outdated_binaries(version)

    # Downloading KB
    if not isfile(kb_fname):
        print("Downloading: %s" % kb_fname)
        # wget(url_dl_kb,kb_fname,proxies=proxies)

    # Validating or not update-package-sources
    return result

4b76dcbb873454271a6de6330b6900dbc71526025970bb94a90b8ee871c08034 : seadrive-1.0.12.exe
e3b1bf94dcf2d62f3e5fc9475025346c8e9b5a2b14e313df58ddfd5948bfd8a8 : setup.py
883d6c7ae58e8bf645c807be8ad4ce562bb0d505b13ae97382d150a6b4245d08 : update_package.py
095bf254df112880418ca67754fab61e3d80467a8218bf911530a9a9aeade66b : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
ed7afb6a932c75781b0557ca33411a8e445e8bada9fe9596c50851f9a0c32be8 : luti.json
4e22163c03d06c2b8daf14e6a2595526acd9f36af693e93c9721395eca7b4744 : WAPT/control