Can I install Chocolatey on a drive other than C drive?

I love using MacPorts and Chocolatey is a great alternative app.

But when I use Windows, I only install the OS to drive C, so if I have problems with Windows system, I just format my drive C. So, all my files are stored on drive D or E.

I installed Chocolatey, but the default drive is C.

C:\ProgramData\chocolatey

      

Also, the default location for installing applications is drive C. For example, ruby ​​is installed at this location:

// Get Ruby from the repository
choco install ruby

// Then it installed in this location:
C:\tools\ruby213\bin;

      

Can I set the default location for the D drive?

+3


source to share


2 answers


Alternative installation location

With Chocolatey, maybe you just need to install ChocolateyInstall Environmnent Variable :

  • Create a machine-level working level (custom level will work as well) named ChocolateyInstall and install it in the folder where you want to install chocolate before installation (this environment variable must be set globally or available to PowerShell - it's not enough just to make it available for the current command line session).
  • Create the folder manually.

If you've already installed (and want to change the location after the fact):

  • Follow the steps above.
  • Reinsert the chocolate.
  • Copy / Move items from the old lib / bin directory.
  • Remove the old installation directory.

Application location



With apps, it gets a little tougher. Many applications point directly to C:\Program Files

. If you've moved this then they should respect the new location.

With things like ruby, it uses Get-BinRoot

when you can just add ChocolateyBinRoot

as an environment variable and it will point that out.

Create environment variables

You can use the following steps to create an environment variable:

  • Click the Start button
  • Right click on "Computer" and select "Properties" (or press the Windows key + Pause / Break)
  • A window will appear System

    , click the link 'Advanced System Settings'
  • A window will appear System Properties

    , click the buttonEnvironment Variables

  • In it create either user / machine level environment variable for ChocolateyInstall and Value

    set the path you want to use
+4


source


I changed ProgramFilesDir

in regedit here:Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion



After that, Chocolate installs to the new folder that I installed.

0


source







All Articles