免互動安裝NetLogo、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id CCL.NetLogo -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id CCL.NetLogo -e --silentwinget uninstall --id CCL.NetLogo -e --silent依安裝檔
64位元 · MSI · 所有使用者
靜默安裝
msiexec /i NetLogo-7.0.4-64.msi /qn /norestart寫入記錄檔
msiexec /i NetLogo-7.0.4-64.msi /qn /norestart /l*v "%TEMP%\netlogo-install.log"解除安裝
msiexec /x {C039ED35-EBB0-4014-BDC7-4A46FD9B0536} /qn /norestart- MSI產品代碼
- {C039ED35-EBB0-4014-BDC7-4A46FD9B0536}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C039ED35-EBB0-4014-BDC7-4A46FD9B0536}
- UpgradeCode
- {98295B62-5089-47AC-898D-CB1A688E5E9B}
32位元 · MSI · 所有使用者
靜默安裝
msiexec /i NetLogo-7.0.4-32.msi /qn /norestart寫入記錄檔
msiexec /i NetLogo-7.0.4-32.msi /qn /norestart /l*v "%TEMP%\netlogo-install.log"解除安裝
msiexec /x {A83943C2-1F04-4117-A584-6D4DC689D9EC} /qn /norestart- MSI產品代碼
- {A83943C2-1F04-4117-A584-6D4DC689D9EC}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{A83943C2-1F04-4117-A584-6D4DC689D9EC}
- UpgradeCode
- {A74769F8-5FEC-412E-9E80-5D0F0559F888}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-netlogo.ps1
$url = 'https://downloads.netlogo.org/7.0.4/NetLogo-7.0.4-64.msi'
$sha256 = 'DBCB80A66946E4C27D9F0FE69F83EEAFC62F2B6A89CA64BFB6D684AC3959C0E3'
$file = Join-Path $env:TEMP 'NetLogo-7.0.4-64.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-netlogo.ps1
$url = 'https://downloads.netlogo.org/7.0.4/NetLogo-7.0.4-32.msi'
$sha256 = 'ECCD2FF33481D22984945ED33BCDB805CD927911803E8BEB24C835415361DC84'
$file = Join-Path $env:TEMP 'NetLogo-7.0.4-32.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