Skip to content

Commit

Permalink
(inkscape) drop 32 bit support
Browse files Browse the repository at this point in the history
As the 32bit version of inkscape has been dropped, remove support from package.
  • Loading branch information
TheCakeIsNaOH committed Nov 17, 2024
1 parent 96b3ca3 commit 0c5c177
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
10 changes: 1 addition & 9 deletions automatic/inkscape/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ $toolsPath = Split-Path -parent $MyInvocation.MyCommand.Definition
$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'msi'
url = 'https://inkscape.org/gallery/item/44620/inkscape-1.3.2_2023-11-25_091e20ef0f-x86.msi'
checksum = 'ADA39E3C380AF0E316630D33D31804A320E06D3EC5D8C093CBBC19A1276F81EE'
checksumType = 'sha256'
file64 = "$toolsPath\inkscape-1.3.2_2023-11-25_091e20e-x64.msi"
softwareName = 'InkScape*'
silentArgs = "/qn /norestart /l*v `"$($env:TEMP)\$($env:chocolateyPackageName).$($env:chocolateyPackageVersion).MsiInstall.log`" ALLUSERS=1"
Expand Down Expand Up @@ -37,12 +34,7 @@ elseif ($key.Count -gt 1) {
Write-Warning "Please uninstall InkScape before installing this package."
}

if ((Get-OSArchitectureWidth 32) -or ($env:chocolateyForceX86 -eq $true)) {
Install-ChocolateyPackage @packageArgs
}
else {
Install-ChocolateyInstallPackage @packageArgs
}
Install-ChocolateyInstallPackage @packageArgs

Get-ChildItem $toolsPath\*.msi | ForEach-Object { Remove-Item $_ -ea 0; if (Test-Path $_) { Set-Content "$_.ignore" } }

Expand Down
13 changes: 0 additions & 13 deletions automatic/inkscape/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ $domain = 'https://inkscape.org'

function global:au_BeforeUpdate {
Get-RemoteFiles -Purge -NoSuffix

Remove-Item "tools/$($Latest.FileName32)" # Embedding 32bit will make the package too large
}

function global:au_SearchReplace {
Expand All @@ -18,9 +16,6 @@ function global:au_SearchReplace {
"(?i)(^\s*checksum64\:).*" = "`${1} $($Latest.Checksum64)"
}
".\tools\chocolateyInstall.ps1" = @{
"(?i)(^\s*url\s*=\s*)'.*'" = "`${1}'$($Latest.URL32)'"
"(?i)(^\s*checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
"(?i)(^\s*checksumType\s*=\s*)'.*'" = "`${1}'$($Latest.ChecksumType32)'"
"(?i)(^\s*file64\s*=\s*`"[$]toolsPath\\).*" = "`${1}$($Latest.FileName64)`""
"(?i)(DisplayVersion\s*-eq\s*)'.*'" = "`${1}'$($Latest.RemoteVersion)'"
}
Expand All @@ -31,31 +26,23 @@ function global:au_SearchReplace {
}

function global:au_GetLatest {
# We know the 32bit executable is currently missing, as such
# we will prevent package update for this package until it has
# been decided whether 32bit support will be dropped or not.
throw "Updating of inkscape is disabled until it has been decided whether 32bit support will be dropped or not."

$redirUrl = Get-RedirectedUrl "$domain/release/"

$version = $redirUrl -split '\/(inkscape-)?' | Select-Object -last 1 -skip 1

try {
$32bit_page = Invoke-WebRequest "$redirUrl/windows/32-bit/msi/dl/" -UseBasicParsing
$64bit_page = Invoke-WebRequest "$redirUrl/windows/64-bit/msi/dl/" -UseBasicParsing
}
catch {
throw "Failed to download 32bit or 64bit executeble. Throwing minimized error to allow gist to be updated."
}

$re = '\.msi$'
$url32 = $32bit_page.links | Where-Object href -match $re | Select-Object -first 1 -expand href | ForEach-Object { $domain + $_ }
$url64 = $64bit_page.links | Where-Object href -match $re | Select-Object -first 1 -expand href | ForEach-Object { $domain + $_ }

@{
Version = $version
RemoteVersion = $version
URL32 = $url32
URL64 = $url64
ReleaseNotes = $redirUrl + "#left-column"
UpdateUrl = $redirUrl + "windows"
Expand Down

0 comments on commit 0c5c177

Please sign in to comment.