Tuesday, March 24, 2015

My first experience with Choco by chocolatey.org

I was hoping to find a good package manager similar to Homebrew for Windows and recently discovered chocolatey.org. Yesterday I followed the instructions on the homepage to install the choco tool (version 0.9.8) in PowerShell (actually the one provided by the GitHub app). Then I started installing the Android Studio using the following command: choco install androidstudio (it told me I should use the -y option for auto-confirm and it will be required in the futureshould have been included in the chocolatey.org examples).

It installed the Android SDK and Java 7.1 SDK dependencies but then I stopped the download of Android Studio. I verified that both the Android SDK and Java SDK were installed ok. When I tried choco install androidstudio again (forgot the -y option), choco complained that it needed elevated (Windows Administrator) mode and that Android Studio was already installed (with a hint that I can use the -force option).

I searched for some hints how to run PowerShell in elevated mode. Unfortunately, a lot of hints do not apply to Windows 8 since they depend on the old file (Windows 7) explorer and start menu. I found the hint for Windows 7/8+ here on serverfault.comStart-Process PowerShell -Verb RunAs

My third attempt to install Android Studio: choco install androidstudio -y -force finally worked.

In conclusion, I am very happy with this tool. Here are some issues I would like to see fixed soon:
  • chocolatey/choco#198 (issue with aborted install)
  • chocolatey.org homepage points to the wrong repo, should point to chocolatey / choco instead
  • make it more explicit on the homepage and for each package that choco install has to be run from an elevated shell, and add a hint how to open an elevated shell on Windows 8 - see this answer on serverfault.comStart-Process PowerShell -Verb RunAs
  • add -y option to the examples given on the homepage and given per package
Some quick links:

FIRST UPDATE: here are some more impressions:
  • I discovered that if you use choco to install node (choco install nodejs.install -y), the node tools such as node and npm are accessible from my PowerShell prompt
  • However, when I used choco to install notepad++, it does not put notepad++ in my path.
  • Also, choco install git -y does not put git in the command path, as needed by the Cordova CLI tool and Cordova plugman tool.
  • choco install ant -y also does not put ant in the command path.