tis-bitwarden-portable

1.24.6-13
Bitwarden is a freemium and open source password manager under the AGPL license, which allows you to generate and store passwords in a secure manner. These elements are protected by a single password called "master password"
64 downloads
Download

  Description 

  • package : tis-bitwarden-portable
  • version : 1.24.6-13
  • architecture : all
  • categories : Security,Utilities
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • description : Bitwarden is a freemium and open source password manager under the AGPL license, which allows you to generate and store passwords in a secure manner. These elements are protected by a single password called "master password"
  • locale : all
  • target_os : windows
  • min_os_version : 6.1
  • max_os_version :
  • min_wapt_version : 1.8
  • sources : https://github.com/bitwarden/desktop/releases
  • installed_size : 86118400
  • impacted_process : Bitwarden,Bitwarden-Portable
  • description_fr : Bitwarden est un gestionnaire de mots de passe freemium et open source sous licence AGPL, qui permet de générer et de conserver des mots de passe de manière sécurisée. Ces éléments sont protégés par un seul et unique mot de passe appelé « mot de passe maître »
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : 8bit Solutions LLC
  • licence : AGPLv3,GPLv3
  • signature_date : 2021-01-28T18:13:37.832647
  • Homepage : https://bitwarden.com

  Setup.py 

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

uninstallkey = []

# 173a9bac-6f0d-50c4-8202-4744c69d091a      Bitwarden       1.19.0      "C:\Program Files\Bitwarden\Uninstall Bitwarden.exe" /allusers 

# Defining variables
bin_name_sub = 'Bitwarden-Portable-%s.exe'
silent_args = '/S'
app_name = 'Bitwarden'
app_uninstallkey = app_name
app_bin = 'Bitwarden-Portable.exe'
app_dir = makepath(programfiles32, app_name)
app_bin_path = makepath(app_dir, app_bin)
processes_to_kill = ['Bitwarden', 'Bitwarden-Portable']


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

    # Uninstalling standalone version for portable one
    run_notfatal('"%s" %s %s' % (makepath(programfiles, 'Bitwarden', 'Uninstall Bitwarden.exe'), '/allusers', silent_args))

    # Installing the package
    print("Installing: %s" % bin_name)
    if get_version_from_binary(app_bin_path) != package_version:
        killalltasks(processes_to_kill)
        if isdir(app_dir):
            remove_tree(app_dir)
        mkdirs(app_dir)
        print("Copying %s to %s " % (bin_name, app_bin_path))
        filecopyto(bin_name, app_bin_path)
        remove_programs_menu_shortcut(app_name)

        # Adding this package to the "list-registry"
        register_windows_uninstall(control) # control is a PackageEntry object corresponding to this package
    else:
        print("%s portable version is already installed in the correct version" % app_name)


def uninstall():
    # Uninstalling the package
    killalltasks(processes_to_kill)
    if isdir(app_dir):
        remove_tree(app_dir)
        unregister_uninstall(app_uninstallkey)
    remove_programs_menu_shortcut(app_name)


def session_setup():
    # Initializing variables
    user_app_dir = makepath(application_data, 'Bitwarden-Portable')
    user_app_bin_path = makepath(user_app_dir, app_bin)

    # Installing the package in user env
    print("Installing: %s in user env" % app_name)
    if get_version_from_binary(user_app_bin_path) != installed_softwares(uninstallkey=app_uninstallkey)[0]['version']:
        killalltasks(processes_to_kill)
        if isdir(user_app_dir):
            remove_tree(user_app_dir)
        mkdirs(user_app_dir)
        print("Copying %s to %s " % (app_bin_path, user_app_bin_path))
        filecopyto(app_bin_path, user_app_bin_path)
        create_user_programs_menu_shortcut(app_name, user_app_bin_path)
    else:
        print("%s portable version in user env is already installed in the correct version" % app_name)


def update_package():
    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    git_repo = 'bitwarden/desktop'
    url_api = 'https://api.github.com/repos/%s/releases/latest' % git_repo
    bin_start = bin_name_sub.split('%s')[0]

    # Getting latest version from official sources
    print('API used is: %s' % url_api)
    json_load = json.loads(wgets(url_api,proxies=proxies))

    for download in json_load['assets']:
        if download['name'].startswith(bin_start):
            url_dl = download['browser_download_url']
            break

    version = json_load['tag_name'].replace('v','')
    latest_bin = bin_name_sub % 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)

        # Checking version from file
        version_from_file = get_version_from_binary(latest_bin)
        if version != version_from_file:
            os.rename(latest_bin,bin_name_sub % version_from_file)
            version = version_from_file

        # Changing version of the package
        control.version = '%s-%s' % (version, control.version.split('-', 1)[-1])
        control.save_control_to_wapt()
        print("Changing package version to: %s in WAPT\\control" % control.version)

    # Deleting outdated binaries
    remove_outdated_binaries(version)




def register_windows_uninstall(package_entry):
    """ Add a windows registry key for custom installer"""
    register_uninstall(package_entry.name,
        'wapt-get remove %s' % package_entry.package,
        display_name=package_entry.name,
        display_version=package_entry.get_software_version(),
        publisher=package_entry.editor)


def get_proxies():
    import platform
    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


def get_version_from_binary(filename, parameter='ProductVersion'):
    if filename.endswith('.msi'):
        return get_msi_properties(filename)[parameter]
    else:
        return get_file_properties(filename)[parameter]


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)


										

  Changelog 


Changelog software url : https://github.com/bitwarden/desktop/releases

No changelog
  manifest.sha256 
[["Bitwarden-Portable-1.24.6.exe","c083650a0dd43dbafdbb780fab2ed35340f69c6b9d74b3a1073af97485f03014"],["setup.py","6ad84379de49ac0ea8212a1bcdef2b23c1fbd7e16f998f7f3d74c120d148ca42"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/icon.png","6ae13462bbcc8bb661e2aaba2b48439d70dd241410918e8eb54b89d7a4e92f01"],["WAPT/control","cf6d765d5fb5e1533f8d08a6c5c31fe4014796cf3474e51e4db42ddb8a050a03"]]