在Windows应用程序安装路径中看不到动态创建的文件。 [英] Dynamically created files is not visible in windows application Installation path.

查看:64
本文介绍了在Windows应用程序安装路径中看不到动态创建的文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我已经在C#中成功创建并安装了Windows应用程序。

安装路径是 C:\Program Files(x86)\Default公司名称\Windows®


$ b单击按钮时$ b 如果不存在则创建新数据库(Sqlite)并将现有数据库保存在备份文件夹中



编码时我将能够在Visual Studio调试文件夹中看到这些备份数据库文件的创建和显示。视觉工作室路径:项目路径/ bin / Debug



但是在安装安装文件(.exe)之后,我无法在安装路径中看到备份的数据库文件



我的功能正常,但是如何才能在安装路径中看到数据库文件?



创建Windows安装程序有问题吗?

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 ?

推荐答案

要写入程序文件文件夹,您需要以管理员身份运行代码(具有提升的权限),即使您有权使用写在那里。 VS调试文件夹不受这种方式的保护。因此,您要么强制您的应用程序以提升的权限运行(此处描述 [ ^ ]),或者将数据库存储在其他地方。 br />


另一方面,可能是这样,路径虚拟化在该机器上处于活动状态,并且您尝试保存在受保护文件夹中的文件被重定向到 AppData \Roaming [ ^ ]或 Virtual Store [ ^ ]例如。
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.


这篇关于在Windows应用程序安装路径中看不到动态创建的文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆