Using Chocolatey
Command Example
Now that you have Chocolatey on your machine (need to install?), you can run several commands.
Take a look at the command reference. We are going to be using the install command.
Let's install Notepad++.
- Open a command line.
- Type
choco install notepadplusplus
and press Enter. - If you have UAC turned on or are not an administrator, Chocolatey is going to request administrative permission at some point (at least once during the process). Otherwise it will not be able to finish what it is doing successfully. If you don't have UAC turned on, it will just continue on without stopping to bother you.
- Thats it. Pretty simple but powerful little concept!
Overriding Default Install Directory or Other Advanced Install Concepts
- We support these concepts through the use of install arguments - see Install Arguments
- If you wanted to pass a native argument to the installer, like the install directory, you would need to know the silent argument passed to that particular installer and then you would specify it on the command line or in the packages.config.
- If it was an MSI, then usually you could pass
-ia "INSTALLDIR=""D:\Program Files"""
(for cmd.exe, it's different for PowerShell). See how to pass options/switches for specifics on passing quoted values through. - For example, Notepad++ uses the NSIS (NullSoft Scriptable Install System) installer. If we look at the silent options, we see that /D is how we influence the install directory. So we would pass
choco install notepadplusplus.install -ia "'/D=E:\SomeDirectory\somebody\npp'"
-note that we are looking at the specific package over the virtual (although you can do the same with notepadplusplus as well).
Is there a better way? Absolutely, see ubiquitous install directory switch!