Détails du package smp-virtualbox_6.0.4-1_all.wapt
retour Revenir à la liste des packages

smp-virtualbox

ATTENTION CE DÉPÔT n'est plus compatible 1.3 vous devez migrer en 1.5.1.21 !

Fichier control :

package           : smp-virtualbox
version           : 6.0.4-1
architecture      : all
section           : base
priority          : optional
maintainer        : Simon Fonteneau blog.lesfourmisduweb.org
description       : Logiciel libre de virtualisation publié par Oracle
depends           : 
conflicts         : 
maturity          : 
locale            : 
target_os         : windows
min_os_version    : 
max_os_version    : 
min_wapt_version  : 
sources           : 
installed_size    : 
impacted_process  : VirtualBox.exe
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
audit_schedule    : 
editor            : 
keywords          : 
licence           : 
homepage          : 
package_uuid      : 95a55d37-f00e-453c-a05b-5e0915f66e43
signer            : wapt.lesfourmisduweb.org
signer_fingerprint: 8da83ebdac1a25e820b186510d049f47407b11835b0664fdc5bacd3595b1671d
signature         : pFiaQJPSNlPAWL48WMMUUhjR7i20nQMKzQOoABp+J/ThROOZn0CyknqsZdVzxFB4j3WsSmqMXOf/5pSJsWQTQ1o1kVW4Pv2Qea2zqUMjroFuHl9sgQfHxyKuXxOvdLMn8FkU1Pl9P97VlP4eF3r0d7doqWUOH4HGUMfvNywzcrTuPwCfyF1W3UYGvRh1zidYnJa894sLdPOJ580Eiub+CyWPa1zSGKmbfcny6wiiIpJzrBLnqQiwpJpnWUGdaOL/BOJfMwE29meUjEbZDpq1E0UOjrKFXtestmMnEDaim6w3RPMfQecG2LvxdW6Q1h9OPIaZ6SuPKLIi8MovtiMaDQ==
signature_date    : 20190128-215949
signed_attributes : package,version,architecture,section,priority,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,audit_schedule,editor,keywords,licence,homepage,package_uuid,signer,signer_fingerprint,signature_date,signed_attributes






Fichier setup.py :

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

uninstallkey = []

def install():
   print('installing virtualbox')

   version_exe = control['version'].split('-',1)[0]

   for exe in glob.glob('*.exe'):
        silentflags='--silent --msiparams REBOOT=ReallySuppress'

        force = WAPT and WAPT.options.force

        if not installed_softwares('Oracle VM VirtualBox ' + version_exe) or force:
            if isrunning('virtualbox.exe') and not force:
                error('VirtualBOX is running !')
            run(r'"%s" %s' % (exe,silentflags),accept_returncodes=[0,3010],timeout=300)
        else:
            print('Exe setup %s already installed. Skipping' % exe)

        if not installed_softwares('Oracle VM VirtualBox ' + version_exe):
            error('Setup %s has been and uninstall but %s not found' % (exe,'Oracle VM VirtualBox ' + version_exe))


#Remove all file extpack
   for file in glob.glob(makepath(programfiles64,'Oracle','VirtualBox','*.vbox-extpack')) :
        remove_file(file)

#Copy new extpack


#Install new extpack
   for ext in glob.glob('*.vbox-extpack'):
       filecopyto(ext,makepath(programfiles64,'Oracle','VirtualBox',ext))
       try:
            run('echo y | "%s" extpack install --replace "%s"' %(makepath(programfiles64,'Oracle','VirtualBox','VBoxManage.exe'),ext) )
       except:
            run('"%s" extpack cleanup ' %(makepath(programfiles64,'Oracle','VirtualBox','VBoxManage.exe')) )
            run('echo y | "%s" extpack install --replace "%s"' %(makepath(programfiles64,'Oracle','VirtualBox','VBoxManage.exe'),ext) )

#Remove shortcut
   remove_desktop_shortcut('Oracle VM VirtualBox')



def uninstall():
    killalltasks('virtualbox.exe')
    for soft in installed_softwares('Oracle VM VirtualBox'):
        run(uninstall_cmd(soft['key']))

    for file in glob.glob(makepath(programfiles64,'Oracle','VirtualBox','*.vbox-extpack')) :
        remove_file(file)


def update_package():
    for line in  wgets("https://www.virtualbox.org/wiki/Downloads").splitlines() :
        if ".exe" in line :
            linkinstalleur = line[line.find('href="') +6 : line.find('"><span')]
            fileinstalleur = linkinstalleur.rsplit('/',1)[1]
        if "vbox-extpack" in line and not 'Old' in line :
            linkext = line[line.find('href="') + 6 : line.find('"><span')]
            fileext = linkext.rsplit('/',1)[1]
    if not isfile(fileinstalleur):
        wget(linkinstalleur,fileinstalleur)
    else:
        print('File %s already exist' % fileinstalleur)
    if not isfile(fileext):
        wget(linkext,fileext)
    else:
        print('File %s already exist' % fileext)

    for exe in glob.glob('*.exe'):
        if exe != fileinstalleur:
            remove_file(exe)

    for ext in glob.glob('*.vbox-extpack'):
        if ext != fileext:
            remove_file(ext)


    vers = get_file_properties(fileinstalleur)['ProductVersion'].rsplit('.',1)[0]
    print('Latest version is : '+ vers)

    os.chdir(os.path.dirname(__file__))

    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())

    pe.version = vers + '-0'
    pe.save_control_to_wapt(os.getcwd())


if __name__ == '__main__':
    update_package()