tis-spotify icon

Spotify

Silent install package for Spotify

1.1.97.962-27

  • package: tis-spotify
  • name: Spotify
  • version: 1.1.97.962-27
  • categories: Media
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • editor: Spotify AB
  • licence: Proprietary
  • locale: all
  • target_os: windows
  • impacted_process: Spotify,SpotifyStartupTask,SpotifyMigrator
  • architecture: all
  • signature_date:
  • size: 79.47 Mo
  • homepage : https://www.spotify.com/download
  • conflicts :

package           : tis-spotify
version           : 1.1.97.962-27
architecture      : all
section           : base
priority          : optional
name              : Spotify
categories        : Media
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : Spotify Desktop Client - Installation in user environment
depends           : 
conflicts         : tis-spotify-uwp
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.0
sources           : 
installed_size    : 
impacted_process  : Spotify,SpotifyStartupTask,SpotifyMigrator
description_fr    : Client Spotify pour Bureau - Installation dans l'environnement utilisateur
description_pl    : Spotify Desktop Client - instalacja w środowisku użytkownika
description_de    : Spotify Desktop Client - Installation in der Benutzerumgebung
description_es    : Cliente de escritorio de Spotify - Instalación en el entorno del usuario
description_pt    : Spotify Desktop Client - Instalação em ambiente de utilizador
description_it    : Spotify Desktop Client - Installazione nell'ambiente utente
description_nl    : Spotify Desktop Client - Installatie in gebruikersomgeving
description_ru    : Spotify Desktop Client - установка в пользовательской среде
audit_schedule    : 
editor            : Spotify AB
keywords          : music
licence           : Proprietary
homepage          : https://www.spotify.com/download
package_uuid      : 7eada896-f1dc-4ca1-b704-382963ecb259
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 6.1
max_os_version    : 
icon_sha256sum    : ae600e0d4b046ee3db8d5e373a749f75516a4e39f2e7295753ace7c30682e8a6
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : IvQeO3oy4QmdM6JgPgz/XYKKFOVe7/Udbr7LvdjI3p/8hiBklDNW3Pst3B7fcHuZ84EbCSQ9ffeP/rLcGon4Ar72NuUP74PNsL9PuaQu6LhLvZNxU2YrZJPIKDJ454v5a/xKMYuRM8fkcmuBkapiq3ilae1iSbi+3MmWUlVyLWfYnxQw2ljpzwniKyaX7uRAaiQPERqNRdN9j07BbJB5qyoqoNIX7NQeEajDc+EaBXBaKi3M7WT4klt7M6qk2J4d2NWV5aHq7DH7AICDFjDaeTWjzGXTQJDuirdsHjb5MHkx+53Q7d5MySew9NyRsyf/TdG4n9qwIRuvT04Dw1tOBA==
signature_date    : 2022-11-01T20:00:21.151476
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes

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

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_name = "SpotifyFullSetup.exe"
app_name = "Spotify"
app_dir = makepath(programfiles, app_name)
bin_path = makepath(app_dir, bin_name)


def install():
    # Installing the software
    mkdirs(app_dir)
    print("Copying: %s to: %s" % (bin_name, app_dir))
    filecopyto(bin_name, app_dir)


def uninstall():
    # Uninstalling the software
    if isdir(app_dir):
        remove_tree(app_dir)


def session_setup():
    # Declaring local variables
    package_version = control.version.split("-")[0]
    user_reg_version = ".".join(
        registry_readstring(HKEY_CURRENT_USER, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Spotify", "DisplayVersion").split(".")[:4]
    )
    user_app_dir = makepath(user_appdata, app_name)
    user_app_path = makepath(user_app_dir, "Spotify.exe")

    # Removing Spotify Appx
    remove_user_appx("SpotifyAB.SpotifyMusic")

    # Determining to install the software or not based on user agreement
    if not registry_readstring(HKEY_CURRENT_USER, r"SOFTWARE\WAPT\%s" % app_name, "Install") or force:
        if params.get("install_with_luti", False):
            ask_to_install = 6
        else:
            ask_to_install = messagebox(
                "Configuring %s" % app_name, "Do you want to install %s on this user account?" % app_name, style=win32con.MB_YESNOCANCEL
            )
        if ask_to_install == 6:
            registry_setstring(HKEY_CURRENT_USER, r"SOFTWARE\WAPT\%s" % app_name, "Install", "Yes")
        elif ask_to_install == 7:
            registry_setstring(HKEY_CURRENT_USER, r"SOFTWARE\WAPT\%s" % app_name, "Install", "No")

    # Installing or Uninstalling the software in user environment
    if registry_readstring(HKEY_CURRENT_USER, r"SOFTWARE\WAPT\%s" % app_name, "Install") == "Yes":
        if package_version > user_reg_version or user_reg_version == "":
            print("Installing: %s (%s) in user environment" % (bin_name, package_version))
            install_exe_if_needed(bin_path, silentflags="/silent", min_version=package_version)
    elif registry_readstring(HKEY_CURRENT_USER, r"SOFTWARE\WAPT\%s" % app_name, "Install") == "No":
        if isfile(user_app_path):
            print("Uninstalling: %s from user environment" % (app_name))
            run('"%s" %s' % (user_app_path, "/uninstall /silent"))
        registry_delete(HKEY_CURRENT_USER, r"SOFTWARE\WAPT\%s" % app_name, "DisableAutorunOnce")

    # Disabling app autorun
    if not reg_value_exists(HKEY_CURRENT_USER, r"SOFTWARE\WAPT\%s" % app_name, "DisableAutorunOnce"):
        registry_delete(HKEY_CURRENT_USER, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", app_name)
        registry_setstring(HKEY_CURRENT_USER, r"SOFTWARE\WAPT\%s" % app_name, "DisableAutorunOnce", "Done")


def remove_user_appx(package):
    r"""Remove Windows AppX package from user environment

    Args:
        package (str): AppX Package name, asterisk character (*) can be used as wildcard

    .. versionadded:: 2.3

    """
    run_powershell('Get-AppxPackage "%s" | Remove-AppxPackage' % package)

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

# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_name = "SpotifyFullSetup.exe"


def update_package():
    # Declaring local variables
    result = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    url_dl = "https://download.scdn.co/SpotifyFullSetup.exe"
    latest_bin = url_dl.split("/")[-1]

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

    # Downloading latest binaries
    if isfile(latest_bin):
        remove_file(latest_bin)
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(url_dl, latest_bin, proxies=proxies)

        # Getting version from binary and renaming binary
        version = get_product_props(latest_bin)["FileVersion"]

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        result = True
    else:
        print("Software version up-to-date (%s)" % Version(version))
    control.version = "%s-%s" % (Version(version), control.version.split("-", 1)[-1])
    # control.set_software_version(version)
    control.save_control_to_wapt()

    # Validating update-package-sources
    return result

798e462780c714af2330af0ed22681d9c357a44384a82c0b04a8f3d89e6a243e : setup.py
83e95605b777c1b73b36122c3c2a8aa22193a8d55523c6d62141b920f083562d : SpotifyFullSetup.exe
db77c5df904d03c43bea788c61170e0ea050bb1de937ae37a9838cee9fa3d8e4 : update_package.py
ae600e0d4b046ee3db8d5e373a749f75516a4e39f2e7295753ace7c30682e8a6 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
868d02e0e304adaa8f60f33c27cb51509ebb080fde54f653b8d257947ebed2c9 : luti.json
c407d33130a927c82081f383d2ba20a3070dab84abae4d98d8476a916848c310 : WAPT/control