LoginSignup
9

More than 5 years have passed since last update.

RubyInstallerをサイレントインストールせよ

Posted at

せっかくRubyを使うんだったらインストールも自動化しましょう。

RubyInstaller編

コマンド

rubyinstaller.exe /dir="path\to\ruby" /verysilent /tasks=modpath /lang=ja

解説

RubyInstallerはインストーラーにInno Setupを利用しています。

オプション 説明
/dir=path インストール先。指定なしならc:\ruby200 (2.0の場合)
/verysilent サイレントインストール。/silentとの違いはプログレスバーの有無
/tasks=modpath 環境変数PathにRubyを追加する。Pathは自力で追加してもよい
/lang=ja 日本語化する。なくてもよい

その他細かいオプションはRubyInstallerのFAQやInnoのドキュメントを参照してください。

Chef

前提

windows cookbookを入れておくこと

recipeのサンプル

windows_package "ruby" do
  source 'http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-xxx.exe'
  installer_type :inno
  action :install
  options '/dir=path\to\ruby /tasks=modpath'
end

windows_packageリソースは公式を見れば簡単に使えます。

DevKit編

コマンド

DevKit-xxx.exe -y -o"path\to\devkit"

解説

DevKitはインストーラーに7-Zipの自己展開形式を利用しています。
-oはディレクトリ、
-yはプロンプトに全部Yes
です。

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
9