Michael, Well, Steven asked how to put it there... :-)
But I still think it's a good idea to use this and other special folders precisely because they don't tie you to a certain drive or location. Generally, if you move these folders around via the shell namespace - either programatically or via explorer - the registry gets updated so that the system knows where the special folder is now located. If you move them through the file system that doesn't happen. You would then have to update the registry entries. So the whole point of using the special folders is that they *solve* the problem you are worried about. Obviously, a great deal of care has to be taken if you decide to move the location of any of these folders. You'll also break any poorly written application that thinks it knows where they are supposed to be. Charlie Poole [EMAIL PROTECTED] www.pooleconsulting.com www.charliepoole.org > -----Original Message----- > From: Moderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Lehman > Sent: Saturday, July 27, 2002 10:21 PM > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Application Installation Directory > > > Charlie (and Steven), > > That's all well and good if you want to > put that stuff in the CommonApplicationData area. > > I often find I need either finer control or I *don't* > want it in the common area so I can move the application > and all of it's data by moving a single folder tree. > It's easier to backup that way and you also have > more control over which drive it resides on. > > Many Microsoft tools seem to assume you have a single > monolithic C drive and plenty of space there. I often > install nothing except system tools on the C drive so > I can "ghost" it and roll my system back to a known > state by completely overwriting the C drive which > could blow away the CommonApplicationData. > > Just my personal point of view. > > - Michael > www.mikelehman.com > > > At 06:13 PM 7/27/2002 -0700, you wrote: > >Steven, > > > >Application.CommonAppDataPath will point to a subfolder of > >Environment.SpecialFolder.CommonApplicationData using > >Microsoft's recommended structuring: > > Base Path\CompanyName\ProductName\ProductVersion > >where CompanyName, ProductName and ProductVersion come > >from your assembly attributes. > > > >If you are doing a Windows Forms application and you > >have no good reason to structure things differently > >I'd use that approach. > > > >Charlie Poole > >[EMAIL PROTECTED] > >www.pooleconsulting.com > >www.charliepoole.org > > > > > > > -----Original Message----- > > > From: Moderated discussion of advanced .NET topics. > > > [mailto:[EMAIL PROTECTED]]On Behalf Of Steven > > > Livingstone > > > Sent: Saturday, July 27, 2002 12:11 AM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [ADVANCED-DOTNET] Application Installation Directory > > > > > > > > > Yep - I like both the > > > System.Environment.SpecialFolder.CommonApplicationData and > > > Application.CommonAppDataPath. > > > > > > First question is - do these point to the same folder? The aren't very > > > well described in MSDN.... > > > Also - where do you define what folders these are? In the > > > machine.config? > > > > > > The files I have are Xml files created per user, but > dynamically at run > > > time. I would rather use a common application area as this > app is not a > > > web form app and may be used via a web form. Also, although files will > > > be created by users, they will be shared amoungst others users. > > > > > > Cheers, > > > Steven. > > > > > > -----Original Message----- > > > From: Moderated discussion of advanced .NET topics. > > > [mailto:[EMAIL PROTECTED]] On Behalf Of > Charlie Poole > > > Sent: Friday, July 26, 2002 5:23 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [ADVANCED-DOTNET] Application Installation Directory > > > > > > > > > Steven, > > > > > > In that situation, I'd tend to use the common Application Data folder: > > > > > > System.Environment.GetFolderPath( > > > System.Environment.SpecialFolder.CommonApplicationData ); > > > > > > If you have per user stuff, you can use either the user's Personal ( > > > i.e. My Documents ) folder, ApplicationData or LocalApplicationData. > > > > > > Charlie Poole > > > [EMAIL PROTECTED] > > > www.pooleconsulting.com > > > www.charliepoole.org > > > > > > > > > > -----Original Message----- > > > > From: Moderated discussion of advanced .NET topics. > > > > [mailto:[EMAIL PROTECTED]]On Behalf Of Steven > > > > Livingstone > > > > Sent: Thursday, July 25, 2002 11:50 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: Re: [ADVANCED-DOTNET] Application Installation Directory > > > > > > > > > > > > A good question. > > > > I have several folders containing (dynamic) Xml files in an > > > > application I am creating. I use the Xml as an alternative > storage to > > > > a RDBMS > > > > - I'll have a class that determines which you want to write to. > > > > > > > > Question I did have was where to store all these files and where to > > > > reference them. I decided that the project directory of my main > > > > application was best and for each folder and put entries in the > > > > .config file to point to the file location. The idea being that are > > > > install time the full path would be entered into the .config file. > > > > > > > > The files in these folders are dynamic so it looks like this is the > > > > only solution... Unless you have any other ideas. > > > > > > > > Cheers, > > > > Steven. > > > > > > > > -----Original Message----- > > > > From: Moderated discussion of advanced .NET topics. > > > > [mailto:[EMAIL PROTECTED]] On Behalf Of Charlie > > > > Poole > > > > Sent: Friday, July 26, 2002 12:56 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: Re: [ADVANCED-DOTNET] Application Installation Directory > > > > > > > > > > > > However... > > > > > > > > Was that the right question? I wonder if looking in the app > directory > > > > isn't a bit old hat with .Net. Perhaps he should consider adding the > > > > file to the assembly. > > > > > > > > Charlie Poole > > > > [EMAIL PROTECTED] > > > > www.pooleconsulting.com > > > > www.charliepoole.org > > > > > > > > > > > > > The answer is.... Application.StartupPath > > > > > > > > > > or more fully (System.Windows.Forms.Application.StartupPath) > > > > > > > > > > - Michael Lehman > > > > > www-mikelehman-com > > > > > System Architect > > > > > > > > > > > > > > > At 04:50 PM 7/25/2002 -0500, you wrote: > > > > > >How do I return the path the the applications installation > > > > > directory to my > > > > > >app ?? > > > > > > > > > > > >I have a windows forms app that needs to reference a > file that I am > > > > > > > > >including in the installation along with the app. I need to open > > > > > that format > > > > > >file and output it to the printer. > > > > > > > > > > > >Thanks in advance, > > > > > > > > > > > >At the source of every error which is blamed on the computer, > > > > > you will find > > > > > >at least two human errors, including the error of > blaming it on the > > > > > > > > >computer. > > > > > > > > > > > >Steve Walker > > > > > >Hale-Halsell Company > > > > > >918-641-5249 > > > > > > > > > > > >You can read messages from the Advanced DOTNET archive, > unsubscribe > > > > > > > > >from Advanced DOTNET, or subscribe to other > DevelopMentor lists at > > > > > >http://discuss.develop.com. > > > > > > > > > > You can read messages from the Advanced DOTNET archive, > unsubscribe > > > > > from Advanced DOTNET, or subscribe to other DevelopMentor lists at > > > > > http://discuss.develop.com. > > > > > > > > > > > > > You can read messages from the Advanced DOTNET archive, unsubscribe > > > > from Advanced DOTNET, or subscribe to other DevelopMentor lists at > > > > http://discuss.develop.com. > > > > > > > > You can read messages from the Advanced DOTNET archive, unsubscribe > > > > from Advanced DOTNET, or subscribe to other DevelopMentor lists at > > > > http://discuss.develop.com. > > > > > > > > > > You can read messages from the Advanced DOTNET archive, > unsubscribe from > > > Advanced DOTNET, or subscribe to other DevelopMentor lists at > > > http://discuss.develop.com. > > > > > > You can read messages from the Advanced DOTNET archive, > > > unsubscribe from Advanced DOTNET, or > > > subscribe to other DevelopMentor lists at http://discuss.develop.com. > > > > > > >You can read messages from the Advanced DOTNET archive, unsubscribe from > >Advanced DOTNET, or > >subscribe to other DevelopMentor lists at http://discuss.develop.com. > > You can read messages from the Advanced DOTNET archive, > unsubscribe from Advanced DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. > You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.