Ben Ethridge
Ben Ethridge

Reputation: 89

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?

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". The C: drive has just enough room for Windows 10 plus some buffer for future "OS" upgrades. The D: drive is orders of magnitude larger.

The obvious intent was for all third-party (non-OS) programs to live on D: drive, or at least not on C: "OS" drive. (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.)

  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.

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.

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.

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:

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?

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?

Upvotes: 8

Views: 21518

Answers (2)

StackExchanger
StackExchanger

Reputation: 245

Android Studio is now available through Portapps:

https://portapps.io/app/android-studio-portable/

Warning: portable apps have been used as an attack vector by malware distributors ...

https://www.mosse-security.com/advisories/advisory-2019-002-cyber-adversaries-use-portable-applications-supply-chain-attacks.html

Upvotes: 0

Sumukha M
Sumukha M

Reputation: 111

enter image description here

Change the default installation location of the programs to D or other required drive by using the following method:

  1. Press Win+R
  2. Type in regedit
  3. Head to the following location: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
  4. You will find two files: ProgramFilesDir and 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.
  7. Note that any and every software you install will get installed in the mentioned drive.

Upvotes: 11

Related Questions