Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I am trying to find a method to allow me to write a settings file to the installed directory in Win 7 and Vista. Right now I can install (InstallShield 2010) my program and dependencies on XP and gain write access without a problem. This causes a problem with Vista and Win 7. I receive "Access To The Path "..." is Denied". How can this be done in Win 7 or Vista?

Thanks for any direction.

UPDATE:
Answer posted by OP.
Posted
Updated 9-Aug-10 6:49am
v3

It can't be done. If code could defeat the protection system, then it would be worthless. You have to store data in the app data area.
 
Share this answer
 
Comments
willworknow1 8-Aug-10 17:44pm    
Thanks for the answer...now how do I get this path? Also...am I able to ALWAYS write to this area?

Thanks.
willworknow1 9-Aug-10 9:40am    
Never mind...I think I will use IsolatedStorageFileStream to get this done.

Thanks for your answer Christian.
IsolatedStorageFileStream outStream = 
new IsolatedStorageFileStream(FILE_NAME, FileMode.Create, isoStore);

using (BinaryWriter binWriter = new BinaryWriter(outStream))
{
    binWriter.Write(Data);
}
 
Share this answer
 
Comments
Toli Cuturicu 10-Aug-10 10:37am    
Reason for my vote of 3
poor approach

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900