* インストール先の変更 [#o4e4a3d9]

** chocoコマンドのオプション [#zad5f782]

- -iaオプションでインストーラーにパラメータを渡す。
- -oオプションでインストーラーが(サイレントインストールではなく、実際にインストーラーダイアログが表示されて)起動する。

*** 参考 [#wc4e5199]
https://github.com/chocolatey/choco/wiki/CommandsInstall#options-and-switches

** インストール時のパラメータの確認 [#pd6a9e53]

- パッケージの詳細ページを開き、(例えば、 https://chocolatey.org/packages/python2 )
- Files項のtools\chocolateyInstall.ps1を開く。
- 以下のようにTARGETDIRの指定等が確認出来る。これをchocoコマンドのオプションで上書き指定する。

 $packageName = 'python2'
 $url = 'https://www.python.org/ftp/python/2.7.11/python-2.7.11.msi'
 $url64 = 'https://www.python.org/ftp/python/2.7.11/python-2.7.11.amd64.msi'
 $version = '2.7.11'
 $fileType = 'msi'
 $partialInstallArgs = '/qn /norestart ALLUSERS=1 TARGETDIR='

** インストーラー種別指定 [#i66e5d68]

*** MSI形式 [#b0007869]
 choco install foo -ia 'INSTALLDIR=C:\bar'
 choco install foo -ia 'TARGETDIR=C:\bar'
 
- http://stackoverflow.com/questions/8839978/install-msi-with-msiexec-in-a-specific-directory

*** Inno Setup形式 [#l0c90232]
 choco install foo -ia '/DIR=C:\bar'

- http://www.jrsoftware.org/ishelp/
- Other information - Setup Command Line Parameters

** 例 [#ca3825aa]

*** Git for Windows [#if9e5b3e]
 CMD> choco install git.install -ia '/DIR=C:\Git'

PowerShellからだと何故か動作しない?

*** Python 2 [#m79fe09f]
 choco install python2 -y -o -ia "'/qn /norestart ALLUSERS=1 TARGETDIR=C:\Python2'"

** 参考 [#g618d19a]
- https://github.com/chocolatey/chocolatey/wiki/GettingStarted#overriding-default-install-directory-or-other-advanced-install-concepts


トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS