これは何?
Cygwinを更新する場合、ダウンロードしたsetup-x86_64.exe
を起動すればいいんだけど、たまに「setup-x86_64.exe
が古い」とメッセージがでるので、setup-x86_64.exe
を含めて更新させるバッチファイル&スクリプト。
必須パッケージ
Cygwin の curl
バッチファイル
やっていることは次の3つ。
- ダウンロード先のパスの決定(「ダウンロード」フォルダ内)
- 下記ダウンロードスクリプトの起動
- ダウンロードした
setup-x86_64.exe
の起動
update_cygwin.bat
set cygwin_path=%SystemDrive%\cygwin64
set setup_path=%USERPROFILE%\Downloads\Cygwin.setup-x86_64.exe
%cygwin_path%\bin\bash.exe --login %cygwin_path%\home\%USERNAME%\bin\update_cygwin.sh %setup_path%
%setup_path%
スクリプト
上記バッチファイルで指定されたファイル名でsetup-x86_64.exe
をダウンロードするスクリプト。
update_cygwin.sh
#!/bin/sh
setup_path=`cygpath -u "$1"`
curl https://cygwin.com/setup-x86_64.exe -o $setup_path
chmod +x $setup_path