Install Files In Root Directory
-
Good people, Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)? We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path. I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary. Let me know your thoughts? Thanks, Blitz
-
Good people, Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)? We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path. I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary. Let me know your thoughts? Thanks, Blitz
IMO you should not do so. It gets messy pretty soon. AFAIK Vista and future Windows will prevent regular users from doing that anyhow. The app itself belongs somewhere under C:\Program Files\ using some folder hierarchy reflecting company and product name and possibly version. The data files your app needs could go in one of the special folders provided for such purpose. See Environment.GetFolderPath, and SpecialFolder.ApplicationData/CommonApplicationData. There too some folder hierarchy should be applied. And the user-visible files your app deals with (its documents) probably belong somewhere inside "My Documents" which also should be reached through the corresponding SpecialFolder. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
IMO you should not do so. It gets messy pretty soon. AFAIK Vista and future Windows will prevent regular users from doing that anyhow. The app itself belongs somewhere under C:\Program Files\ using some folder hierarchy reflecting company and product name and possibly version. The data files your app needs could go in one of the special folders provided for such purpose. See Environment.GetFolderPath, and SpecialFolder.ApplicationData/CommonApplicationData. There too some folder hierarchy should be applied. And the user-visible files your app deals with (its documents) probably belong somewhere inside "My Documents" which also should be reached through the corresponding SpecialFolder. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
Thanks Luc, Where should the LogFile (of database errors) be placed? We may need them to email it to us for support purposes. Thanks again, Blitz
-
Good people, Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)? We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path. I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary. Let me know your thoughts? Thanks, Blitz
-
Thanks Luc, Where should the LogFile (of database errors) be placed? We may need them to email it to us for support purposes. Thanks again, Blitz
I guess your DB logfiles are common to all users, hence I would suggest SpecialFolder.CommonApplicationData; that is where I put user-agnostic logfiles. And I try and provide a command inside my app to explore that folder, or mail it to me, or whatever is appropriate; so the users don't have to explore their disk to get hold of it, and I don't have to explain the details in the documentation (since that folder may actually vary depending on the Windows version and some installation choices). :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
Good people, Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)? We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path. I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary. Let me know your thoughts? Thanks, Blitz
Thanks to both of you. By the way, do you know where I can find documentation recommending against using the root directory. The other programmer is a Java programmer and thinks that writing to the root directory is fine. Thanks again for your help, Blitz
-
I guess your DB logfiles are common to all users, hence I would suggest SpecialFolder.CommonApplicationData; that is where I put user-agnostic logfiles. And I try and provide a command inside my app to explore that folder, or mail it to me, or whatever is appropriate; so the users don't have to explore their disk to get hold of it, and I don't have to explain the details in the documentation (since that folder may actually vary depending on the Windows version and some installation choices). :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
Luc, what would you do with the Log file? Thanks, Blitz
-
Good people, Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)? We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path. I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary. Let me know your thoughts? Thanks, Blitz
It would only be "fine" if the computer that hosts your application is a dedicated PC that will only be used with your application. If not, then try and integrate with the pre-existing environment; add applications where other applications are found, write docs to the place where documents go, and errors the the EventLog. Though it might sound insane to scatter all data over different folders, there is a rationale behind it. I regularly backup "My Documents", but I hardly ever backup "Program Files" or the crap that's in the root - having the same executable backed up over and over would be inefficient. The moment my PC stops working, the Admin remotely looks into the eventlog and mails me that I should not disable the Norton Antivirus-service. He puts back an image with my applications, and I restore my Documents. The need to put every existing folder in the
PATH
has gone. What argumentation is there left in favor of installing to the systemroot?I are troll :)