How do I set Chocolatey to install applications onto another drive?

前端 未结 8 845
半阙折子戏
半阙折子戏 2021-01-30 16:19

I\'ve installed Chocolatey, but I would like it to install programs to another drive instead of C. C is only a small SSD, but I have other drives where I usually install program

8条回答
  •  醉酒成梦
    2021-01-30 16:44

    The accepted answer hints at this option already, so I'm only posting for the sake of completeness:

    Change the default Program Files directory with regedit

    While SSDs have gotten bigger and cheaper in recent years, there are still some niche use cases where you want to keep a Windows install on a separate, smaller partition and software on a different, bigger partition.

    1. Press win + R and type regedit
    2. Locate this key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
    3. Change ProgramFilesDir and ProgramFilesDir (x64) from C:\ProgramFiles to [your drive]:\Program Files

    Citing my sources: this answer but longer.

    Important notes

    Chocolatey will, in general, respect this — but there's a few caveats with that method that need to be mentioned:

    • Some programs/installers don't respect ProgramFilesDir registry keys. For example, Audacity still installed to C: (despite — in my case, at least — ProgramFilesDir is F:\Program Files, but chocolatey made an assumption that it's installed to F: when making the shortcuts and start menu entries).
    • This breaks NVIDIA GeForce Experience. There may also be other side effects, but I haven't found them yet.
    • You need to change ProgramFilesDir registry keys before installing anything with chocolatey, otherwise some scripts, packages, or programs might be broken (for example, I had to reinstall the chocolateygui package)

    Side note: this answer operates under assumption that "how do I set chocolatey to install applications onto another drive" means "how do I set chocolatey to install application to the same drive where I've installed most of my other software."

提交回复
热议问题