2

I confess, the question title suggest a "too broad" question, but here me out first... I am only interested in verifying my findings in that regard.

All the following situations have the following in common:

  • Binaries and supporting files (no user data) of an unspecified application should be installed onto the target system.
  • Configuration, user data shall be stored on the target system.
  • Start menu shortcuts shall be created on the target system.
  • The roaming/local synchronization concept should be considered.

The scenarios are:

  1. A machine-wide installation; all users on the target system can see the start menu shortcuts within their user desktop, and can use the application. Configuration and user data are shared across all users (are common, no individual configuration or user data).
  2. A machine-wide installation; all users on the target system can see the start menu shortcuts within their user desktop, and can use the application. Configuration and user data are individual to the specific user and isolated from each other (users cannot access configuration and other data from other users).
  3. A per-user only installation; users needs to install the application by themselves. If user A installs the application, the installation of user A is not accessible to user B. If user B wants to use the application, user B has to install the application individually.

From my "research", I have identified the following directories for the mentioned scenarios:

Scenario 1: machine-wide installation, shared configuration and common user data

  • Application binaries: C:\Program Files\[Manufacturer]\[ProductName]
  • Configuration and user data: C:\ProgramData\[Manufacturer]\[ProductName]
  • Start menu shortcuts: C:\ProgramData\Microsoft\Windows\Start Menu

Scenario 2: machine-wide installation, individual configuration and individual user data

  • Application binaries: C:\Program Files\[Manufacturer]\[ProductName]
  • Configuration and user data: C:\Users\[UserName]\AppData\Roaming\[Manufacturer]\[ProductName]
  • Start menu shortcuts: C:\ProgramData\Microsoft\Windows\Start Menu

Scenario 3: per-user only installation, individual configuration and individual user data

  • Application binaries: C:\Users\[UserName]\AppData\Local\[Manufacturer]\[ProductName]
  • Configuration and user data: C:\Users\[UserName]\AppData\Roaming\[Manufacturer]\[ProductName]
  • Start menu shortcuts: C:\Users\[UserName]\AppData\Roaming\Microsoft\Windows\Start Menu

Pit fall with scenario 3: The user may install the application on a computer A, which is Active Directory connected, switches to computer B. The application is not installed on computer B, since the application was installed on computer A within Local, so the data was not shared/synced with the Active Directory environment. The issue is, that the user sees the shortcuts, as they were added to Roaming. I could not find a Local start menu. On the other hand, when the application would be installed within the Roaming domain, Active Directory administrators will quickly argue against the installation of the software, as shared/synced Roaming is not intended for application binaries, but user data.

There are several (unnamed) application available, which do not uses the "common directories". For example, new directories were created on the root level (directly under C:\, like C:\[Manufacturer]\[ProductName]) or in the (visible) user home directory (like C:\Users\[UserName]\Documents\[Manufacturer]\[ProductName]). I disfavor such solutions, as an administrator would have hard times finding application binaries or user data, and, related to C:\Users\[UserName]\Documents, will populate the visible user home with data, the users has not placed there by themselfs. The possibility of the user deleting mandatory configuration or user data files is high, because the user thinks "I do not have placed it there".

Edit I missed to reveal some information that clarifies the/my situation. I am operating an installation builder software, that provides me with generic path variables, such as LocalAppDir, RemoteAppDir, ProgramsDir, ProgramDataDir, etc .. I have picked some of the most common used targets (paths) to discus, whether the (resolved and absolute) path is the right path to use. @MSalters pointed out the localization issue, and ProgramData dir moved issue. However, those issues are mitigated by using the path variables provided by the installation builder software.

Using a Windows-based system (as of Windows 7, 8.1, 10), what are the correct (intended) storage locations (folders) for an application?

3

The answers you have identified so far are wrong. The directories might be localized. Call SHGetKnownFolderPath.

You'll need the appropriate KNOWNFOLDERID constants, but they're documented well.

Your pitfall is theoretical. In practice, Active Directory environments with Roaming Profiles are used in larger enterprises and other centrally-managed environments where Group Policies forbid per-user installations altogether.

| improve this answer | |
  • Interesting conclusion... Since Windows 7, all English localized paths are working on any installed language. For example in a German language installation, the user sees the German localized path within the address bar. When the user clicks into the address bar (since Windows 8?), despite the installed language, the user sees the English localized path, which he can copy. Are there any other points that leads you to your conclusion ("wrong")? Further more, this is not code specific but architectural. There is no code to call within an architectural document describing where to store things. – burnersk Feb 4 at 12:04
  • 1
    @burnersk: You are indeed likely to encounter reparse points or junctions, but this is not guaranteed. In particular, upgraded installs differ from fresh installs. Another case (besides localized paths) to consider is when some of these have been moved to other drives (which is documented; support.microsoft.com/en-us/help/949977/…) – MSalters Feb 4 at 12:36
  • OK, thank you for your additional input. I see, I missed to reveal some information that might clarify some background information you have missed, since I did not have revealed it earlier. I am operating an installation builder software, that gives me various path definitions (LocalAppDir, RoamingAppDir, ...). Some of the most common I have posted in my question as resolved and absolute paths. I will update my question with this information. – burnersk Feb 4 at 13:03
  • @burnersk: Ok, so those symbolic variables in your installer are basically wrappers around KNOWNFOLDERID, and exist for the same reason. – MSalters Feb 4 at 13:09
  • I assume so. The path variables are actually displayed as absolute paths (with a different color for differentiation of static path elements). This was another reason why I have initially used the resolved and absolute paths in my question. I can confirm that the path variables resolves to different absolute paths depending operating system installed on the target/executing system. – burnersk Feb 4 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.