7

I would like to install Chocolatey on a separate partition. Is this possible, or do I have to take the default C:\?
I currently have E:\ partition where I install all my software. I would like all my cinst packages to go there.
Is this just a function of changing the PATH variable, after installing Chocolatey, or do I have to do something more substantial?

1 Answer 1

7

You can install Chocolatey exactly where you would like, and to make that easier, there's even some information written up on the wiki for Chocolatey about that!

  1. Create a user environment variable named ChocolateyInstall and set it to the folder you want chocolatey to install to prior to installation.

  2. Create the folder manually.

  3. Install Chocolatey.

The simple and "automated" way

If you'd like to keep it simple, simply open upen an administrative session of PowerShell (if you need so), and run the following snippet. It'll do the steps above.

Set-Variable -Name "ChocolateyInstall" -Value (Read-Host -Prompt "Install location")
New-Item $ChocolateyInstall -Type Directory -Force
[Environment]::SetEnvironmentVariable("ChocolateyInstall", $ChocolateyInstall, "User")
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

Always be careful, and read snippets of code before executing it.

3
  • Ah. Thank you. I read and misunderstood that to mean the variable had to be in 'system partition'. Apologies. Dec 26, 2013 at 21:21
  • @runtime_error Stuff happens! I added a complete/simple way to do it.
    – Thor
    Dec 26, 2013 at 21:24
  • 1
    Seems the chocolatey docs not really helpfull. Chocolatey install guide should be arranged like this answer. Feb 15, 2020 at 8:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.