2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Cygwinを楽に更新する方法(setup.exeを含む)

Posted at

これは何?

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
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?