tis-virtualbox 5.2.12-2

  • package : tis-virtualbox
  • version : 5.2.12-2
  • description : Free virtualization software published by Oracle
  • maintainer : Kevin Guerineau
  • date : 2018-05-11 17:17:47

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

Changelog

No changelog
    

manifest.sha256

[["VirtualBox-5.2.12-122591-Win.exe", "d039d27bd27937db7489dfefc854975573828ee066e37fec908579db37b6c2a0"], ["WAPT/icon.png", "caf92a1846229dc6b49fca1c96ba29e4be8e1ab0d4f83d05711c338a8f398879"], ["WAPT/certificate.crt", "13fb474c5c23c135a77aba592eb8821b9ecbcc463f5b7312312b87b20eac6779"], ["WAPT/wapt.psproj", "df3e2fa87fea9c7bdfcc22039b9ef7303f092898882d9f3f4233f5d92f90b3c7"], ["Oracle_VM_VirtualBox_Extension_Pack-5.2.12.vbox-extpack", "4c36d129f17dcab2bb37292022f1b1adfefa5f32a3161b0d5d40784bc8acf4d0"], ["setup.py", "0c97d9ac6584fc5aa861184a5c66a97d05299f94b048367560c64e68de7a931b"], ["WAPT/control", "42b8b20f279c96d60a8ecd110c956993bd8eba5b2b171f5f15faa30c1d8e45a4"]]