方針
- Portable 版がある場合は Portable 版を利用する。
- サイレントインストール可能なインストーラがあれば利用する。
- 大物はインストーラで手動インストールする。
- 上記以外は chocolatey を利用する。
- 自動更新可能なものはアプリ側で行う。
作業フロー
- OS インストール
- OS 初期設定
- powershell の Invoke-WebRequest で最低限必要なものをインストール(gitなど)
- github からインストールスクリプトをダウンロードして実行
初期インストールスクリプト
手入力できるように工夫する。
- gist に保存
- gist の URL を URL 短縮サービスに登録
- powershell でダウンロードして実行
こんな感じ
(iwr http://tiny.cc/hogehoge).content
chocolatey
google chrome 等、自動更新機能があるパッケージへの対応
https://stackoverflow.com/questions/44144253/should-i-disable-built-in-auto-update-of-packages-installed-by-chocolatey
https://chocolatey.org/docs/how-to-install-upgrade-package-without-scripts#application-is-self-updating-like-google-chrome
choco pin add -n=googlechrome
パッケージリストの作成
Write-Output "<?xml version=`"1.0`" encoding=`"utf-8`"?>"
Write-Output "<packages>"
choco list -lo -r -y | % { " <package id=`"$($_.SubString(0, $_.IndexOf("|")))`" />" } | Select-String "chocolatey" -NotMatch | % { $_.Line }
Write-Output "</packages>"