What is installation directory in windows

How do you change the default Installation Directory in Windows 7 64bit?

Just installed Windows 7 64bit Home Edition, can’t seem to change the default installation directory with regedit successfully. Did this no problem in XP. I have Window installed on a small SSD drive with a second hard drive to use for progams e.g. F:/Program Files.

Any one done this successfully?

***Post moved by the moderator to the appropriate forum category.***

Welcome to Microsoft Answers Community Forum!

In order to change the default installation directory, please change the following in the registry.

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

322756 (http://support.microsoft.com/kb/322756/ ) How to back up and restore the registry in Windows

To change the registry, follow these steps:

1. Start Registry Editor by entering “Regedit” in the search All programs.

2. Locate the following:

3. Right click on the value named ProgramFilesDir & change the default value C:\Program Files to the path you want to install all your programs in.

4. Click OK and Exit.

Windows, by default, will now install your programs in the new drive or path.

Hope this helps!

Supreeth — Microsoft Support.
Visit our Microsoft Answers Feedback Forum
http://social.answers.microsoft.com/Forums/en-US/answersfeedback/threads/ and let us know what you think

225 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

Change default Program Files installation directory location in Windows 10

In Windows 10/8/7 OS, by default, software gets installed on your System Drive, usually C drive, in the Program Files folder. The typical path is normally in Windows 32-bit is C:\Program Files and in Windows 64-bit is C:\Program Files and C:\Program Files(x86).

Microsoft recommends the C:\Program Files folder for the default installation destination. It’s a convention that ensures proper inter-operation between your program and the OS’s application and security models. So, once software programs are installed they go by default to C:\Program files on the computer.

This can, however, be changed by selecting another folder or location or partition. To change the default installation folder, the data must be modified in the ProgramFilesDir key and a new path must be chosen for the installation folder.

Windows uses the System Disk for installing any new applications, That is, if your Windows is installed on the C Drive, the default folder where all the applications you install would automatically show up as C:\Program Files, unless of course, you change in manually while installing the application’s locations.

Do note that Microsoft does not support changing the location of the Program Files folder by modifying the ProgramFilesDir registry value. It states that if you change the location of the Program Files folder, you may experience problems with some Microsoft programs or with some software updates.

Change default Program Files directory

If you almost always prefer to NOT install on the System Disk, but instead on another partition, say, the D drive, then rather than changing the default location every time, you can edit the registry as follows:

Now open Regedit and navigate to the following key:

Now in the right pane look for the value ProgramFilesDir and/or ProgramFilesDir (x86) depending on whether your Windows is 32-bit or 64-bit.

Double-click on it and in the box which opens up change its Value data from C:\Program Files to say, D:\Program Files.

The default directory for the installation of all your programs shall now be D:\Program Files.

If you are using Windows 64-bit, you have to change the value of ProgramFilesDir and ProgramFilesDir (x86).

Change Default Installation Folder in Windows 10

When we install new programs on our System, by default they will be installed in System drive which is C drive mostly. The programs which are 32 bit will be installed in “C:\Program Files(x86)” folder and the programs which are 64 bit will install in “C:\Program Files” folder by default.

If you are running out of space in your C drive, you can move some files to other drives. Program Files is one of the most important folders in C drive which takes a lot of space if more software are installed in the system. One way of freeing up space in C drive is to change the default installation location of C:\Program Files. This will not move the currently installed programs but all future programs will be installed in the new location without manually changing the default installation path while installing the application.

Читайте также:  Создание своего окружения для linux

Let’s see how we can change the default installation folder in Windows 10. The same can be applied to Windows 7 and Windows 8.1.

Changing the default installation folder

Proceed with following steps to change the default location of installation folder for new installing programs.

  1. Type the “regedit” in start menu and open the first result it shows.
  2. Go for following keys
    “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion”. And double click on “CurrentVersion”. Then on right hand side window will expand. Go for ProgramFilesDir from list. If your Operating System is 64 bit then there will be two entries ProgramFilesDir and ProgramFilesDir(x86).
  3. Double click on any one of them and see the entries. It is C drive first. You can edit any drive where you want to save all installations. And then press Ok after editing.
  4. Restart the system for changes to take effect. And new installation will be done in your new folder.

Apply these manageable and painless steps to change your default folder of installation. This may help you in making your System drive’s space manageable and in control. Now move any of your large files, games, or software between storage drives in few clicks

How to get the installation directory?

The MSI stores the installation directory for the future uninstall tasks.

Using the INSTALLPROPERTY_INSTALLLOCATION property (that is «InstallLocation» ) works only the installer has set the ARPINSTALLLOCATION property during the installation. But this property is optional and almost nobody uses it.

How could I retrieve the installation directory?

6 Answers 6

Use a registry key to keep track of your install directory, that way you can reference it when upgrading and removing the product.

Using WIX I would create a Component that creates the key, right after the Directy tag of the install directory, declaration

I would try to use Installer.OpenProduct(productcode). This opens a session, on which you can then ask for Property(«TARGETDIR»).

Try this: var sPath = this.Context.Parameters[«assemblypath»].ToString();

I’d use MsiGetComponentPath() — you need the ProductId and a ComponentId, but you get the full path to the installed file — just pick one that goes to the location of your installation directory. If you want to get the value of a directory for any random MSI, I do not believe there is an API that lets you do that.

As stated elsewhere in the thread, I normally write a registry key in HKLM to be able to easily retrieve the installation directory for subsequent installs.

In cases when I am dealing with a setup that hasn’t done this, I use the built-in Windows Installer feature AppSearch: http://msdn.microsoft.com/en-us/library/aa367578(v=vs.85).aspx to locate the directory of the previous install by specifying a file signature to look for.

A file signature can consist of the file name, file size and file version and other file properties. Each signature can be specified with a certain degree of flexibility so you can find different versions of the the same file for instance by specifying a version range to look for. Please check the SDK documentation: http://msdn.microsoft.com/en-us/library/aa371853(v=vs.85).aspx

In most cases I use the main application EXE and set a tight signature by looking for a narrow version range of the file with the correct version and date.

Recently I needed to automate Natural Docs install through Ketarin. I could assume it was installed into default path ( %ProgramFiles(x86)%\Natural Docs ), but I decided to take a safe approach. Sadly, even if the installer created a key on HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall , none of it’s value lead me to find the install dir.

The Stein answer suggests AppSearch MSI function, and it looks interesting, but sadly Natural Docs MSI installer doesn’t provide a Signature table to his approach works.

So I decided to search through registry to find any reference to Natural Docs install dir, and I find one into HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components key.

I developed a Reg Class in C# for Ketarin that allows recursion. So I look all values through HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components and if the Main application executable (NaturalDocs.exe) is found into one of subkeys values, it’s extracted ( C:\Program Files (x86)\Natural Docs\NaturalDocs.exe becomes C:\Program Files (x86)\Natural Docs ) and it’s added to the system environment variable %PATH% (So I can call «NaturalDocs.exe» directly instead of using full path).

The Registry «class» (functions, actually) can be found on GitHub (RegClassCS).

Even if you don’t use Ketarin, you can easily paste the function and build it through Visual Studio or CSC.

A more general approach can be taken using RegClassVBS that allow registry key recursion and doesn’t depend on .NET Framework platform or build processes.

Please note that the process of enumerating the Components Key can be CPU intense. The example above has a Length parameter, that you can use to show some progress to the user (maybe something like «i from (subKeysName.Length — 1) keys remaining» — be creative). A similar approach can be taken in RegClassVBS.

Both classes (RegClassCS and RegClassVBS) have documentation and examples that can guide you, and you can use it in any software and contribute to the development of them making a commit on the git repo, and (of course) opening a issue on it’s github pages if you find any problem that you couldn’t resolve yourself so we can try to reproduce the issue to figure out what we can do about it. =)

Changing the default installation folder for programs in Windows 10 — safely

Having recently installed Windows 10 after my incredible XP Pro server died suddenly, I have immediately managed to break it by changing the default installation folder for programs through Regedit.

Читайте также:  Ппджой для 10 windows

I did this following input I found online; when, I must admit, I entirely ignored the warning that currently installed programs may no longer work. That turned out to very true. Win10 loaded alright, but many actions produced no result whatever, not even an error message. Could not repair it either, and eventually I had to resort to a Linux-based tool (PMagic, if you must know — very cool stuff).

The solution suggested in the initial input was to move all currently installed files and folders to the new location.

I have been a believer in multiple partitions and physical disk drives for a very long time (and I always have several). I do not subscribe to the Microsoft approach, which puts everything into the C:\ installation partition — unless you tell it otherwise.

Unfortunately, some programs will not prompt for an installation path of choice. Thus my efforts in the Registry.

And this, therefor, is what I put to the community:

  1. Is there an official, Microsoft approved method of changing the default installation path for all user installed programs?
  2. If not, would it indeed be safe to change all relevant keys referring to ProgramFilsDir in the Registry and then simply and at the same time also move all material from the C:\Programs folder into a partition on another drive (entering the target location, in my case simply F:\ into the registry keys?
  3. Having thought about this for some time, I wonder: would it in fact work if I simply substituted (ie put into C:\ a shortcut named Programs, and have the shortcut point to my preferred location of F:\

And if you need to know: F: stands for Foftware, since S: I use for Source of programs. But funny bits aside, I am serious about my intentions and would really appreciate some knowledgeable input.

Greetings from down under

Replies (11) 

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

Thank you for posting in Microsoft Community.

To change the default installation path, just follow below steps:

1. Press Windows key + R and type gpedit.msc

1. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion.

2. At the right panel, look for ProgramFilesDir.

3. Double click on it to change the value to your desired path. For example, change the value from C:\Program Files to D:\Softwares.

Registry disclaimer

To do so: Important this section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

How to back up and restore the registry in Windows

Let us know the status of the issue.

5 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Is there an official, Microsoft approved method of changing the default installation path for all user installed programs?

No.

If not, would it indeed be safe to change all relevant keys etc. etc.

Only if you want to trash your install.

Having thought about this for some time, I wonder: would it in fact work if I simply substituted (ie put into C:\ a shortcut named Programs, and have the shortcut point to my preferred location of F:\

See above answer.

You seem intent on making the operating system work in a way it was never designed to work. You must have the coolest automobile, but I wouldn’t want to drive it.

2 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thank you for your input, all parts of which are fair enough. And, yes, maybe I am intent on that, but just maybe the OS could offer more options. And I do drive the coolest car.

But seriously, I am thinking that there is speed to be gained by having the OS on one drive; and have it load programs from another. And this is the basis for my efforts; which I will now abort anyway.

2 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thank you for responding. I will need to think about doing it again this way (if at all). I had followed this lead: http://www.groovypost.com/howto/modify-windows-default-program-install-directory/ which referrs to two keys and adds detail for 64-bit systems — which mine is.

Читайте также:  Очистка шрифтов windows 10

I boldly changed all and stuffed it up big time as I said in my post.

If I follow your lead precisely, can I assume that the Windows programs continue to work, while having my installs go to the new path? In my earlier efforts I could not even open the registry editor anymore; so could not fix the issue. And attempting to Repair from the installation medium also failed.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Given the speed of today’s hardware, I don’t think it would make any difference performance-wise if you tried to install applications on a different partition.

No matter where you install them, applications write to the registry, which is always located on the system partition. Applications also install files onto the system partition and reference libraries on the system partition. Applications and the OS are deeply linked so it makes no sense to separate them. It’s like making newlyweds sleep on separate beds.

If you want to separate your data from your software, that’s a fabulous idea. Windows makes it easy to do that. And it makes sense, because if you need to restore a backup of your OS why send your personal folders back in time, and vice versa?

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I have similar questions. Not sure how to get around it yet.

As part of justification for 3 partition setup.

Microsoft has been notorious for having its own updates, or other softwares and their updates, mess up many times.

Also, some executables turn out to be viruses, bcs MS is so inept at making and keeping a secure OS, as they have even given up on MS essentials and really want people to go get other companies’ antivirus.

jBut the main thing is running C drive on an SSD, esp if only 64gb which used to be plenty big but now is too small, and soon enough even 128 gb will be too small bcs of all the MS bloat!

So having just the OS on the ssd, and then putting your added programs on a spinning hard drive partition and your data drive on another spinning hard drive partition, is the MAIN reason that people need this setup!

On win xp and win 7, i have always run 3 partitions, and using the junctions and rededit minor changes for drive letters.

My config is C, E, G — C for win os of course, E for executables, and G for garage (ie, personal data, stuffed like everyone’s house garages with all my stuff, my keepsakes, etc.

As an additional benefit, my disk drive i always make D (like, duh!), and then my sd slot and photo card I relettered to F for Fotos.

Thus, i have a c,d,e,f,g that covers all my computer needs. and then use 2 tb external hard drives M for multimedia (music, pics), and another for N for nickelodeon (ie my movies/films/vids). If I get to the point of needing a pix only xhd, then of course P will come in handy.

In any case, when Windows messes up and have to do reinstall at some point. then I only have to reinstall first the os on C, and leave E and G alone.

I’ll have to reinstall programs from E, but the point is that all the exe and setup files are there on my E, and preserved, so i just start dblclicking their file names to get them reinstalled.

I dont have to remember what programs I had, or what I might have lost (ie some software like DVD shrink or mgi photosuite for win 7 no longer seem to exist and impossible to re-obtain).

The fact that I like to redirect my Program Files and Program Files (x86) to my E drive is also to help protect all 3. if something nasty gets in (which it hasnt sincce Ive been careful), I believe it less likely that it will run amok my whole system. at least it would have a much smaller play area, ie only the E drive, where it might do stuff.

BUT the main reason is bcs of using an SSD for the C os drive!

In any case, the drive letters should NOT matter to microsoft.

Particularly since it has always worked on their systems, and there are innumerable posts and websites of how to do these steps in XP and 7 bcs some people just want to.

It is my computer and *I* should have some say in where things go, as I have an entire system, as many others do, so that I can find my stuff, and protect myself.

It just gets irritating that microsoft, who can’t ever manage to put out any product without bugs, fixes, or new breakings of other things.

thinks that it knows better than me about what i want.

Оцените статью