chocolatey-archive / chocolatey

[DEPRECATED - https://github.com/chocolatey/choco] Chocolatey NuGet - Like apt-get, but for windows.
https://chocolatey.org
Apache License 2.0
2.81k stars 344 forks source link

chocolatey.org/install.ps1 should check if chocolatey is already installed, and run "choco update" if so #684

Closed Ferk closed 9 years ago

Ferk commented 9 years ago

A convenient way to use chocolatey is to make a 2 lines bat file where the first line just installs chocolatey (with the handy oneliner in your homepage), and the second line simply runs "choco install ", like so:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install qbittorrent 7zip notepadplusplus windirstat sysinternals

Then this would be a lightweight portable installer and updater for all those packages. Which is simple for people to understand, redistribute and use.

However, because the first line always downloads and install chocolatey this could cause problems (and also unnecessary bandwidth consumption). Bat files are a pain for handling conditional evaluation and check whether choco exists, and it wouldn't be straightforward anymore for the average user to complicate the script or to use powershell or any other different language.

So it would be nice if the install.ps1 that installs chocolatey for the first time was able to check first if chocolatey was already installed and working. And if so, simply call a proper "choco update".

ferventcoder commented 9 years ago

Please file this against https://github.com/chocolatey/chocolatey.org.