编译需要管理员的点击一次应用程序?

发布于 2024-09-02 23:52:01 字数 437 浏览 4 评论 0原文

我的很多程序都需要能够将文件写入硬盘。当我第一次为 XP 编写这些程序时,它们运行得很好。现在我对UAC不再那么无知了(最近买了一台新笔记本电脑)。对于未来的客户...我注意到可能会出现很多烦人的错误消息...并且坦率地说,如果程序无法将数据写入其所在的硬盘驱动器或拇指驱动器...那就没有意义运行它......

我已经多次尝试在清单中构建对管理员或用户访问权限的要求......我不确定是否可以解决问题......但失败了,因为单击-一旦有安全功能来阻止我这样做。

我宁愿不必告诉我的客户如何通过编辑文件的属性来使程序以管理员身份运行...我更愿意有一个方便的弹出窗口,就像您在 Itunes 或 Filezilla 等新程序中看到的那样显示它们是否与请求其所需权限的 UAC 发生冲突。

我真的很想这样做,但收效甚微。

任何和所有可以解决这个严重问题的建议都值得赞赏。

谢谢。

A lot of my programs require the ability to write files to the hard drive. When I first made these programs for XP they worked great. Now I'm less ignorant about UAC (got a new laptop recently). And for future customers...I've noticed the potential for a LOT of annoying error messages....and quite frankly if the program can't write data to the hard drive or thumb drive it's on...there's no point to running it....

I've tried multiple times to build in the manifest a requirement for administrator or user access....I'm not sure if anything less would solve the problem...but have failed because click-once has security features in place to prevent me from doing so.

I'd rather not have to tell my customers how to make the program run as an administrator by editing the file's properties...I'd much rather have a convenient pop up like what you'd see new programs such as Itunes or Filezilla show if they were in conflict with UAC requesting the privileges they need.

I'd really like to do this but have had little success.

Any and all advice that can remedy this grievous problem appreciated.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

君勿笑 2024-09-09 23:52:01

首先,我告诉您,ClickOnce 部署的设计目标是不需要管理权限。这意味着“运行 ClickOnce 应用程序时无法提升权限”。

当 Windows Vista 推出时,Microsoft 发布了有关在何处存储您希望能够更新的文件的指南。程序文件中不应放置任何内容;他们通常推荐 LocalApplicationData 或独立存储。 Windows 7 也存在同样的问题。

那么您尝试为客户在哪里写入数据呢?

First, let me tell you that the design goal of ClickOnce deployment is not to require administrative privileges. This translates into "you can't elevate privileges when running a ClickOnce application".

When Windows Vista came out, Microsoft published guidelines on where to store files that you want to be able to update. NOTHING should be placed in Program Files; they generally recommend LocalApplicationData or Isolated Storage. The same issues are in place for Windows 7.

So where are you trying to write data for your customer?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文