Skip to content

Commit

Permalink
fix(icue): re-enable package with a new updater (#158)
Browse files Browse the repository at this point in the history
Signed-off-by: mikeee <hey@mike.ee>
  • Loading branch information
mikeee authored Oct 30, 2024
1 parent d03ccff commit 70f2740
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 15 additions & 14 deletions disabled/icue/update.ps1 → automatic/icue/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

. $PSScriptRoot\..\..\scripts\all.ps1

$releases = 'https://www.guru3d.com/files-details/corsair-utility-engine-download-icue-download.html'
$releases = 'https://www.corsair.com/uk/en/s/downloads'
$releaseUrl = 'https://www3.corsair.com/software/CUE_V5/public/modules/windows/installer/Install%20iCUE.exe'

$checksumType = 'SHA256'

function global:au_SearchReplace {
@{
Expand All @@ -14,30 +17,28 @@ function global:au_SearchReplace {
}
}

function global:au_BeforeUpdate {
$Latest.Checksum = Get-RemoteChecksum $Latest.Url
$Latest.ChecksumType = 'SHA256'
}

function global:au_AfterUpdate {
Set-DescriptionFromReadme -SkipFirst 2
}

function global:au_GetLatest {
$tempFile = New-TemporaryFile
Invoke-WebRequest -Uri $releaseUrl -OutFile $tempFile -UseBasicParsing

$checksum = Get-FileHash -Algorithm $checksumType -Path $tempFile -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Hash

$page = Invoke-WebRequest -Uri $releases -UseBasicParsing -UserAgent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246"
$regexVersion = 'Corsair[\s]+Utility[\s]+Engine[\s]+Download[\s]+\(iCUE\)[\s]+Download[\s]+v(?<version>[\d\.]+)'
$regexVersion = 'CORSAIR iCUE v(?<version>[\d\.]+) with iCUE Murals'

$matched = $page.Content -match $regexVersion

If ($False -ne $matched) {
$url = -join("https://downloads.corsair.com/Files/CUE/iCUESetup_",$matches["version"],"_release.msi")
$version = $matches["version"]
}

return @{
URL = $url
Version = $version
URL = $releaseUrl
Checksum = $checksum
ChecksumType = $checksumType
Version = $matches.version
}
}

update -ChecksumFor none
update -ChecksumFor none

0 comments on commit 70f2740

Please sign in to comment.