deploying to a folder other than program files

Q

queanbeyan

Hi

I have found that many of my potential users of my application are not
able to write to their program files directory on C:\program files,
however they have access to 'My documents'.

i have mapped some code to 'c:\documents and
settings\%username%\documents' but I dont know how to map the default
deployment application folder to that directory. The current default
is [ProgramFilesFolder]\[product] which maps to 'c:\program files\hilda
helpa'- what is the equivilent for 'c:\documents and
settings\%username%\documents' in the default application folder?

If this is not the best way to do it, please explain an alternative
that is relatively simple.

Thanks

Doug
 
M

Mugunth

Doug,
It's usually bad design to deploy an application to a folder other than
program files.
From your question, I understand that, you want to create some files on
the same
directory as your application, but you fear that it would be
problematic to limited users.

With windows 2000 (i guess) and above, applications should not write or
create any folder within program files (except setup programs). All
application related settings/data should be stored in
c:\documents and settings\<username>\Application Data\<Company
Name>\<Product Name>
All temporary files should be created at location,
c:\documents and settings\<username>\Local Settings\Application Data\
(the text within quotes are variables.)

where C is your system drive.

System.IO.Path.GetTempPath(), a static function will give you the
current users temporary directory.
Similarly, there are functions that will get you the my documents
folder, (which I don't remember now).

Hope that helps.

Hi

I have found that many of my potential users of my application are not
able to write to their program files directory on C:\program files,
however they have access to 'My documents'.

i have mapped some code to 'c:\documents and
settings\%username%\documents' but I dont know how to map the default
deployment application folder to that directory. The current default
is [ProgramFilesFolder]\[product] which maps to 'c:\program files\hilda
helpa'- what is the equivilent for 'c:\documents and
settings\%username%\documents' in the default application folder?

If this is not the best way to do it, please explain an alternative
that is relatively simple.

Thanks

Doug
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You should keep the code in Program Files, you should then store ALL
personalizable data under one of the folder from Environment.SpecialFolders
like ApplicationData for example.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top