在 Win7 计算机上创建文件的应用程序权限 - 需要管理员权限吗?
我最近发现我的应用程序在 Win 7 计算机上出现故障,因为它无权在其安装目录中创建文件/子目录。这是应用程序需要能够执行的操作,我发现如果它在管理员权限级别运行,它的行为会很好。
我想确保应用程序可以根据需要以最简单的方式创建子目录和文件 - 如果可能的话自动允许权限。理想情况下,这不需要要求用户在我的可执行文件上手动启用“以管理员身份运行”功能。
自动实现这一目标的最佳方法是什么?
我发现这个问题: 如何在以管理员身份运行模式下部署应用程序?< /a>
它适用吗?这是最好的方法吗?
在我看来,这种限制在 Win 7 中是不必要的 - 应用程序应该能够操作文件,至少在它们自己的目录中。
谢谢
I've recently discovered that my app malfunctions on Win 7 machines because it does not have permission to create files/sub directories in its install directory. This is something the app needs to be able to do and I found out that it behaves fine if it is run at an admin privilege level.
I would like to ensure the app can create the sub directories and files as required, in the simplest way possible - allowing permissions automatically if possible. Ideally this would be without having to ask the user to manually enable the "run as admin" feature on my executable.
What is the best way to automatically achieve this?
I found this question:
How do I deploy applications in run as administrator mode?
Does it apply? Is that the best way?
It seems to me like this restriction is unnecessary in Win 7 - apps should be able to manipulate files, at least in their own directory.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的应用程序可能安装在程序文件目录下,并且您必须假设您无法写入该目录。您还应该在没有管理员权限的情况下运行,因为某些用户没有管理员权限。因此,您应该遵循平台指南并将需要修改的文件存储在标准用途可以修改它们的位置。此问题也会影响 Vista 上的您。
Your app likely installs under the program files directory and you have to assume that you can't write to that directory. You also should run without admin rights since some users won't have them. Thus you should follow the platform guidelines and store files that you need to modify in a location where standard uses can modify them. This issue will also affect you on Vista.