Skip to content

Commit

Permalink
Merge pull request #736 from aaronparker/apps
Browse files Browse the repository at this point in the history
Apps
  • Loading branch information
aaronparker authored Aug 31, 2024
2 parents c7d7e54 + d819e5a commit 6433fd7
Show file tree
Hide file tree
Showing 13 changed files with 199 additions and 74 deletions.
30 changes: 30 additions & 0 deletions Evergreen/Apps/Get-AWSAppStreamClient.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function Get-AWSAppStreamClient {
<#
.NOTES
Site: https://stealthpuppy.com
Author: Aaron Parker
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
param (
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Get the update feed from RSS
$UpdateFeed = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri

# Get the latest version from the feed
$LatestItem = $UpdateFeed | Where-Object { $_.title -match $res.Get.Update.MatchText } | Select-Object -First 1
$LatestVersion = [RegEx]::Match(($LatestItem | Select-Object -ExpandProperty "description"), $res.Get.Update.MatchVersion).Captures.Groups[1].Value

[PSCustomObject]@{
Version = $LatestVersion
Date = $LatestItem.pubDate
Type = Get-FileType -File $res.Get.Download.Uri
URI = $res.Get.Download.Uri -replace $res.Get.Download.ReplaceText, $LatestVersion
} | Write-Output
}
42 changes: 42 additions & 0 deletions Evergreen/Apps/Get-AdvancedInstaller.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Function Get-AdvancedInstaller {
<#
.NOTES
Author: Aaron Parker
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Get the update feed
$params = @{
Uri = $res.Get.Update.Uri
UserAgent = $res.Get.Update.UserAgent
}
$UpdateFeed = Invoke-EvergreenRestMethod @params
if ($null -ne $UpdateFeed) {

# Convert the INI update feed to an object, replace strings that break conversion
$Updates = ConvertFrom-IniFile -InputObject ($UpdateFeed -replace ";aiu;", "" -replace "\[advinst", "[")

# Get the latest version
$LatestVersion = $Updates.Keys | `
Sort-Object -Property @{ Expression = { [System.Version]$_.Version }; Descending = $true } | `
Select-Object -First 1
$LatestUpdate = $Updates[$LatestVersion]

# Output the latest version
[PSCustomObject]@{
Version = $LatestVersion
Size = $LatestUpdate.Size.Trim()
Sha256 = $LatestUpdate.SHA256.Trim()
Type = Get-FileType -File $LatestUpdate.URL
URI = $LatestUpdate.URL.Trim()
} | Write-Output
}
}
9 changes: 5 additions & 4 deletions Evergreen/Apps/Get-EgnyteDesktopApp.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-EgnyteDesktopApp {
function Get-EgnyteDesktopApp {
<#
.SYNOPSIS
Get the current version and download URL for the Egnyte Desktop App.
Expand All @@ -9,9 +9,9 @@ Function Get-EgnyteDesktopApp {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
Expand All @@ -20,12 +20,13 @@ Function Get-EgnyteDesktopApp {

# Get update from the application update URI
$Update = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri
If ($Null -ne $Update) {
if ($null -ne $Update) {

# Construct the output; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
Version = $Update.enclosure.version
SHA1 = $Update.enclosure.sha1Checksum
Type = Get-FileType -File $Update.enclosure.url
URI = $Update.enclosure.url
}
Write-Output -InputObject $PSObject
Expand Down
40 changes: 22 additions & 18 deletions Evergreen/Apps/Get-FoxitReader.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,41 @@ function Get-FoxitReader {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Query the Foxit Reader package download form to get the JSON
# TODO: Fix issue with Invoke-EvergreenRestMethod that produces "Operation is not valid due to the current state of the object."
$params = @{
Uri = $res.Get.Update.Uri
UseBasicParsing = $true
}
if (Test-ProxyEnv) {
$params.Proxy = $script:EvergreenProxy
}
if (Test-ProxyEnv -Creds) {
$params.ProxyCredential = $script:EvergreenProxyCreds
}
Write-Verbose -Message "$($MyInvocation.MyCommand): Query: $($res.Get.Update.Uri)"
$updateFeed = Invoke-RestMethod @params
if ($null -ne $updateFeed) {
# $params = @{
# Uri = $res.Get.Update.Uri
# UseBasicParsing = $true
# }
# if (Test-ProxyEnv) {
# $params.Proxy = $script:EvergreenProxy
# }
# if (Test-ProxyEnv -Creds) {
# $params.ProxyCredential = $script:EvergreenProxyCreds
# }
# Write-Verbose -Message "$($MyInvocation.MyCommand): Query: $($res.Get.Update.Uri)"
# $updateFeed = Invoke-RestMethod @params
$UpdateFeed = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri

if ($null -ne $UpdateFeed) {

# Grab latest version. Removed Sort-Object because Foxit moved to a 5 part version number
# $Version = ($updateFeed.package_info.version | Sort-Object { [System.Version]$_ } -Descending) | Select-Object -First 1
$Version = $UpdateFeed.package_info.version | Select-Object -First 1

# Grab latest version
$Version = ($updateFeed.package_info.version | Sort-Object { [System.Version]$_ } -Descending) | Select-Object -First 1
if ($null -ne $Version) {
Write-Verbose -Message "$($MyInvocation.MyCommand): Found version: $Version."

# Build the output object for each language. Excludes languages with out-of-date versions
foreach ($language in ($updateFeed.package_info.language | Get-Member -MemberType "NoteProperty")) {
foreach ($language in ($UpdateFeed.package_info.language | Get-Member -MemberType "NoteProperty")) {

# Build the download URL; Follow the download link which will return a 301/302
Write-Verbose -Message "$($MyInvocation.MyCommand): Return details for language: $($updateFeed.package_info.language.($language.Name))."
Expand Down
37 changes: 10 additions & 27 deletions Evergreen/Apps/Get-MozillaThunderbird.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,22 @@ function Get-MozillaThunderbird {

# Select the download file for the selected platform
foreach ($installer in $res.Get.Download.Uri[$channel.Key].GetEnumerator()) {
Write-Verbose -Message "$($MyInvocation.MyCommand): Resolve URL for: $($channel.Key)"

# Get the version for this channel
$RawVersion = $Versions.($channel.Key)
$Version = $Versions.($channel.Key) -replace $res.Get.Download.ReplaceText.Version, ""
Write-Verbose -Message "$($MyInvocation.MyCommand): Channel: $($channel.Key) - found version: $Version."

$params = @{
Uri = (($res.Get.Download.Uri[$channel.Key][$installer.Key] -replace $res.Get.Download.ReplaceText.Platform, $platform) `
-replace $res.Get.Download.ReplaceText.Language, $currentLanguage)
-replace $res.Get.Download.ReplaceText.Language, $currentLanguage) -replace "#version", $RawVersion
ErrorAction = "SilentlyContinue"
WarningAction = "SilentlyContinue"
}
$Url = Resolve-InvokeWebRequest @params
if ($null -ne $Url) {

# Catch if version is null
if ([System.String]::IsNullOrEmpty($Versions.$($channel.Key))) {
Write-Verbose -Message "$($MyInvocation.MyCommand): No version info for channel: $($channel.Key)."
$Version = "Unknown"
}
else {
$Version = $Versions.$($channel.Key) -replace $res.Get.Download.ReplaceText.Version, ""
Write-Verbose -Message "$($MyInvocation.MyCommand): Found version: $Version."
}

# Build object and output to the pipeline
$PSObject = [PSCustomObject] @{
Version = $Version
Expand All @@ -68,22 +64,9 @@ function Get-MozillaThunderbird {
}
}

# Build an MSIX object and output to the pipeline
if ((Get-Architecture -String $platform) -eq "x64") {
$Url = $res.Get.Download.Msix -replace $res.Get.Download.ReplaceText.Platform, $platform `
-replace "#version", $Version

$PSObject = [PSCustomObject] @{
Version = $Version
Channel = $channel.Value
Language = "Multi"
Architecture = "x64"
Type = Get-FileType -File $Url
Filename = (Split-Path -Path $Url -Leaf).Replace('%20', ' ')
URI = $Url
}
Write-Output -InputObject $PSObject
}
# Remove variables for next iteration
Remove-Variable -Name "Version" -ErrorAction "SilentlyContinue"
Remove-Variable -Name "Url" -ErrorAction "SilentlyContinue"
}
}
}
20 changes: 12 additions & 8 deletions Evergreen/Apps/Get-Zotero.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ Function Get-Zotero {
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Get the latest download
$Response = Resolve-SystemNetWebRequest -Uri $res.Get.Download.Uri
foreach ($Uri in $res.Get.Download.Uri) {
# Get the latest download
$Response = Resolve-SystemNetWebRequest -Uri $Uri

# Construct the output; Return the custom object to the pipeline
If ($Null -ne $Response) {
$PSObject = [PSCustomObject] @{
Version = [RegEx]::Match($Response.ResponseUri.LocalPath, $res.Get.Download.MatchVersion).Captures.Groups[1].Value
URI = $Response.ResponseUri.AbsoluteUri
# Construct the output; Return the custom object to the pipeline
if ($null -ne $Response) {
$PSObject = [PSCustomObject] @{
Version = [RegEx]::Match($Response.ResponseUri.LocalPath, $res.Get.Download.MatchVersion).Captures.Groups[1].Value
Architecture = Get-Architecture -String $Response.ResponseUri.AbsoluteUri
Type = Get-FileType -File $Response.ResponseUri.AbsoluteUri
URI = $Response.ResponseUri.AbsoluteUri
}
Write-Output -InputObject $PSObject
}
Write-Output -InputObject $PSObject
}
}
26 changes: 26 additions & 0 deletions Evergreen/Manifests/AWSAppStreamClient.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"Name": "AWS AppStream 2.0 Client",
"Source": "https://docs.aws.amazon.com/en_us/appstream2/latest/developerguide/client-release-versions.html",
"Get": {
"Update": {
"Uri": "https://docs.aws.amazon.com/en_us/appstream2/latest/developerguide/doc-history.rss",
"MatchVersion": "(\\d+(\\.\\d+){1,4}.*)",
"MatchText": "New client version"
},
"Download": {
"Uri": "https://clients.amazonappstream.com/installers/windows/AmazonAppStreamClientSetup_#version.exe",
"ReplaceText": "#version"
}
},
"Install": {
"Setup": "",
"Physical": {
"Arguments": "",
"PostInstall": []
},
"Virtual": {
"Arguments": "",
"PostInstall": []
}
}
}
25 changes: 25 additions & 0 deletions Evergreen/Manifests/AdvancedInstaller.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"Name": "Advanced Installer",
"Source": "https://www.advancedinstaller.com",
"Get": {
"Update": {
"Uri": "https://www.advancedinstaller.com/downloads/updates.ini",
"ContentType": "text/plain; charset=utf-8",
"UserAgent": "AdvancedInstaller"
},
"Download": {
"Uri": ""
}
},
"Install": {
"Setup": "",
"Physical": {
"Arguments": "",
"PostInstall": []
},
"Virtual": {
"Arguments": "",
"PostInstall": []
}
}
}
2 changes: 1 addition & 1 deletion Evergreen/Manifests/EgnyteDesktopApp.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Source": "https://www.egnyte.com/solutions/sharing-collaboration",
"Get": {
"Update": {
"Uri": "https://egnyte-cdn.egnyte.com/egnytedrive/win/en-us/subscribe"
"Uri": "https://egnyte-cdn.egnyte.com/egnytedrive/win/en-us/versions/default.xml"
}
},
"Install": {
Expand Down
1 change: 0 additions & 1 deletion Evergreen/Manifests/FoxitReader.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"DateTimePattern": "MM/dd/yy"
},
"Download": {
"Exe": "https://www.foxitsoftware.com/downloads/latest.html?product=Foxit-Reader&platform=Windows&version=#Version&package_type=#Package&language=#Language",
"Uri": "https://www.foxitsoftware.com/downloads/latest.html?product=Foxit-Enterprise-Reader&platform=Windows&version=#Version&package_type=msi&language=#Language&distID="
}
},
Expand Down
30 changes: 17 additions & 13 deletions Evergreen/Manifests/MozillaThunderbird.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,34 @@
"Uri": "https://product-details.mozilla.org/1.0/thunderbird_versions.json",
"Channels": {
"LATEST_THUNDERBIRD_VERSION": "Current",
"LATEST_THUNDERBIRD_DEVEL_VERSION": "Beta"
"LATEST_THUNDERBIRD_DEVEL_VERSION": "Beta",
"THUNDERBIRD_ESR": "ESR",
"THUNDERBIRD_ESR_NEXT": "ESR_Next"
}
},
"Download": {
"Uri": {
"LATEST_THUNDERBIRD_VERSION": {
"Exe": "https://download.mozilla.org/?product=thunderbird-latest-ssl&os=#platform&lang=#language",
"Msi": "https://download.mozilla.org/?product=thunderbird-msi-latest-ssl&os=#platform&lang=#language"
"Exe": "https://download.mozilla.org/?product=thunderbird-#version-SSL&os=#platform&lang=#language",
"Msi": "https://download.mozilla.org/?product=thunderbird-#version-msi-SSL&os=#platform&lang=#language",
"Msix": "https://download.mozilla.org/?product=thunderbird-#version-msix-SSL&os=#platform&lang=#language"
},
"LATEST_THUNDERBIRD_DEVEL_VERSION": {
"Exe": "https://download.mozilla.org/?product=thunderbird-beta-latest-SSL&os=#platform&lang=#language",
"Msi": "https://download.mozilla.org/?product=thunderbird-beta-latest-msi-SSL&os=#platform&lang=#language",
"Msix": "https://download.mozilla.org/?product=thunderbird-beta-latest-msix-SSL&os=#platform&lang=#language"
},
"THUNDERBIRD_ESR": {
"Exe": "https://download.mozilla.org/?product=thunderbird-esr-latest-ssl&os=#platform&lang=#language",
"Msi": "https://download.mozilla.org/?product=thunderbird-esr-msi-latest-ssl&os=#platform&lang=#language"
"Exe": "https://download.mozilla.org/?product=thunderbird-#version-SSL&os=#platform&lang=#language",
"Msi": "https://download.mozilla.org/?product=thunderbird-#version-msi-SSL&os=#platform&lang=#language",
"Msix": "https://download.mozilla.org/?product=thunderbird-#version-msix-SSL&os=#platform&lang=#language"
},
"THUNDERBIRD_ESR_NEXT": {
"Exe": "https://download.mozilla.org/?product=thunderbird-esr-next-latest-ssl&os=#platform&lang=#language",
"Msi": "https://download.mozilla.org/?product=thunderbird-esr-next-msi-latest-ssl&os=#platform&lang=#language"
},
"LATEST_THUNDERBIRD_DEVEL_VERSION": {
"Exe": "https://download.mozilla.org/?product=thunderbird-beta-latest-ssl&os=#platform&lang=#language",
"Msi": "https://download.mozilla.org/?product=thunderbird-beta-msi-latest-ssl&os=#platform&lang=#language"

"Exe": "https://download.mozilla.org/?product=thunderbird-#version-SSL&os=#platform&lang=#language",
"Msi": "https://download.mozilla.org/?product=thunderbird-#version-msi-SSL&os=#platform&lang=#language",
"Msix": "https://download.mozilla.org/?product=thunderbird-#version-msix-SSL&os=#platform&lang=#language"
}
},
"Msix": "http://archive.mozilla.org/pub/thunderbird/releases/#version/#platform/multi/Thunderbird%20Setup%20#version.msix",
"Platforms": [
"win64",
"win"
Expand Down
9 changes: 8 additions & 1 deletion Evergreen/Manifests/Zotero.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
"Uri": ""
},
"Download": {
"Uri": "https://www.zotero.org/download/client/dl?channel=release&platform=win32",
"Uri": [
"https://www.zotero.org/download/client/dl?channel=release&platform=win-x64",
"https://www.zotero.org/download/client/dl?channel=release&platform=win-x64-zip",
"https://www.zotero.org/download/client/dl?channel=release&platform=win32",
"https://www.zotero.org/download/client/dl?channel=release&platform=win32-zip",
"https://www.zotero.org/download/client/dl?channel=release&platform=win-arm64",
"https://www.zotero.org/download/client/dl?channel=release&platform=win-arm64-zip"
],
"Property": "ResponseUri.Headers.Location",
"MatchVersion": "(\\d+(\\.\\d+){1,4})"
}
Expand Down
2 changes: 1 addition & 1 deletion Evergreen/Shared/Resolve-MicrosoftFwLink.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Resolve-MicrosoftFwLink {

[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Int32] $MaximumRedirection = 2
[System.Int32] $MaximumRedirection = 1
)

process {
Expand Down

0 comments on commit 6433fd7

Please sign in to comment.