enable sending unsupported versions to google forms

This commit is contained in:
amd64fox
2025-10-13 07:51:54 +03:00
parent cb1eab3663
commit 6d9a3ec257
+16 -11
View File
@@ -776,17 +776,25 @@ if ($spotifyInstalled) {
# Unsupported version Spotify # Unsupported version Spotify
if ($testversion) { if ($testversion) {
# Submit unsupported version of Spotify to google form for further processing # Submit unsupported version of Spotify to google form for further processing
$binary = if (Test-Path $spotifyDll) {
$spotifyDll
}
else {
$spotifyExecutable
}
Start-Job -ScriptBlock {
param($binary, $win_os, $psv, $online, $offline)
try { try {
# Country check
$country = [System.Globalization.RegionInfo]::CurrentRegion.EnglishName $country = [System.Globalization.RegionInfo]::CurrentRegion.EnglishName
$txt = [IO.File]::ReadAllText($binary)
$txt = [IO.File]::ReadAllText($spotifyExecutable)
$regex = "(?<![\w\-])(\d+)\.(\d+)\.(\d+)\.(\d+)(\.g[0-9a-f]{8})(?![\w\-])" $regex = "(?<![\w\-])(\d+)\.(\d+)\.(\d+)\.(\d+)(\.g[0-9a-f]{8})(?![\w\-])"
$matches = [regex]::Matches($txt, $regex) $matches = [regex]::Matches($txt, $regex)
$ver = $matches[0].Value $ver = $matches[0].Value
$Parameters = @{ $Parameters = @{
Uri = 'https://docs.google.com/forms/d/e/1FAIpQLSegGsAgilgQ8Y36uw-N7zFF6Lh40cXNfyl1ecHPpZcpD8kdHg/formResponse' Uri = 'https://docs.google.com/forms/d/e/1FAIpQLSegGsAgilgQ8Y36uw-N7zFF6Lh40cXNfyl1ecHPpZcpD8kdHg/formResponse'
Method = 'POST' Method = 'POST'
@@ -798,13 +806,10 @@ if ($spotifyInstalled) {
'entry.2067427976' = $online + " < " + $offline 'entry.2067427976' = $online + " < " + $offline
} }
} }
# $null = Invoke-WebRequest -useb @Parameters Invoke-WebRequest @Parameters -UseBasicParsing -ErrorAction SilentlyContinue | Out-Null
}
catch {
Write-Host 'Unable to submit new version of Spotify'
Write-Host "error description: "$Error[0]
Write-Host
} }
catch { }
} -ArgumentList $binary, $win_os, $psv, $online, $offline | Out-Null
if ($confirm_spoti_recomended_over -or $confirm_spoti_recomended_uninstall) { if ($confirm_spoti_recomended_over -or $confirm_spoti_recomended_uninstall) {
Write-Host ($lang).NewV`n Write-Host ($lang).NewV`n