将 XP 上编写的 Windows 应用程序转换为 Windows 7

发布于 2024-09-30 04:50:26 字数 233 浏览 11 评论 0原文

我继承了一个巨大的代码库,该代码库是为在 Windows XP 上运行而编写的。现在我们想迁移到 Windows 7。我不知道正确的方法是什么。完成上述任务的正确方法是什么?我在谷歌上搜索了 XP 和 Windows 7 之间的差异,但没有得到任何正确的链接来描述 7 的内部结构与 XP 有何不同。任何链接将不胜感激。

通常,软件开发人员如何将他们为一种操作系统版本(例如 Vista)编写的代码/应用程序迁移到 Windows 7?

I inherited a huge code base which was written to work on Windows XP. Now we would like to migrate to Windows 7. I do not know what is the proper way to go about this. What is the proper approach to do the above task? I did some googling on differences between XP and Windows 7 but I do not get any proper links which describe how the internals of 7 differ from XP. Any links will be appreciated.

Usually how do S/W developers migrate their code/apps written for one version of OS say Vista to Windows 7?

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

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

发布评论

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

评论(4

树深时见影 2024-10-07 04:50:26

我销售自动更新解决方案(AutoUpdate+,小插件),因此拥有将 Windows 应用程序移植到最新版本的丰富经验,但仍保持向后兼容性。从 Windows XP 移植到 Windows 7 可能是一个巨大的挑战(从 Windows Vista 移植到 Windows 7 几乎没有什么区别)。

Window XP 不关心应用程序存在的位置,因此程序员会将其应用程序和支持逻辑(日志文件、配置文件、用户配置文件等)转储到“C:\Program Files\”下的同一位置。将此应用程序带到 Windows 7 中,您将开始发现一些异常行为。首先,您会注意到文件似乎“消失”了。您最终可能会在“兼容性/程序文件”下为每个用户获得多个单独的副本,而不是在公共程序文件位置下修改日志文件。 Windows Vista/7引入了文件系统虚拟化,现在将创建单独的用户文件实例,以确保每个用户都有自己的安全副本。

您在 Windows Vista 上会遇到的另一个问题(在 Windows 7 上遇到的程度较小)是用户帐户控制 (UAC) 提示。它与上述问题类似,因为新的安全限制现在将导致 Windows Vista/7 提示用户批准继续。发生这种情况的最明显的区域是当您篡改敏感目录中的可执行文件、安装应用程序和驱动程序时,有时甚至在尝试自我更新应用程序时(上述应用程序实际上通过一些智能逻辑来解决这些提示)。

所以简而言之,安全性的改变是Windows XP和Windows Vista/7之间最大的区别。最好的开始是将应用程序逻辑(二进制文件)与支持逻辑分开,将后者放入用户特定的目录中。某些应用程序可能永远无法修复,可以强制在兼容模式下工作或始终在管理员帐户上下文下启动——虽然解决​​方法很差,但可能适合您的公司。

西蒙 @ http://AutoUpdatePlus.com

I sell an autoupdate solution (AutoUpdate+, minor plug) and so have lots of experience porting Windows apps to the latest releases, and yet still maintaining backwards compatibility. Porting from Windows XP to Windows 7 can be a big challenge (there should be almost no difference in a move from Windows Vista to Window 7).

Window XP doesn't care where your application exists, and hence programmers would dump both their application and support logic (log files, config files, user profiles etc.) into the same location under "C:\Program Files\". Take this application to Windows 7 and you'll start finding some unusual behaviors. For starters, you will notice that files seem to 'disappear'. Instead of a log file being modified under the common Program Files location, you may end up with multiple, and separate, copies for each user under "Compatibility / Program Files". Windows Vista/7 introduced file system virtualization, and will now create separate user instances of files to ensure to ensure that each user has their own secure copy.

Another problem you will encounter on Windows Vista, and to a lesser extent on Windows 7, is User Account Control (UAC) prompts. It's similar to the issue above, in that new security restrictions will now cause Windows Vista/7 to prompt the user for approval to proceed. The most noticeable area where this occurs is when you are tampering with executable files in sensitive directories, installing applications and drivers, and sometimes when trying to self-update an app (the abovementioned app actually works around these prompts with some smart logic).

So in short, security changes are the biggest difference between Windows XP and Windows Vista/7. Your best start is to separate application logic (binaries) from supporting logic, by putting the latter into user specific directories. Some apps may never be fixable and can be forced instead to work in Compatibility Mode or to launch always under the Admin account context --- poor workarounds, but may be suitable in your company.

Simon @ http://AutoUpdatePlus.com

情释 2024-10-07 04:50:26

迁移分为三个部分。首先,让它变得简单。这意味着修复硬编码的文件路径(不再有文档和设置),更改一些保存位置,这样您就不需要提升权限即可正常工作,并且不依赖虚拟化,更改一些注册表项位置同样的原因,以及应对高 DPI,现在可能会根据屏幕尺寸自动应用,而不是作为用户的选择。

其次,使其看起来和工作起来都像 Windows 7 应用程序。你的跳转列表可以用吗?你的缩略图?您免费获得一些东西,您喜欢您所获得的东西还是想要掌控一切?您是否可以使用明显的优势,例如缩略图按钮、跳转列表任务、任务栏覆盖层等。不要让您的用户感到惊讶,也不要让您的用户失望。 (令人失望的例子:VS 2008 及其提供的糟糕的跳转列表。他们有借口在 Windows 7 之前发布 - 但你没有。)

第三,充分利用 Windows 7,让 Windows 7 变得更加强大。停止轮询网络连接、文件创建、插入硬件、打开和关闭交流电源等,并了解如何在这些事情发生时收到通知。添加超出免费范围的触摸支持。首次与传感器或 GPS 对话,因为 Windows 7 使其变得比以往更加简单。诸如此类的事情。

1 不是可选的。 Windows 7 发布一年后,2.0 也确实不是可选的。 3 将使您与众不同,我建议,一旦您通过了 1 和 2,您就可以研究它。

There are three parts to the migration. First, make it just plain work. This means fixing up hardcoded file paths (there's no more Documents and Settings), changing some of your save locations so you don't need to be elevated to work properly and don't rely on virtualization, changing some of your registry key locations for the same reason, and coping with high-DPI which might now be applied automatically based on screen size rather than as a user's choice.

Second, make it look and work like a Windows 7 application. Is your jumplist usable? Your thumbnail? You get some things for free, do you like what you get or would you like to take control? Are there obvious wins you could use like thumbnail buttons, jumplist tasks, taskbar overlays, etc. Don't surprise your users and don't disappoint your users. (Example of disappointment: VS 2008 and the crummy jumplists it offered. They had the excuse of being released before Windows 7 - you don't.)

Third, take advantage of Windows 7 to be greater than you otherwise would. Stop polling for network joins, file creation, hardware being plugged in, going on and off AC power etc and learn how to get notified when those things happen. Add touch support beyond what you get for free. Talk to a sensor or GPS for the first time, since Windows 7 makes it simpler than it ever was. That sort of thing.

1 is not optional. 2 is really not optional either, a year after Windows 7 is released. 3 will differentiate you and I recommend, once you get past 1 and 2, you look into it.

瞳孔里扚悲伤 2024-10-07 04:50:26

基本上Windows7是一个4位操作系统,因此必须运行在64位处理器环境上。 XP 有 32 位和 4 位版本。如果您的应用程序适用于 32 位版本的 XP,在这种情况下,主要迁移意味着使应用程序能够有效地在 4 位操作系统上运行。

基本步骤可以是这样的:

  1. 使其兼容64位win7。所以你可以在 win7 机器(64 位)上编译代码。如果编译正常的话,也许可以成功运行应用。

  2. 第一步只是允许继续前进。但你的申请可能不会有效。在这种情况下,您可能必须检查 32 位操作系统上耦合的任何特定实现的代码,并升级它们以利用 64 位操作系统。

64 位操作系统的主要优点是更高的寻址能力(因此可以访问更多 RAM)以及缓存等。

Basically Windows7 is a 4bit OS and so necessarily runs on a 64bit processor environment. XP has 32bit as well as 4 bit flavours. If your application is for the 32bit version of XP, in that case, the major migration means making the application run on 4bit OS effectively.

The basic steps can be something like this:

  1. Make it compatible to 64bit win7. So you may just compile the code off a win7 machine (on 64bit). If the compilation works fine, you might be able to run the app successfully.

  2. The first step just allows to move ahead. But your application might not be effective. In that case, you might have to review the code for any specific implementation coupled on 32bit os and upgrade them to take advantage of 64bit OS.

The major advantages on 64bit OS is higher address-ability (so access more RAM) and also cache etc.

简单 2024-10-07 04:50:26

我在谷歌上搜索了 XP 和 Windows 7 之间的差异,但没有得到任何正确的链接来描述 7 的内部结构与 XP 有何不同。任何链接将不胜感激。

XP 和 Vista 之间的 API 差异报告: https://abi-laboratory .pro/compatibility/Windows_5.0_to_Windows_6.0/x86_64/abi_compat_report.html

Vista 和 7 之间的 API 差异报告:https://abi-laboratory.pro/compatibility/Windows_6.0_to_Windows_7.0/x86_64/abi_compat_report.html

报告由 <一个 href="https://github.com/lvc/abi-compliance-checker" rel="nofollow">abi-compliance-checker 工具。

输入图像描述这里

I did some googling on differences between XP and Windows 7 but I do not get any proper links which describe how the internals of 7 differ from XP. Any links will be appreciated.

API diff report between XP and Vista: https://abi-laboratory.pro/compatibility/Windows_5.0_to_Windows_6.0/x86_64/abi_compat_report.html

API diff report between Vista and 7: https://abi-laboratory.pro/compatibility/Windows_6.0_to_Windows_7.0/x86_64/abi_compat_report.html

The reports are generated by the abi-compliance-checker tool.

enter image description here

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