Re: VS2008 SpecialDirectories.AllUsersApplicationData vs. Setup Project [CommonAppDataFolder]



Steven-
Thank you very much. I was able to make your suggestion work.
I used:
System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData)
and
[CommonAppDataFolder] in the Setup Project

I also discovered that apparently C:\Documents and Settings\All Users\Application Data\ is aliased in Vista as C:\ProgramData\.
I knew Unix did that sort of thing...but this is the first time I've noticed Windows doing it.

Thank$ a million!


Steven Cheng [MSFT] wrote:
Hi Dan,

As for the special directories(in VBNET app) and the Speical folders in setup project, there does exists difference between them. Actually, the VBNET's speical directories may add some addtional value into ApplicationPath(such as app name and version number). While the setup project's special folder is mainly related to what is commonly used for setup a program. here is a list of setup project's folders:

#Special Folders and Custom Folders http://msdn2.microsoft.com/en-us/library/s2esdf4x(VS.80).aspx

Also, in .net framework, you can use the System.Environment.SpecialFolder enum to get a list of common folders on windows system:

#Environment..::.SpecialFolder Enumeration
http://msdn2.microsoft.com/en-us/library/system.environment.specialfolder.as
px

The Environment.SpecialFolder.CommonApplicationData seems point to the "Documents Settings\All Users\Application Data". For the "AllUsersApplicationData " in VBNET SpecialDirectories class, it is a parituclar one implemented in VB.NET which doesn't quite conform to the CommonApplicationData Location. I think you use the System.Enviornment.SpecialFolders enum.

For sharing data among all users, the common approach is put the data file with your application exe together in the Program Files installed folder. Or you can use a central server (database) to store large amount of data. On vista, there is virtualization feature, this may affect your application that access shared , system location. You need to elevate the application at admin privilege to access those location. here is an article mentioned this:

#Folder Virtualization in Windows Vista http://www.west-wind.com/WebLog/posts/5584.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg@xxxxxxxxxxxxxx

==================================================
Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Date: Sun, 06 Apr 2008 15:24:42 -0400
From: Dan Stevens <TOADLLC@xxxxxxxxxxxxxxxx>
User-Agent: Thunderbird 1.5.0.14 (Windows/20071210)

It appears that SpecialDirectories.AllUsersApplicationData refers to the following folder in Vista
C:\ProgramData\[Manufacturer]\[ProductName]\[ProductVersion]

I would prefer to reference the following:
C:\Documents and Settings\All Users\Application Data\[Manufacturer]\[ProductName]
It appears this is the same as "[CommonAppDataFolder]" in my Setup Project(File System on Target Machine-->Add Special Folder...)

1. Is there a reason the AllUsersApplicationData differs from CommonAppDataFolder?

2. Is one location preferred over the other?

3. Why are there differences between
coding - My.Computer.FileSystem.SpecialDirectories...
and
deployment - File System on Target Machine-->Add Special Folder...

4. If I want the data to be shared amongst users, and I don't want the data-store location to change when I change the version of my app...
...what is the preferred location, and how do I refer to it in coding & deployment?



.



Relevant Pages

  • RE: VS2008 SpecialDirectories.AllUsersApplicationData vs. Setup Project [CommonAppDataFolder]
    ... setup project, there does exists difference between them. ... here is a list of setup project's folders: ... "AllUsersApplicationData " in VBNET SpecialDirectories class, ... For sharing data among all users, the common approach is put the data file ...
    (microsoft.public.vsnet.general)
  • Re: VS2008 SpecialDirectories.AllUsersApplicationData vs. Setup Project [CommonAppDataFolder]
    ... Subject: VS2008 SpecialDirectories.AllUsersApplicationData vs. Setup ... [CommonAppDataFolder] ... here is a list of setup project's folders: ... "AllUsersApplicationData " in VBNET SpecialDirectories class, ...
    (microsoft.public.vsnet.general)
  • Syncing Outlook data across 2 Windows OSes
    ... I imagine you'll have no trouble understanding the setup below, ... the profile files on a common 'files only' partition, ... Connector add-in from the default set of folders. ... if you ever choose to change the default account associated with the ...
    (microsoft.public.outlook.installation)
  • Re: Organising My Documents?
    ... If you're keeping your old setup, use TweakUI and change their paths. ... PC I now have temporary folders preserving the old PC structure, ... hundreds of shortcuts that use the existing structure, ... editors and burning programs have a fixation on 'My Videos', ...
    (microsoft.public.windowsxp.general)
  • convert.exe with /cvtarea: parameter during XP installation from network share
    ... drive is an NTFS drive _before_ the GUI part of setup starts, ... folders are inherited from the root folder. ... has higher security permissions like in NT4 or W2K, ...
    (microsoft.public.windowsxp.general)