免互動安裝psqlodbc、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id PostgreSQL.psqlODBC -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id PostgreSQL.psqlODBC -e --silentwinget uninstall --id PostgreSQL.psqlODBC -e --silent依安裝檔
64位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
psqlodbc-setup.exe /quiet /norestart解除安裝
msiexec /x {0B75C5A6-6206-41CB-959B-B28DF3973761} /qn /norestart- MSI產品代碼
- {0b75c5a6-6206-41cb-959b-b28df3973761}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0b75c5a6-6206-41cb-959b-b28df3973761}
64位元 · MSI · 所有使用者
靜默安裝
msiexec /i psqlodbc_x64.msi /qn /norestart寫入記錄檔
msiexec /i psqlodbc_x64.msi /qn /norestart /l*v "%TEMP%\psqlodbc-install.log"解除安裝
msiexec /x {6DA86BD0-4D3B-446C-8D93-B4F6048A3626} /qn /norestart- MSI產品代碼
- {6DA86BD0-4D3B-446C-8D93-B4F6048A3626}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6DA86BD0-4D3B-446C-8D93-B4F6048A3626}
32位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
psqlodbc-setup.exe /quiet /norestart解除安裝
msiexec /x {0B75C5A6-6206-41CB-959B-B28DF3973761} /qn /norestart- MSI產品代碼
- {0b75c5a6-6206-41cb-959b-b28df3973761}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{0b75c5a6-6206-41cb-959b-b28df3973761}
32位元 · MSI · 所有使用者
靜默安裝
msiexec /i psqlodbc_x86.msi /qn /norestart寫入記錄檔
msiexec /i psqlodbc_x86.msi /qn /norestart /l*v "%TEMP%\psqlodbc-install.log"解除安裝
msiexec /x {636505EB-0D71-4B8A-82AE-D0AAEBA0DCE3} /qn /norestart- MSI產品代碼
- {636505EB-0D71-4B8A-82AE-D0AAEBA0DCE3}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{636505EB-0D71-4B8A-82AE-D0AAEBA0DCE3}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-psqlodbc.ps1
$url = 'https://github.com/postgresql-interfaces/psqlodbc/releases/download/REL-18_00_0005/psqlodbc-setup.exe'
$sha256 = 'F79DA87394AD6337C676DBEC444597BF679216100BBE2A497676FB6D8C8AA7D5'
$file = Join-Path $env:TEMP 'psqlodbc-setup.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/quiet /norestart' -Wait install-psqlodbc.ps1
$url = 'https://github.com/postgresql-interfaces/psqlodbc/releases/download/REL-18_00_0005/psqlodbc_x64.msi'
$sha256 = '56345B91E41302271A7ECFC4F4819F49B0FE9FC061BD2B0D72338D81D30597A9'
$file = Join-Path $env:TEMP 'psqlodbc_x64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait install-psqlodbc.ps1
$url = 'https://github.com/postgresql-interfaces/psqlodbc/releases/download/REL-18_00_0005/psqlodbc-setup.exe'
$sha256 = 'F79DA87394AD6337C676DBEC444597BF679216100BBE2A497676FB6D8C8AA7D5'
$file = Join-Path $env:TEMP 'psqlodbc-setup.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/quiet /norestart' -Wait install-psqlodbc.ps1
$url = 'https://github.com/postgresql-interfaces/psqlodbc/releases/download/REL-18_00_0005/psqlodbc_x86.msi'
$sha256 = '54564528317FD03C4176B837B9E21A38DB7B0B3FDD5300AA1440BD6E6C50B79A'
$file = Join-Path $env:TEMP 'psqlodbc_x86.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait