ScoopInstaller / Extras

📦 The Extras bucket for Scoop.
https://scoop.sh
The Unlicense
1.78k stars 1.34k forks source link

[Bug]: Spotify errors when starting it after it has downloaded an update #12429

Open DavideCanton opened 9 months ago

DavideCanton commented 9 months ago

Prerequisites

Package Name

Spotify

Expected/Current Behaviour

Starting spotify when it has downloaded an update hangs forever. The only way to fix it is to remove the Update folder from AppData/Local/Spotify. This persists until the updated package is published on scoop.

Steps to Reproduce

- Install spotify with `scoop install spotify`.
- Wait for spotify to publish an update
- Start spotify. The updater kicks in and hangs.

Possible Solution

No clue, sorry.

Scoop and Buckets Version

PS> scoop --version
Current Scoop version:
v0.3.1 - Released at 2022-11-15

'extras' bucket:
15bf67d86 (HEAD -> master, origin/master, origin/HEAD) wavebox: Update to version 10.120.11.2

'main' bucket:
33de467bf (HEAD -> master, origin/master, origin/HEAD) scaleway-cli: Update to version 2.26.0

Scoop Config

PS> scoop config
last_update                       scoop_branch scoop_repo
-----------                       ------------ ----------
2023-12-07T15:27:56.4278569+01:00 master       https://github.com/ScoopInstaller/Scoop

PowerShell Version

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.2364
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.2364
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional Softwares

No response

thedjdoorn commented 8 months ago

The current workaround would be to either block the current user from writing to the Updates directory and/or blocking the update urls in the hosts file. Adding an optional script to block the updater might look like this (I had ChatGPT whip it up for me):


# Define the hosts file path
$hostsFilePath = "C:\Windows\System32\drivers\etc\hosts"

$entriesToAdd = @(
"127.0.0.1 upgrade.spotify.com",
"127.0.0.1 www.spotify-desktop.com",
"127.0.0.1 sto3-accesspoint-a88.sto3.spotify.net",
"127.0.0.1 upgrade.scdn.co",
"127.0.0.1 beta.spotify.map.fastly.net",
"127.0.0.1 prod.spotify.map.fastlylb.net"
)

# Check if the hosts file exists
if (Test-Path $hostsFilePath) {
    try {
        # Open the hosts file for writing (append mode)
        $hostsFile = [System.IO.File]::AppendAllText($hostsFilePath, [Environment]::NewLine)

        # Add entries to the hosts file
        foreach ($entry in $entriesToAdd) {
            $hostsFile = [System.IO.File]::AppendAllText($hostsFilePath, "$entry`r`n")
        }

        Write-Host "Entries added to the hosts file successfully."
    }
    catch {
        Write-Host "Error: $($_.Exception.Message)"
    }
}
else {
    Write-Host "Error: Hosts file not found at $hostsFilePath."
}
SeWieland commented 1 month ago

=> The community workaround stopped working IMHO and adding entries to the hosts file should not be done automatically.

But maybe a installer note would be nice until theres a better way.

In the meantime: Just run scoop update -f spotify once in a while