diff --git a/disabled/icue/README.md b/automatic/icue/README.md similarity index 100% rename from disabled/icue/README.md rename to automatic/icue/README.md diff --git a/disabled/icue/icue.nuspec b/automatic/icue/icue.nuspec similarity index 100% rename from disabled/icue/icue.nuspec rename to automatic/icue/icue.nuspec diff --git a/disabled/icue/tools/chocolateyInstall.ps1 b/automatic/icue/tools/chocolateyInstall.ps1 similarity index 100% rename from disabled/icue/tools/chocolateyInstall.ps1 rename to automatic/icue/tools/chocolateyInstall.ps1 diff --git a/disabled/icue/update.ps1 b/automatic/icue/update.ps1 similarity index 53% rename from disabled/icue/update.ps1 rename to automatic/icue/update.ps1 index da8aeb47..6f3247b9 100644 --- a/disabled/icue/update.ps1 +++ b/automatic/icue/update.ps1 @@ -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 { @{ @@ -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(?[\d\.]+)' + $regexVersion = 'CORSAIR iCUE v(?[\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 \ No newline at end of file +update -ChecksumFor none