.exe 不是 Windows XP 上的有效 Win32 应用程序 [英] .exe is not a valid Win32 application on Windows XP

查看:39
本文介绍了.exe 不是 Windows XP 上的有效 Win32 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Visual Studio 2012 Professional 并使用高级安装程序(第 3 方)创建安装程序.

I'm using Visual Studio 2012 Professional and creating an installer by using Advanced installer (3rd party).

当我在 Windows XP 上运行已安装的 .exe 时,我收到以下消息:

When I run the installed .exe on Windows XP, I get the following message:

.exe 不是有效的 Win32 应用程序.

<appName>.exe is not a valid Win32 application.

安装的可执行文件在 Windows 7 和 8 上都可以正常工作.

The installed executable works fine on both Windows 7 and 8.

如何让程序在 Windows XP 上运行?

How can I get the program to work on Windows XP?

推荐答案

从 Visual Studio 命令提示符,运行以下命令:

From the Visual Studio Command Prompt, run this command:

 Dumpbin.exe /headers c:\where\you\put\it\setup.exe

其中setup.exe"是安装程序创建者创建的安装 EXE.我将在此处发布您看到的重要信息示例:

Where "setup.exe" is the setup EXE created by your installer creator. I'll post an example of the info you see that matters here:

OPTIONAL HEADER VALUES
             10B magic # (PE32)
            ...
            4.00 operating system version
            0.00 image version
            6.00 subsystem version              // <=== here!!
               0 Win32 version
            ...

子系统版本号很重要.VS2012 是第一个开始将此值设置为 6.00(Vista 的版本号)的 Visual Studio 版本.以前的版本以及面向 .NET 4.0 或更早版本的 VS2012 都会将此版本号设置为 4.00

The subsystem version number is important. VS2012 is the first version of Visual Studio that started setting this value to 6.00, the version number of Vista. Previous versions, as well as VS2012 when you target .NET 4.0 or earlier, will set this version number to 4.00

否则,这是一项重要的进展,也是逐步取消对 XP 支持的一部分.Windows 6.00 及以上版本,Vista、Win7 和 Win8 会注意这个数字.他们会假设您的程序不知道以后的 Windows 功能,并且需要打开多个 appcompat 垫片.最引人注目的是 Aero 中的 appcompat,这是一种桌面主题,它显示带有易于用鼠标单击的粗边框的窗口.Windows 会在这些边界周围撒谎,告诉您您的窗口比实际小.对于试图使窗口彼此对齐的程序员来说,这是一个很大的困惑来源.

This is otherwise an important move ahead and part of phasing out support for XP. Windows version 6.00 and up, Vista, Win7 and Win8 pay attention to this number. They'll assume that your program is unaware of later Windows features and needs to have several appcompat shims turned on. The most notable one is appcompat in Aero, the desktop theme that displays windows with fat borders that are easy to click with a mouse. Windows will lie about those borders, telling you that your window is smaller than it actually is. A great source of confusion to programmers that try to make windows line up with each other.

看到显示 6.00 的后果是您的安装程序无法再在 XP 上运行.它是 5.02 版本.

The consequence of seeing 6.00 displayed is that your setup program cannot run on XP anymore. It is version 5.02.

因此请先确保您针对 .NET 4.5 版,它不适用于 XP.请改用 4.0.如果您仍然遇到问题,请联系供应商的支持并询问他们如何控制该工具创建的 setup.exe 文件中的该数字.解决方法是运行带有/SUBSYSTEM 选项的 Editbin.exe 以更改编号.

So do make sure first that you do not target .NET version 4.5, it is not available for XP. Use 4.0 instead. If you still have trouble then contact the vendor's support and ask them how to control that number in the setup.exe file that the tool creates. A workaround is to run Editbin.exe with the /SUBSYSTEM option to change the number.

这篇关于.exe 不是 Windows XP 上的有效 Win32 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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