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


def update_package():
    # Declaring local variables
    result = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    binn = "Intel-Driver-and-Support-Assistant-Installer.exe"
    url_dl = "https://dsadata.intel.com/installer"

    print("Download url is: %s" % url_dl)


    wget(url_dl, binn, proxies=proxies)

    version = get_version_from_binary(binn)

    # Changing version of the package
    if Version(version) != Version(control.get_software_version()):
        result = True
    control.set_software_version(version)
    control.save_control_to_wapt()

    # Validating update-package-sources
    return result