tis-opera 48.0.2685.52-1

  • package : tis-opera
  • version : 48.0.2685.52-1
  • description : Opera est un navigateur Web gratuit et multiplate-forme développé par la société norvégienne Opera Software
  • maintainer : Simon Fonteneau
  • date : 2018-02-27 19:06:06

setup.py

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


uninstallkey = []

def install():
    if windows_version() > Version('5.2'):
        print('installing smp-operainstaller')
        versionpaquet = control['version'].split('-',1)[0]
        if iswin64():
            install_exe_if_needed("Opera_%s_Setup_x64.exe" % versionpaquet,'/install /silent /launchopera 0 /setdefaultbrowser 0',key='Opera %s' % versionpaquet,min_version=versionpaquet)
        else:
            install_exe_if_needed("Opera_%s_Setup.exe" % versionpaquet,'/install /silent /launchopera 0 /setdefaultbrowser 0',key='Opera %s' % versionpaquet,min_version=versionpaquet)

        remove_desktop_shortcut('Opera')

        uninstallkey.remove('Opera %s' % versionpaquet)

        for task in run('schtasks').splitlines() :
            if 'Opera scheduled Autoupdate' in task:
                taskname = task.split('   ')[0]
                run_notfatal('schtasks /Delete /tn "%s" /f' % taskname)



def uninstall():
    for uninstall in installed_softwares('Opera Stable'):
       killalltasks('video_editor.exe')
       cmd = uninstall['uninstall_string'] + ' /silent'
       run(cmd)

def update_package():
    import re

    re_versions = re.compile('<a href="([\d\.]*)/">')
    index = wgets('https://get.geo.opera.com/pub/opera/desktop/')
    # find latest
    for version in reversed(sorted(re_versions.findall(index))):
        try:
            last_version = version

            if not isfile('Opera_%s_Setup.exe' % last_version):
                wget('https://get.geo.opera.com/pub/opera/desktop/%s/win/Opera_%s_Setup.exe' % (last_version,last_version),'Opera_%s_Setup.exe' % (last_version) )

            if not isfile('Opera_%s_Setup_x64.exe' % last_version):
                wget('https://get.geo.opera.com/pub/opera/desktop/%s/win/Opera_%s_Setup_x64.exe' % (last_version,last_version),'Opera_%s_Setup_x64.exe' % (last_version))

            vers = get_file_properties('Opera_%s_Setup.exe' % last_version)['ProductVersion']

            allexe = glob.glob('*.exe')
            for exe in allexe:
                vers = get_file_properties(exe)['ProductVersion']
                if vers != last_version :
                    remove_file(exe)

            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())
            return(0)
        except:
            if isfile('Opera_%s_Setup.exe' % last_version):
                print last_version
                return 0


if __name__ == '__main__':
    update_package()

if __name__ == '__main__':
    update_package()
    

Changelog

No changelog
    

manifest.sha256

[["Opera_48.0.2685.52_Setup.exe", "6c7fea56a89aa75dba8508ccc4bdde74cadee89db04a6044abe8bca47b9d9891"], ["WAPT/icon.png", "d2364fd7d7cd0ace56e569bd48b98ba0c15d94a2826ccbd2fbeececd779164ca"], ["Opera_48.0.2685.52_Setup_x64.exe", "3f50eb0979c8e124f3eeb002feafb252bf9345fc37f25be5ae489cc1b49a65f9"], ["WAPT/wapt.psproj", "795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["setup.py", "f7b2ebf625d1c9cb5c7ff0aede19db71438ccf7c3209988a3f9eed6e5b0c2062"], ["WAPT/control", "2c1f0257933353e887c221088230cf5605096b9c6bbc04eb4fe88bce546842fc"]]