免互動安裝DNClient Server、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id DefinedNet.DNClient.Server -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id DefinedNet.DNClient.Server -e --silentwinget uninstall --id DefinedNet.DNClient.Server -e --silent依安裝檔
64位元 · MSI · 所有使用者 · en-US
靜默安裝
msiexec /i DNClient-Server.msi /qn /norestart寫入記錄檔
msiexec /i DNClient-Server.msi /qn /norestart /l*v "%TEMP%\dnclient-server-install.log"解除安裝
msiexec /x {F25FB701-AAA5-4DA1-926B-DDB077F08188} /qn /norestart- MSI產品代碼
- {F25FB701-AAA5-4DA1-926B-DDB077F08188}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F25FB701-AAA5-4DA1-926B-DDB077F08188}
- UpgradeCode
- {0247AEAF-6885-44CB-9280-4979671347E6}
- 安裝資料夾
- %ProgramFiles%/Defined Networking/DNClient
ARM64 · MSI · 所有使用者 · en-US
靜默安裝
msiexec /i DNClient-Server.msi /qn /norestart寫入記錄檔
msiexec /i DNClient-Server.msi /qn /norestart /l*v "%TEMP%\dnclient-server-install.log"解除安裝
msiexec /x {47B7C412-F4F3-4DAE-BBF9-0B5C5F62E9B4} /qn /norestart- MSI產品代碼
- {47B7C412-F4F3-4DAE-BBF9-0B5C5F62E9B4}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{47B7C412-F4F3-4DAE-BBF9-0B5C5F62E9B4}
- UpgradeCode
- {0247AEAF-6885-44CB-9280-4979671347E6}
- 安裝資料夾
- %ProgramFiles%/Defined Networking/DNClient
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-dnclient-server.ps1
$url = 'https://dl.defined.net/stable/binaries/dnclient/v0.9.9/windows/amd64/DNClient-Server.msi'
$sha256 = 'C33798536228F5154962B9E116F1FEF389B0C0991E56B0B23DD86162CD8A9035'
$file = Join-Path $env:TEMP 'DNClient-Server.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-dnclient-server.ps1
$url = 'https://dl.defined.net/stable/binaries/dnclient/v0.9.9/windows/arm64/DNClient-Server.msi'
$sha256 = '1413AAB3C7A273F162C0160A2EB9703128E44685DC374DBDA107461E57F292C7'
$file = Join-Path $env:TEMP 'DNClient-Server.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