免互動安裝P4 Apps、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Perforce.P4V -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Perforce.P4V -e --silentwinget uninstall --id Perforce.P4V -e --silent依安裝檔
64位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
p4vinst64.exe /quiet /norestart解除安裝
msiexec /x {E4720099-B569-44B5-8BD6-BD6F4D66033E} /qn /norestart- MSI產品代碼
- {e4720099-b569-44b5-8bd6-bd6f4d66033e}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{e4720099-b569-44b5-8bd6-bd6f4d66033e}
- UpgradeCode
- {AE554B2A-CA7C-4DA4-8A4E-BC6085DFACE4}
64位元 · MSI · 所有使用者
靜默安裝
msiexec /i p4vinst64.msi /qn /norestart寫入記錄檔
msiexec /i p4vinst64.msi /qn /norestart /l*v "%TEMP%\p4-apps-install.log"解除安裝
msiexec /x {858CC3A4-611E-4887-871D-1C2DDDE12273} /qn /norestart- MSI產品代碼
- {858CC3A4-611E-4887-871D-1C2DDDE12273}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{858CC3A4-611E-4887-871D-1C2DDDE12273}
- UpgradeCode
- {70A9FDC7-885B-4D6D-BAFD-CB2D27AB2963}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-p4-apps.ps1
$url = 'https://filehost.perforce.com/perforce/r26.3/bin.ntx64/p4vinst64.exe'
$sha256 = '7EC701333A20BD91F1F94C8C22A46E6960126620099655A3C285C0B67588312B'
$file = Join-Path $env:TEMP 'p4vinst64.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-p4-apps.ps1
$url = 'https://filehost.perforce.com/perforce/r26.3/bin.ntx64/p4vinst64.msi'
$sha256 = '282D57DD9DD0A07F76F128D89298F79B8118F2058BCA73AF3EB94653902F3A39'
$file = Join-Path $env:TEMP 'p4vinst64.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