简体   繁体   English

如何将 Android Studio 完全安装到非默认 (D:) 驱动器

[英]How to FULLY install Android Studio to a non-default (D:) drive

I'm going to start with the high-level "common sense" question and then get into the tech details:我将从高级“常识”问题开始,然后进入技术细节:

The high-level question: When running the Android Studio installation program in Windows 10, and I tell it to install to D: drive (instead of the default C: drive), why does it insist on installing some components onto the C: drive?高阶问题:在Windows 10中运行Android Studio安装程序时,我告诉它安装到D:盘(而不是默认的C:盘),为什么它一定要安装一些组件到C:盘?

Reasons for installing to a non-default drive:安装到非默认驱动器的原因:


  1. Brand new high-performance gaming laptops, such as my ASUS Republic Of Gamers, come pre-installed with Windows 10 and two drives: A C: drive labeled "OS" and a D: drive labeled "DATA".全新的高性能游戏笔记本电脑,例如我的华硕玩家共和国,预装了 Windows 10 和两个驱动器:一个 C:标有“OS”的驱动器和一个标有“DATA”的 D:驱动器。 The C: drive has just enough room for Windows 10 plus some buffer for future "OS" upgrades. C:驱动器有足够的空间容纳 Windows 10 加上一些用于未来“操作系统”升级的缓冲区。 The D: drive is orders of magnitude larger. D:驱动器大几个数量级。

The obvious intent was for all third-party (non-OS) programs to live on D: drive, or at least not on C: "OS" drive.明显的意图是让所有第三方(非操作系统)程序都存在于 D: 驱动器上,或者至少不存在于 C:“OS”驱动器上。 (I will ignore the "separation of 'code' and 'data' design paradigm, which would rightfully require a third P: 'PROGRAM' drive, and I'll just focus on the lack-of-space problem.) (我将忽略“'代码'和'数据'设计范例的分离,这理所当然地需要第三个 P:'PROGRAM' 驱动器,我将只关注空间不足的问题。)

  1. Reading over the other stackoverflow questions by searching for "android install d drive" yield several hits, which talk around this higher-level concept, but are about more detailed issues, such as where to put the jdk and/or the sdk, missing gradle libraries, tinkering with environment variables and such, but the central theme in them appears (to me at least) to be about putting the IDE on the d: drive (fully or partially), and the consequent errors encountered while attempting that.通过搜索“android install d drive”阅读其他 stackoverflow 问题会产生几个结果,这些问题讨论了这个更高层次的概念,但涉及更详细的问题,例如将 jdk 和/或 sdk 放在哪里,缺少 gradle库,修补环境变量等,但它们的中心主题似乎(至少对我而言)是关于将 IDE 放在 d: 驱动器上(全部或部分),以及在尝试时遇到的随之而来的错误。

The bottom line is that apparently I'm not the only one with limited space on C: drive who had to struggle with the IDE install.最重要的是,显然我不是唯一一个在 C 上空间有限的人:必须与 IDE 安装斗争的驱动器。

After 5 install/uninstall attempts, each time changing all "c:" text box prompts to "d:" and learning more and more about the various libraries and folders that STILL went to c: drive, I've finally found all the big ones, and set symbolic links for them, and moved their contents over to d: drive targets.经过 5 次安装/卸载尝试,每次都将所有“c:”文本框提示更改为“d:”,并且越来越多地了解仍然转到 c: 驱动器的各种库和文件夹,我终于找到了所有大的的,并为它们设置符号链接,并将它们的内容移动到 d: 驱动器目标。

There are still a few "minor"(?) files and directories on c: drive that I'm not really sure belong to Android Studio, but I'm too chicken/lazy to set up the symbolic links for them...but here's my high-level question for the Android Studio developers: c 上还有一些“次要”(?)文件和目录:我不太确定属于 Android Studio 的驱动器,但我太胆小/太懒了,无法为它们设置符号链接......但是这是我对 Android Studio 开发人员的高级问题:

WHY SHOULD I HAVE TO?为什么我必须这样做? WHY CAN'T THIS BE MADE SIMPLE AND INTUITIVE?为什么这不能变得简单和直观? If I tell the install program to put EVERYTHING on the d: drive (IDE, sdk, jdk, gradle, emulator, and so on) why can't the install program just do that?如果我告诉安装程序将所有东西都放在 d: 驱动器上(IDE、sdk、jdk、gradle、模拟器等)为什么安装程序不能这样做?

Am I missing something simple here?我在这里错过了一些简单的东西吗? If I am missing something simple or obvious, then why does it (and my first app) build and run just fine if I set all these symbolic links to d: drive targets?如果我遗漏了一些简单或明显的东西,那么如果我将所有这些符号链接设置为 d: 驱动器目标,为什么它(和我的第一个应用程序)可以正常构建和运行?

在此处输入图像描述

Change the default installation location of the programs to D or other required drive by using the following method:使用以下方法将程序的默认安装位置更改为 D 或其他所需驱动器:

  1. Press Win+R按 Win+R
  2. Type in regedit输入注册表
  3. Head to the following location: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion前往以下位置:Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
  4. You will find two files: ProgramFilesDir and ProgramFilesDir (x86)您将找到两个文件:ProgramFilesDir 和 ProgramFilesDir (x86)
  5. Right click on the two names and click on Modify.右键单击这两个名称,然后单击修改。
  6. Change the drive name from C to whatever drive you want to make the installations.将驱动器名称从 C 更改为您要进行安装的任何驱动器。
  7. Note that any and every software you install will get installed in the mentioned drive.请注意,您安装的所有软件都将安装在上述驱动器中。

Brilliantly useful.非常有用。 Now if there was only a way to also move User Profiles to a different drive.现在,如果只有一种方法可以将用户配置文件移动到不同的驱动器。 It looks like this used to be possible but, sadly, not any more.看起来这曾经是可能的,但遗憾的是,现在不再可能了。 Unless there's another registry hack that does this.除非有另一个注册表黑客这样做。 That last sentence refers to user profiles.最后一句话是指用户资料。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 android:如何在Android Studio中预览非默认片段xml - android: How to preview non-default fragment xml in Android Studio 适用于Android的Greenrobot eventBus-如何创建非默认事件总线 - Greenrobot eventBus for Android - how to create a non-default event bus 如何在Android Web应用程序中使用非默认字体? - How to use non-default font in Android web app? 如何从非默认应用程序发送Android Kitkat中的SMS而无需写入SMS提供程序 - How to send an SMS in Android Kitkat from non-default app without writing to SMS Provider Android:如何在自定义首选项(布局)中使用非默认共享首选项(数据) - Android: how to use non-default sharedpreference (data) in custom preference (layout) 如何将片段中的非默认构造函数更改为默认构造函数? - How to change non-default constructor in fragments to default constructor? 非默认语言,用于Android TV中的语音识别 - Non-default language for voice recognition in Android TV 如何忽略“避免片段中的非默认构造函数”错误? - How to ignore the “avoid non-default constructors in fragments” error? 如何解决此片段“非默认构造函数”错误? - How to Resolve This Fragment “non-default constructor” Error? 如何在D盘中自定义安装NativeScript ios / Android要求? - How to custom install NativeScript ios/Android requirement in D drive?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM