用于免交互安装Code::Blocks、卸载以及在部署工具中检测安装状态的命令。只列出确定可用的命令:来自清单文件,或来自安装程序技术的官方默认参数。
相关教程: 静默安装参数大全:MSI、NSIS、Inno Setup · 用注册表或PowerShell卸载程序
使用winget
PowerShell
winget install --id CodeBlocks.CodeBlocks -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id CodeBlocks.CodeBlocks -e --silentwinget uninstall --id CodeBlocks.CodeBlocks -e --silent按安装包
64位 · EXE(NSIS) · 仅当前用户 · en-US
静默安装
download /S自定义安装目录
download /S /D=C:\Apps\code-blocks- 卸载注册表项
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\CodeBlocks
- 安装目录
- %ProgramFiles%\CodeBlocks
64位 · EXE(NSIS) · 所有用户 · en-US
静默安装
download /S自定义安装目录
download /S /D=C:\Apps\code-blocks- 卸载注册表项
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\CodeBlocks
- 安装目录
- %ProgramFiles%\CodeBlocks
64位 · ZIP
无需安装(绿色版)
32位 · EXE(NSIS) · 仅当前用户 · en-US
静默安装
download /S自定义安装目录
download /S /D=C:\Apps\code-blocks- 卸载注册表项
- HKCU\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\CodeBlocks
- 安装目录
- %ProgramFiles(x86)%\CodeBlocks
32位 · EXE(NSIS) · 所有用户 · en-US
静默安装
download /S自定义安装目录
download /S /D=C:\Apps\code-blocks- 卸载注册表项
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\CodeBlocks
- 安装目录
- %ProgramFiles(x86)%\CodeBlocks
32位 · ZIP
无需安装(绿色版)
PowerShell:下载、校验、安装
下载官方文件,校验SHA256后静默安装。
install-code-blocks.ps1
$url = 'https://sourceforge.net/projects/codeblocks/files/Binaries/25.03/Windows/codeblocks-25.03-setup-nonadmin.exe/download'
$sha256 = '1B730F9C279F1BABFDEF92507078913DF18CFF9BBABC14DC69C2ABE6628A94ED'
$file = Join-Path $env:TEMP 'download'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/S' -Wait install-code-blocks.ps1
$url = 'https://sourceforge.net/projects/codeblocks/files/Binaries/25.03/Windows/codeblocks-25.03-setup.exe/download'
$sha256 = '88BCA802DF27FD9A9BAE77453CF3BCA36A7B69CBB3863E62D70A42F204F28DF2'
$file = Join-Path $env:TEMP 'download'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/S' -Wait install-code-blocks.ps1
$url = 'https://sourceforge.net/projects/codeblocks/files/Binaries/25.03/Windows/32bit/codeblocks-25.03-32bit-setup-nonadmin.exe/download'
$sha256 = 'A38EA26D993DEE185D279953151AC9CA976BEFF14AF8B98679647A5BDF1D3C3A'
$file = Join-Path $env:TEMP 'download'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/S' -Wait install-code-blocks.ps1
$url = 'https://sourceforge.net/projects/codeblocks/files/Binaries/25.03/Windows/32bit/codeblocks-25.03-32bit-setup.exe/download'
$sha256 = '7CBC9E0F57502B8685EBEE1332D512FC2E48422857A94663562D2379554AEC28'
$file = Join-Path $env:TEMP 'download'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/S' -Wait