From 36ab2b97435b6758d4d6c10df94d039e49a59a61 Mon Sep 17 00:00:00 2001 From: Jasper Metselaar Date: Thu, 21 Dec 2023 14:20:35 +0100 Subject: [PATCH] New apps: eduVPN and Clarivate Endnote --- Evergreen/Apps/Get-ClarivateEndnote.ps1 | 61 +++++++++++++++++++++++ Evergreen/Apps/Get-Eduvpn.ps1 | 28 +++++++++++ Evergreen/Manifests/ClarivateEndnote.json | 43 ++++++++++++++++ Evergreen/Manifests/Eduvpn.json | 23 +++++++++ 4 files changed, 155 insertions(+) create mode 100644 Evergreen/Apps/Get-ClarivateEndnote.ps1 create mode 100644 Evergreen/Apps/Get-Eduvpn.ps1 create mode 100644 Evergreen/Manifests/ClarivateEndnote.json create mode 100644 Evergreen/Manifests/Eduvpn.json diff --git a/Evergreen/Apps/Get-ClarivateEndnote.ps1 b/Evergreen/Apps/Get-ClarivateEndnote.ps1 new file mode 100644 index 00000000..7c3b18f0 --- /dev/null +++ b/Evergreen/Apps/Get-ClarivateEndnote.ps1 @@ -0,0 +1,61 @@ +function Get-ClarivateEndNote { + <# + .SYNOPSIS + Get the current version and download URIs for the supported releases of Endnote. + + .NOTES + Author: Jasper Metselaar + E-mail: jms@du.se + #> + [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]) + ) + + foreach ($Release in $res.Get.Update.Releases) { + Write-Verbose -Message "$($MyInvocation.MyCommand): Release: $Release" + Write-Verbose -Message "$($MyInvocation.MyCommand): Endnote Update URL: $($res.Get.Update.Uri.$Release)" + Write-Verbose -Message "$($MyInvocation.MyCommand): Download URL: $($res.Get.Download.Uri.$Release)" + + # Query the EndNote update API + $UpdateFeed = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri.($Release) + if ($null -ne $UpdateFeed) { + + # Sort the updates to find the latest + $Update = $UpdateFeed.updates.build | ` + Sort-Object -Property @{ Expression = { [System.Version]$_.version }; Descending = $true } -ErrorAction "SilentlyContinue" | ` + Select-Object -First 1 + + # Construct the output for the .exe installer; Return the custom object to the pipeline + $PSObject = [PSCustomObject] @{ + Version = $Update.UpdateTo + Release = $Release + Type = Get-FileType -File $res.Get.Download.Uri.Exe.($Release) + URI = $res.Get.Download.Uri.Exe.($Release) + } + Write-Output -InputObject $PSObject + + # Construct the output for the .msi installer; Return the custom object to the pipeline + $PSObject = [PSCustomObject] @{ + Version = $Update.UpdateTo + Release = $Release + Type = Get-FileType -File $res.Get.Download.Uri.Msi.($Release) + URI = $res.Get.Download.Uri.Msi.($Release) + } + Write-Output -InputObject $PSObject + + # Construct the output for the MSP patch; Return the custom object to the pipeline + $PSObject = [PSCustomObject] @{ + Version = $Update.updateTo + Release = $Release + Type = Get-FileType -File $Update.url + URI = $Update.url + } + Write-Output -InputObject $PSObject + } + } +} \ No newline at end of file diff --git a/Evergreen/Apps/Get-Eduvpn.ps1 b/Evergreen/Apps/Get-Eduvpn.ps1 new file mode 100644 index 00000000..b2c58daa --- /dev/null +++ b/Evergreen/Apps/Get-Eduvpn.ps1 @@ -0,0 +1,28 @@ +Function Get-eduVPN { + <# + .SYNOPSIS + Returns the latest EduVPN version number and download. + + .NOTES + Author: Jasper Metselaar + E-mail: jms@du.se + #> + [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]) + ) + + # Pass the repo releases API URL and return a formatted object + $params = @{ + Uri = $res.Get.Uri + MatchVersion = $res.Get.MatchVersion + Filter = $res.Get.MatchFileTypes + } + $object = Get-GitHubRepoRelease @params + + Write-Output -InputObject $object +} diff --git a/Evergreen/Manifests/ClarivateEndnote.json b/Evergreen/Manifests/ClarivateEndnote.json new file mode 100644 index 00000000..ca4decae --- /dev/null +++ b/Evergreen/Manifests/ClarivateEndnote.json @@ -0,0 +1,43 @@ +{ + "Name": "Clarivate EndNote", + "Source": "https://www.endnote.com/", + "Get": { + "Update": { + "Releases": [ + "X9", + "20", + "21" + ], + "Uri": { + "X9": "http://download.endnote.com/updates/19.0/EN19WinUpdates.xml", + "20": "https://download.endnote.com/updates/20.0/EN20WinUpdates.xml", + "21": "https://download.endnote.com/updates/21.0/EN21WinUpdates.xml" + } + }, + "Download": { + "Uri": { + "Exe": { + "X9": "https://download.endnote.com/downloads/X9/ENX9Inst.exe", + "20": "https://download.endnote.com/downloads/20/EN20Inst.exe", + "21": "https://download.endnote.com/downloads/21/EN21Inst.exe" + }, + "Msi": { + "X9": "https://download.endnote.com/downloads/X9/ENX9Inst.msi", + "20": "https://download.endnote.com/downloads/20/EN20Inst.msi", + "21": "https://download.endnote.com/downloads/21/EN21Inst.msi" + } + } + } + }, + "Install": { + "Setup": "", + "Physical": { + "Arguments": "", + "PostInstall": [] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [] + } + } +} \ No newline at end of file diff --git a/Evergreen/Manifests/Eduvpn.json b/Evergreen/Manifests/Eduvpn.json new file mode 100644 index 00000000..9a47bdf4 --- /dev/null +++ b/Evergreen/Manifests/Eduvpn.json @@ -0,0 +1,23 @@ +{ + "Name": "eduVPN", + "Source": "https://app.eduvpn.org/", + "Get": { + "Uri": "https://api.github.com/repos/Amebis/eduVPN/releases/latest", + "MatchVersion": "(\\d+(\\.\\d+){1,4}).*", + "MatchFileTypes": "eduVPNClient_.*(exe|msi)$" + }, + "Install": { + "Setup": "eduVPNClient_*.exe", + "Preinstall": "", + "Physical": { + "Arguments": "/install /quiet /norestart", + "PostInstall": [ + ] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [ + ] + } + } +} \ No newline at end of file