diff --git a/ee/maintained-apps/inputs/winget/postgresql-18.json b/ee/maintained-apps/inputs/winget/postgresql-18.json new file mode 100644 index 0000000000..25e3d80f78 --- /dev/null +++ b/ee/maintained-apps/inputs/winget/postgresql-18.json @@ -0,0 +1,12 @@ +{ + "name": "PostgreSQL 18", + "slug": "postgresql-18/windows", + "package_identifier": "PostgreSQL.PostgreSQL.18", + "unique_identifier": "PostgreSQL 18", + "installer_arch": "x64", + "installer_type": "exe", + "installer_scope": "machine", + "default_categories": ["Developer tools"], + "install_script_path": "ee/maintained-apps/inputs/winget/scripts/postgresql-18_install.ps1", + "uninstall_script_path": "ee/maintained-apps/inputs/winget/scripts/postgresql-18_uninstall.ps1" +} diff --git a/ee/maintained-apps/inputs/winget/scripts/postgresql-18_install.ps1 b/ee/maintained-apps/inputs/winget/scripts/postgresql-18_install.ps1 new file mode 100644 index 0000000000..4813894634 --- /dev/null +++ b/ee/maintained-apps/inputs/winget/scripts/postgresql-18_install.ps1 @@ -0,0 +1,25 @@ +$exeFilePath = "${env:INSTALLER_PATH}" + +try { + +# EnterpriseDB (BitRock InstallBuilder) installer. Switches from the winget +# manifest: --mode unattended for a non-interactive install, --unattendedmodeui +# none to suppress all progress UI. Installs per-machine under +# C:\Program Files\PostgreSQL\18 and registers in HKLM Add/Remove Programs. +$processOptions = @{ + FilePath = "$exeFilePath" + ArgumentList = "--mode", "unattended", "--unattendedmodeui", "none" + PassThru = $true + Wait = $true +} + +$process = Start-Process @processOptions +$exitCode = $process.ExitCode + +Write-Host "Install exit code: $exitCode" +Exit $exitCode + +} catch { + Write-Host "Error: $_" + Exit 1 +} diff --git a/ee/maintained-apps/inputs/winget/scripts/postgresql-18_uninstall.ps1 b/ee/maintained-apps/inputs/winget/scripts/postgresql-18_uninstall.ps1 new file mode 100644 index 0000000000..6cef88cf63 --- /dev/null +++ b/ee/maintained-apps/inputs/winget/scripts/postgresql-18_uninstall.ps1 @@ -0,0 +1,72 @@ +$displayNameLike = "PostgreSQL 18*" +$publisher = "PostgreSQL Global Development Group" + +$paths = @( + 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall', + 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall', + 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall', + 'HKCU:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall' +) + +$uninstall = $null +foreach ($p in $paths) { + $items = Get-ItemProperty "$p\*" -ErrorAction SilentlyContinue | Where-Object { + $_.DisplayName -like $displayNameLike -and $_.Publisher -like "$publisher*" + } + if ($items) { $uninstall = $items | Select-Object -First 1; break } +} + +if (-not $uninstall -or (-not $uninstall.UninstallString -and -not $uninstall.QuietUninstallString)) { + Write-Host "Uninstall entry not found" + Exit 0 +} + +$uninstallCommand = if ($uninstall.QuietUninstallString) { + $uninstall.QuietUninstallString +} else { + $uninstall.UninstallString +} + +# Registry uninstall strings come in three shapes; parse defensively. The EDB +# uninstaller (uninstall-postgresql.exe) lives under a path with spaces +# ("C:\Program Files\PostgreSQL\18\...") and is typically quoted. +$exePath = "" +$existingArgs = "" +if ($uninstallCommand -match '^\s*"([^"]+)"\s*(.*)$') { + $exePath = $matches[1] + $existingArgs = $matches[2].Trim() +} elseif ($uninstallCommand -match '(?i)^\s*(.+?\.exe)\s*(.*)$') { + $exePath = $matches[1] + $existingArgs = $matches[2].Trim() +} elseif ($uninstallCommand -match '^\s*(\S+)\s*(.*)$') { + $exePath = $matches[1] + $existingArgs = $matches[2].Trim() +} else { + Throw "Could not parse uninstall string: $uninstallCommand" +} + +# BitRock uninstaller silent switch. +if ($existingArgs -notmatch '(?i)--mode\s+unattended') { + $existingArgs = ("$existingArgs --mode unattended").Trim() +} + +Write-Host "Uninstall command: $exePath" +Write-Host "Uninstall args: $existingArgs" + +try { + $processOptions = @{ + FilePath = $exePath + ArgumentList = $existingArgs + NoNewWindow = $true + PassThru = $true + Wait = $true + } + + $process = Start-Process @processOptions + $exitCode = $process.ExitCode + Write-Host "Uninstall exit code: $exitCode" + Exit $exitCode +} catch { + Write-Host "Error running uninstaller: $_" + Exit 1 +} diff --git a/ee/maintained-apps/outputs/apps.json b/ee/maintained-apps/outputs/apps.json index 6fd0fe196a..2c97f7e6f7 100644 --- a/ee/maintained-apps/outputs/apps.json +++ b/ee/maintained-apps/outputs/apps.json @@ -2129,6 +2129,13 @@ "unique_identifier": "io.podmandesktop.PodmanDesktop", "description": "Open source tool for developers to work with containers and Kubernetes." }, + { + "name": "PostgreSQL 18", + "slug": "postgresql-18/windows", + "platform": "windows", + "unique_identifier": "PostgreSQL 18", + "description": "PostgreSQL is a powerful, open source object-relational database system." + }, { "name": "Postman", "slug": "postman/darwin", diff --git a/ee/maintained-apps/outputs/postgresql-18/windows.json b/ee/maintained-apps/outputs/postgresql-18/windows.json new file mode 100644 index 0000000000..c2d8d8ed37 --- /dev/null +++ b/ee/maintained-apps/outputs/postgresql-18/windows.json @@ -0,0 +1,22 @@ +{ + "versions": [ + { + "version": "18.4-1", + "queries": { + "exists": "SELECT 1 FROM programs WHERE name = 'PostgreSQL 18' AND publisher = 'PostgreSQL Global Development Group';", + "patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM programs WHERE name = 'PostgreSQL 18' AND publisher = 'PostgreSQL Global Development Group' AND version_compare(version, '18.4-1') < 0);" + }, + "installer_url": "https://get.enterprisedb.com/postgresql/postgresql-18.4-1-windows-x64.exe", + "install_script_ref": "bc68ad4d", + "uninstall_script_ref": "24e7779d", + "sha256": "44b8187d2db7e866495952d8260a1d7252cbb5125843142e1f0bf30115d23279", + "default_categories": [ + "Developer tools" + ] + } + ], + "refs": { + "24e7779d": "$displayNameLike = \"PostgreSQL 18*\"\n$publisher = \"PostgreSQL Global Development Group\"\n\n$paths = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall',\n 'HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall',\n 'HKCU:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall'\n)\n\n$uninstall = $null\nforeach ($p in $paths) {\n $items = Get-ItemProperty \"$p\\*\" -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like $displayNameLike -and $_.Publisher -like \"$publisher*\"\n }\n if ($items) { $uninstall = $items | Select-Object -First 1; break }\n}\n\nif (-not $uninstall -or (-not $uninstall.UninstallString -and -not $uninstall.QuietUninstallString)) {\n Write-Host \"Uninstall entry not found\"\n Exit 0\n}\n\n$uninstallCommand = if ($uninstall.QuietUninstallString) {\n $uninstall.QuietUninstallString\n} else {\n $uninstall.UninstallString\n}\n\n# Registry uninstall strings come in three shapes; parse defensively. The EDB\n# uninstaller (uninstall-postgresql.exe) lives under a path with spaces\n# (\"C:\\Program Files\\PostgreSQL\\18\\...\") and is typically quoted.\n$exePath = \"\"\n$existingArgs = \"\"\nif ($uninstallCommand -match '^\\s*\"([^\"]+)\"\\s*(.*)$') {\n $exePath = $matches[1]\n $existingArgs = $matches[2].Trim()\n} elseif ($uninstallCommand -match '(?i)^\\s*(.+?\\.exe)\\s*(.*)$') {\n $exePath = $matches[1]\n $existingArgs = $matches[2].Trim()\n} elseif ($uninstallCommand -match '^\\s*(\\S+)\\s*(.*)$') {\n $exePath = $matches[1]\n $existingArgs = $matches[2].Trim()\n} else {\n Throw \"Could not parse uninstall string: $uninstallCommand\"\n}\n\n# BitRock uninstaller silent switch.\nif ($existingArgs -notmatch '(?i)--mode\\s+unattended') {\n $existingArgs = (\"$existingArgs --mode unattended\").Trim()\n}\n\nWrite-Host \"Uninstall command: $exePath\"\nWrite-Host \"Uninstall args: $existingArgs\"\n\ntry {\n $processOptions = @{\n FilePath = $exePath\n ArgumentList = $existingArgs\n NoNewWindow = $true\n PassThru = $true\n Wait = $true\n }\n\n $process = Start-Process @processOptions\n $exitCode = $process.ExitCode\n Write-Host \"Uninstall exit code: $exitCode\"\n Exit $exitCode\n} catch {\n Write-Host \"Error running uninstaller: $_\"\n Exit 1\n}\n", + "bc68ad4d": "$exeFilePath = \"${env:INSTALLER_PATH}\"\n\ntry {\n\n# EnterpriseDB (BitRock InstallBuilder) installer. Switches from the winget\n# manifest: --mode unattended for a non-interactive install, --unattendedmodeui\n# none to suppress all progress UI. Installs per-machine under\n# C:\\Program Files\\PostgreSQL\\18 and registers in HKLM Add/Remove Programs.\n$processOptions = @{\n FilePath = \"$exeFilePath\"\n ArgumentList = \"--mode\", \"unattended\", \"--unattendedmodeui\", \"none\"\n PassThru = $true\n Wait = $true\n}\n\n$process = Start-Process @processOptions\n$exitCode = $process.ExitCode\n\nWrite-Host \"Install exit code: $exitCode\"\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n" + } +} diff --git a/frontend/pages/SoftwarePage/components/icons/Postgresql18.tsx b/frontend/pages/SoftwarePage/components/icons/Postgresql18.tsx new file mode 100644 index 0000000000..d2b2c94c63 --- /dev/null +++ b/frontend/pages/SoftwarePage/components/icons/Postgresql18.tsx @@ -0,0 +1,14 @@ +import * as React from "react"; + +import type { SVGProps } from "react"; + +const Postgresql18 = (props: SVGProps) => ( + + + +); +export default Postgresql18; diff --git a/frontend/pages/SoftwarePage/components/icons/index.ts b/frontend/pages/SoftwarePage/components/icons/index.ts index b534a13f40..20c0d3a6e7 100644 --- a/frontend/pages/SoftwarePage/components/icons/index.ts +++ b/frontend/pages/SoftwarePage/components/icons/index.ts @@ -61,6 +61,7 @@ import OktaVerify from "./OktaVerify"; import Ollama from "./Ollama"; import OpenvpnConnect from "./OpenvpnConnect"; import PlantronicsHub from "./PlantronicsHub"; +import Postgresql18 from "./Postgresql18"; import PowerAutomate from "./PowerAutomate"; import PowerBi from "./PowerBi"; import Plugdata from "./Plugdata"; @@ -535,6 +536,7 @@ export const SOFTWARE_NAME_TO_ICON_MAP = { "plantronics hub": PlantronicsHub, plugdata: Plugdata, "podman desktop": PodmanDesktop, + "postgresql 18": Postgresql18, postman: Postman, "power automate": PowerAutomate, "power bi": PowerBi, diff --git a/website/assets/images/app-icon-postgresql-18-60x60@2x.png b/website/assets/images/app-icon-postgresql-18-60x60@2x.png new file mode 100644 index 0000000000..39a03f3611 Binary files /dev/null and b/website/assets/images/app-icon-postgresql-18-60x60@2x.png differ