寻找有关“正确”的文档在 Windows 7 上安装应用程序的方法
我正在使用一些遗留应用程序(10-15 年),并试图找到有关在 Windows 7 上安装和运行它们(以及任何用户应用程序)的“正确”方法的指导,而无需完整的管理员权限。
换句话说,可执行文件/只读文件应该放在哪里,用户数据/读写文件应该放在哪里,注册表项应该放在哪里,以避免在安装和运行期间UAC和Windows 7文件/注册表虚拟化出现问题。运行时。
我似乎记得几年前,微软关于这个主题的白皮书,但现在找不到任何相关信息。我找到了有关用户端的信息(如何通过兼容性调整让旧版应用程序在 Windows 7 上运行),但没有找到有关开发人员端的信息(如何创建/安装应用程序以在 Windows 7 上正常运行)。
任何指向此类信息的指针将不胜感激。谢谢。
马克
I'm working with some legacy applications (10-15 years old), and am trying to find guidance on the "right" way to install and run them (and any user application) on Windows 7 without requiring full Admin privileges.
In other words, where executable/read-only should files go, where user-data/read-write should files go, where registry entries should go, to avoid issues with the UAC and Windows 7 file/registry virtualization during both installation and at run-time.
I seem to remember, years ago, a Microsoft white paper on this subject, but am unable to find any relevent information now. I have found information on the user side (how to get legacy applications to run on Windows 7 via compatibility tweaks), but none on the developer side (how to create/install applications to play nicely on Windows 7 natively).
Any pointers to such information would be most appreciated. Thanks.
Marc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在考虑Windows 徽标要求< /a>.
其次,您不应该写入任何需要管理权限的位置。
由于大多数应用程序忽略了徽标要求,并且在使用标准用户权限运行时会失败,因此 Windows Vista 提供了通过虚拟化对受保护位置的写入来使这些有缺陷的应用程序保持跛行的功能,而不是让它们失败。
您可以通过将您的应用程序显示为 RunAs Invoker 来选择退出此兼容黑客:
徽标指南讨论了 UAC 和对某些位置写入的虚拟化:
然后是高 dpi。十年来的 Windows 徽标要求要求应用程序能够对高(即非 96dpi)显示器做出适当的响应。由于如果用户确实使用“大字体”,大多数应用程序都会严重崩溃,因此微软放弃了,并且像文件系统的虚拟化一样,他们也虚拟化了 dpi 设置。除非应用程序选择退出兼容性破解:Windows 会欺骗您并告诉您您的分辨率是 96dpi。
只有正确编写应用程序后,才应在应用程序清单中添加一个条目以禁用高 dpi 缩放:
无论如何,一切都在那里,Windows 7 客户端软件徽标计划。
注意:如果您在 15 年前(1995 年)编写 Windows 应用程序,我假设您正在为以下操作系统编写:
而不是:
值得注意的是,Windows NT 被设计为一个安全操作系统。你不可以随意做任何你想做的事。 有着根本的区别
这与没有安全性的
。写入 Windows 和 Program Files 文件夹需要管理员权限。这是因为通常只有管理员才应该安装应用程序。但普通用户无法修改或损坏已安装的程序 - 或 Windows 本身的安装,例如:
You're thinking of the Windows Logo Requirements.
Next is that fact that you should not be writing to any location that requires administrative permissions.
Since most applications ignored the logo requirements, and would fail when run with standard user privileges, Windows Vista included the ability to keep these buggy applications limping along by virtualizing writes to protected locations - rather than having them fail.
You can opt out of this compatibly hack by manifesting your application to RunAs Invoker:
The logo guidelines talk about UAC and virtualization of writes to certain locations:
Then there was high-dpi. The Windows Logo requirements for a decade has required applications to respond appropriately to high (i.e. non-96dpi) displays. Since most applications break horribly if the user does use "Large Fonts", Microsoft gave up and, like virtualization of the file system, they also virtualize the dpi setting. Unless an application opts out of the compatibility hack: Windows will lie to you and tell you that you are 96dpi.
Only once you've written your app properly should you add an entry to your application's manifest to disable high-dpi scaling:
Anyway, it's all there, the Windows 7 Client Software Logo Program.
Note: If you were writing a Windows application 15 years ago (1995) i assume you were writing for:
rather than:
It's important to note that Windows NT was designed as a secure operating system. You are not allowed to arbitrarily do anything you want. This is a fundamental difference from:
which had no security.
Writes to the Windows and Program Files folder requires administrator permission. This is because normally only administrators should install applications. But it regular users cannot modify, or damage, installed programs - or the installation of Windows itself, e.g.:
Windows 7 培训套件中有很大一部分内容涉及应用程序兼容性,包括与 UAC 的良好配合、安装到正确的文件夹等。
http://www.microsoft.com/downloads/en/details.aspx?familyid=1C333F06-FADB-4D93-9C80- 402621C600E7&displaylang=en
如果您还希望使用 Windows 7 的新功能,而不仅仅是让您的应用程序兼容,那么该套件中的很多内容都可以提供帮助。
The Windows 7 Training Kit has a big section on application compatibility, including playing nicely with UAC, installing to the proper folders, etc.
http://www.microsoft.com/downloads/en/details.aspx?familyid=1C333F06-FADB-4D93-9C80-402621C600E7&displaylang=en
If you are also looking to use the new features of Windows 7 and not just get your app compatible, there's a lot in the kit that can help.