By default on a Windows system, new programs will be installed into the Program Files folder inside the system drive. Therefore, if you always install software on a different drive, you have to provide the path manually to the desired location during the setup process of each program. Luckily, there is a way to force all setup wizards to use your custom installation path right out of the box.
1. Open the Run window by pressing Win key + R on your keyboard, type regedit in the field, and click OK to open Registry Editor.
2. When the Registry Editor shows up onscreen, expand the HKEY_LOCAL_MACHINE folder on the hierarchy located on the left side , and navigate to SOFTWARE\Microsoft\Microsoft\Windows\CurrentVersion.
3. Once you get to the desired location, you will see the ProgramFilesDir string value on the panel on the right side. If you cannot find it anywhere, right-click on an empty space on the right side, choose New -> String Value, and name it ProgramFilesDir.
If you are using a 64-bit system, you will see another value named ProgramFilesDir (x86) which contains the path to install 32-bit programs on your computer. You may want to modify both values so that all future programs will be installed to the desired location.
To modify the default installation path, double-click on the value, and replace the default path with a new one (e.g., D:\Program Files).
To get the path to the new install location, launch an instance of Explorer, navigate to the folder, click on the address bar, and choose Copy.
4. When you are done editing the values, close the Editor window. Unlike other registry hacks which work immediately, you have to restart your computer for this hack to take effect.
Now, if you install any program, its default install path will be set to your custom location; you do not need to set the path manually anymore.