Python 3.6を確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id Python.Python.3.6 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Python.Python.3.6 -e --silentwinget uninstall --id Python.Python.3.6 -e --silentインストーラー別
64ビット · EXE(WiX Burn) · 現在のユーザー
サイレントインストール
python-3.6.8-amd64.exe /quiet /norestartアンインストール
msiexec /x {1AA5398D-0CF8-49E6-ADB0-86365145C01C} /qn /norestart- MSIプロダクトコード
- {1aa5398d-0cf8-49e6-adb0-86365145c01c}
- アンインストール用レジストリキー
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1aa5398d-0cf8-49e6-adb0-86365145c01c}
- UpgradeCode
- {001956A8-8F9F-5604-ACE9-788F9B15DB5C}
- DisplayVersion
- 3.6.8150.0
64ビット · EXE(WiX Burn) · すべてのユーザー
サイレントインストール
python-3.6.8-amd64.exe /quiet /norestartアンインストール
msiexec /x {1AA5398D-0CF8-49E6-ADB0-86365145C01C} /qn /norestart- MSIプロダクトコード
- {1aa5398d-0cf8-49e6-adb0-86365145c01c}
- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1aa5398d-0cf8-49e6-adb0-86365145c01c}
- UpgradeCode
- {001956A8-8F9F-5604-ACE9-788F9B15DB5C}
- DisplayVersion
- 3.6.8150.0
32ビット · EXE(WiX Burn) · 現在のユーザー
サイレントインストール
python-3.6.8.exe /quiet /norestartアンインストール
msiexec /x {D61D9FB7-32FB-437C-91B2-545C8533CFF1} /qn /norestart- MSIプロダクトコード
- {d61d9fb7-32fb-437c-91b2-545c8533cff1}
- アンインストール用レジストリキー
- HKCU\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{d61d9fb7-32fb-437c-91b2-545c8533cff1}
- UpgradeCode
- {96CB5FA2-C2EF-5E31-A06C-A5AB703698BE}
- DisplayVersion
- 3.6.8150.0
32ビット · EXE(WiX Burn) · すべてのユーザー
サイレントインストール
python-3.6.8.exe /quiet /norestartアンインストール
msiexec /x {D61D9FB7-32FB-437C-91B2-545C8533CFF1} /qn /norestart- MSIプロダクトコード
- {d61d9fb7-32fb-437c-91b2-545c8533cff1}
- アンインストール用レジストリキー
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{d61d9fb7-32fb-437c-91b2-545c8533cff1}
- UpgradeCode
- {96CB5FA2-C2EF-5E31-A06C-A5AB703698BE}
- DisplayVersion
- 3.6.8150.0
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-python-3-6.ps1
$url = 'https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe'
$sha256 = '96088A58B7C43BC83B84E6B67F15E8706C614023DD64F9A5A14E81FF824ADADC'
$file = Join-Path $env:TEMP 'python-3.6.8-amd64.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-python-3-6.ps1
$url = 'https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe'
$sha256 = '96088A58B7C43BC83B84E6B67F15E8706C614023DD64F9A5A14E81FF824ADADC'
$file = Join-Path $env:TEMP 'python-3.6.8-amd64.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-python-3-6.ps1
$url = 'https://www.python.org/ftp/python/3.6.8/python-3.6.8.exe'
$sha256 = '89871D432BC06E4630D7B64CB1A8451E53C80E68DE29029976B12AAD7DBFA5A0'
$file = Join-Path $env:TEMP 'python-3.6.8.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-python-3-6.ps1
$url = 'https://www.python.org/ftp/python/3.6.8/python-3.6.8.exe'
$sha256 = '89871D432BC06E4630D7B64CB1A8451E53C80E68DE29029976B12AAD7DBFA5A0'
$file = Join-Path $env:TEMP 'python-3.6.8.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