Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I have created and installed windows application in C# Successfully.
Installation path is C:\Program Files (x86)\Default Company Name\WindowsApp.

when button clicks i was Creating new Database (Sqlite) if not exists and saving existing Database in a backup folder.

while coding i will able to see these backup database files created and showing in visual studio debug folder.Visual studio path : "Project Path/bin/Debug".

But after installed setup file(.exe), i was unable to see the backed up database files in installation path.

My functionality is working fine , but how can i see the database files in the installation path ?

Is issue with Creating windows setup ?
Posted

1 solution

To write in Program files folder you need to run your code as admin (with elevated privileges), even if you have the rights to write there. The VS debug folder is not protected this way. So you either force your app to be run with elevated privileges (like described here[^]), or you store your database elsewhere.

On the other hand, it might be the case, that path virtualization is active on that machine, and the files you try to save in a protected folder, are redirected to AppData\Roaming[^] or Virtual Store[^]for example.
 
Share this answer
 
v3

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