Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apps #774

Merged
merged 7 commits into from
Nov 23, 2024
Merged

Apps #774

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Evergreen/Apps/Get-AWSSMP.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
function Get-AWSSMP {
<#
.SYNOPSIS
Get the current versions and download URLs for AWS Session Manager Plugin

.NOTES
Author: Kirill Trofimov
#>
[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 latest version of AWS Session Manager Plugin via the latest tag on the repository
$Tags = Get-GitHubRepoTag -Uri $res.Get.Update.Uri

# Select the latest version
$Version = $Tags | Sort-Object -Property @{ Expression = { [System.Version]$_.Tag }; Descending = $true } | Select-Object -First 1

# Output the version and download URL
$PSObject = [PSCustomObject] @{
Version = $Version.Tag
Type = "exe"
URI = $res.Get.Download.Uri -replace $res.Get.Download.ReplaceText, $Version.Tag
}
Write-Output -InputObject $PSObject
}
39 changes: 39 additions & 0 deletions Evergreen/Apps/Get-AutoIt.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
function Get-AutoIt {
<#
.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
$Updates = ConvertFrom-IniFile -InputObject $UpdateFeed
foreach ($Key in $Updates.Keys) {

# Output the latest version
[PSCustomObject]@{
Version = $Updates[$Key].version
Date = ConvertTo-DateTime -DateTime $Updates[$Key].filetime -Pattern "yyyyMMddHHmmss"
Channel = $(if ($Key -match "Beta$") { "Beta" } else { "Stable" })
Size = $Updates[$Key].filesize
Type = Get-FileType -File $Updates[$Key].setup
URI = $Updates[$Key].setup
} | Write-Output
}
}
}
11 changes: 6 additions & 5 deletions Evergreen/Apps/Get-PaintDotNet.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-PaintDotNet {
function Get-PaintDotNet {
<#
.SYNOPSIS
Get the current version and download URL for the Paint.NET tools.
Expand All @@ -8,23 +8,24 @@ Function Get-PaintDotNet {
Twitter: @cit_bronson
#>
[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])
)

# Read the Paint.NET updates feed
$Content = Invoke-EvergreenWebRequest -Uri $res.Get.Uri
If ($Null -ne $Content) {
if ($null -ne $Content) {

# Convert the content from string data
$Data = $Content | ConvertFrom-StringData
$Key = $Data.Keys | Where-Object { $_ -match $res.Get.UrlProperty }

# Build the output object
ForEach ($url in ($Data.("$($Data.StableVersions)$($res.Get.UrlProperty)") -split $res.Get.UrlDelimiter)) {
foreach ($url in $Data.$Key) {
$PSObject = [PSCustomObject] @{
Version = $Data.($res.Get.VersionProperty)
URI = $url
Expand Down
14 changes: 0 additions & 14 deletions Evergreen/Apps/Get-ScooterBeyondCompare.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,6 @@
URI = if ($language.key -eq "en") { $Update.download } else { $Update.download -replace "BCompare-", "BCompare-$($language.key)-" }
}
Write-Output -InputObject $PSObject

# Output the version and download URL for the MSI
if ($language.key -eq "en") {
foreach ($Msi in $res.Get.Download.Uri) {
$PSObject = [PSCustomObject] @{
Version = $Version
Language = $res.Get.Update.Languages[$language.key]
Architecture = Get-Architecture -String $Msi
Type = Get-FileType -File $Msi
URI = $Msi -replace "#version", $Version
}
Write-Output -InputObject $PSObject
}
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Evergreen/Apps/Get-mySQLConnectorNET.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function Get-mySQLConnectorNET {
# The version ist major.minor.patch, while the tag can have also have major.minor.patch.build
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceVersionShort, (($Version -split '\.')[0, 1] -join '.') -replace $res.Get.Download.ReplaceVersion, (($Version -split '\.')[0..2] -join '.')

$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]
# The website/CDN checks the user agent, which means that the call from e.g. Azure Automation is only possible by overwriting it
$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -UserAgent "Curl/8" -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]

$PSObject = [PSCustomObject] @{
Version = $Version
Expand Down
3 changes: 2 additions & 1 deletion Evergreen/Apps/Get-mySQLConnectorODBC.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function Get-mySQLConnectorODBC {
# The version ist major.minor.patch, while the tag can have also have major.minor.patch.build
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceVersion, (($Version -split '\.')[0..2] -join '.')

$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]
# The website/CDN checks the user agent, which means that the call from e.g. Azure Automation is only possible by overwriting it
$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -UserAgent "Curl/8" -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]

$PSObject = [PSCustomObject] @{
Version = $Version
Expand Down
3 changes: 2 additions & 1 deletion Evergreen/Apps/Get-mySQLWorkbench.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function Get-mySQLWorkbench {
# The version ist major.minor.patch, while the tag can have also have major.minor.patch.build
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceVersion, (($Version -split '\.')[0..2] -join '.')

$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]
# The website/CDN checks the user agent, which means that the call from e.g. Azure Automation is only possible by overwriting it
$CdnUri = (Invoke-WebRequest $Uri -MaximumRedirection 0 -UserAgent "Curl/8" -SkipHttpErrorCheck -ErrorAction:SilentlyContinue).Headers.Location[0]

$PSObject = [PSCustomObject] @{
Version = $Version
Expand Down
25 changes: 25 additions & 0 deletions Evergreen/Manifests/AWSSMP.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"Name": "AWS Session Manager Plugin",
"Source": "https://github.com/aws/session-manager-plugin",
"Get": {
"Update": {
"Uri": "https://api.github.com/repos/aws/session-manager-plugin/tags",
"ContentType": "application/json; charset=utf-8"
},
"Download": {
"Uri" :"https://s3.amazonaws.com/session-manager-downloads/plugin/#version/windows/SessionManagerPluginSetup.exe",
"ReplaceText": "#version"
}
},
"Install": {
"Setup": "SessionManagerPluginSetup.exe",
"Physical": {
"Arguments": "/quiet /norestart",
"PostInstall": []
},
"Virtual": {
"Arguments": "/quiet /norestart",
"PostInstall": []
}
}
}
25 changes: 25 additions & 0 deletions Evergreen/Manifests/AutoIt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"Name": "AutoIt Scripting Language",
"Source": "https://www.autoitscript.com/site/autoit/",
"Get": {
"Update": {
"Uri": "https://www.autoitscript.com/autoit3/files/beta/update.dat",
"ContentType": "text/plain; charset=utf-8",
"UserAgent": "AutoIt"
},
"Download": {
"Uri": ""
}
},
"Install": {
"Setup": "",
"Physical": {
"Arguments": "",
"PostInstall": []
},
"Virtual": {
"Arguments": "",
"PostInstall": []
}
}
}
2 changes: 1 addition & 1 deletion Evergreen/Manifests/ScooterBeyondCompare.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Source": "https://scootersoftware.com/",
"Get": {
"Update": {
"Uri": "https://www.scootersoftware.com/checkupdates.php?product=bc4&minor=3&maint=2&auth=30.15&build=24472&edition=prodebug&cpuarch=x86_64&platform=win32&lang=silent",
"Uri": "https://www.scootersoftware.com/checkupdates.php?product=bc5&minor=3&maint=2&auth=30.15&build=24472&edition=prodebug&cpuarch=x86_64&platform=win32&lang=silent",
"UserAgent": "BeyondCompare/4.3 (Windows NT 10.0; Win64; x64)",
"XmlNode": "//Update",
"MatchVersion": "(\\d+(\\.\\d+)(\\.\\d+))",
Expand Down
Loading