Running 32 bit exe on 64 bit windows

Running 32-bit Applications

WOW64 is the x86 emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows. This allows for 32-bit (x86) Windows applications to run seamlessly in 64-bit (x64) Windows, as well as for 32-bit (x86) and 32-bit (ARM) Windows applications to run seamlessly in 64-bit (ARM64) Windows. WOW64 is provided with the operating system and does not have to be explicitly enabled. For more information, see WOW64 Implementation Details.

The system isolates 32-bit applications from 64-bit applications, which includes preventing file and registry collisions. Console, GUI, and service applications are supported. The system provides interoperability across the 32/64 boundary for scenarios such as cut and paste and COM. However, 32-bit processes cannot load 64-bit DLLs for execution, and 64-bit processes cannot load 32-bit DLLs for execution. This restriction does not apply to DLLs loaded as data files or image resource files; for more information, see LoadLibraryEx.

A 32-bit application can detect whether it is running under WOW64 by calling the IsWow64Process function (use IsWow64Process2 if targeting WindowsВ 10). The application can obtain additional information about the processor by using the GetNativeSystemInfo function.

Note that 64-bit Windows does not support running 16-bit Windows-based applications. The primary reason is that handles have 32 significant bits on 64-bit Windows. Therefore, handles cannot be truncated and passed to 16-bit applications without loss of data. Attempts to launch 16-bit applications fail with the following error: ERROR_BAD_EXE_FORMAT.

Install and Run 32-bit Programs on 64-bit Windows 7/8 and 10

Most of the time you will be having the 64-bit version of Windows 8.1 or Windows 10 (sometimes Windows 7 as well) if you have purchased the computer recently. If you have a program/app that is 32-bit, how to install 32-bit programs on 64-bit Windows? Follow this simple guide.

The truth is, the latest Windows 64-bit versions support 32-bit of application nicely without any issues. You can install and use them. But remember, you can’t install the 64-bit Programs on 32-bit Operating System like Windows 7 32-bit.

Run 32-bit Programs on 64-bit Windows

When you install the 32-bit application on 64-bit based OS, it creates a separate folder in root drive, called ‘Program Files (x86)’ and copy the all files required to run the program. So next time when you open the 32-bit program it accesses the executable program file from Program Files (x86) folder and runs without any issue with 64-bit Windows 7.

Читайте также:  Настройка двух мониторов mac os

Also, 32-bit programs system files are installed into C:\ \WINDOWS\ \SysWOW64,

and registry keys are placed under HKEY_LOCAL_MACHINE\ \Software\ \WOW6432Node of 32-bit programs.

How to Identify the Version of the Program (64 or 32-bit) in Windows

You can identify the type of the programs by the location of the executable folder. If it placed under the 32-bit version of Program folder, then it is a 32-bit version of the program, another one is the 64-bit version on a 64-bit Windows OS.

Also, the task manager is another great place where you can find the version of the running programs. Open the task manager and click on the Processes where you are can see the all processes related to currently running programs. On 64-bit OS (in my case it is Windows 10), the 32-bit programs shown below. Other ones (which doesn’t have 32 Bit) are 64-bit applications on the computer.

In some cases, you may need to run the 32-bit version of applications/tools without installing them. Usually double-clicking the EXE file will open the application without any issues. If you face any issues, you can move these EXE files to Program folder inside Program Files (x86) folder in your root drive, then create a shortcut to the desktop to execute the program whenever wanted.

Hope this guide is useful to some extent to install and use 32-bit Programs on 64-bit Windows 7/8 and 10.

How to run a 32-bit .NET application in a 64-bit environment?

We developed a C# application using the .NET Framework 2.0 which works fine in 32-bit computers. But when I run my application in a 64-bit environment, it crashes.

I need to make my application to run in 64-bit environment.

How do I do this?

8 Answers 8

You could compile it for x86 instead of any cpu that way it will run against 32bit librarys on a 64bit windows.

Or swap 32bit librarys for 64bit when installning on 64bit windows. Among other some Sqlite dlls are specific for 32/64 bit

If you are on Windows you shall use CorFlags Conversion Tool (CorFlags.exe). This way you might enforce application/dll’s to run in 32/64 bit space. Details and examples of use are available at http://msdn.microsoft.com/en-us/library/ms164699(VS.80).aspx.

In the build settings for you project set the platform target to x86 instead of Any CPU. This will solve problems where your project has «hidden» dependendencies on 32 bit subsystems that are not available in 64 bit. Your application will then run in the 32 bit susbsystem on 64 bit Windows.

Читайте также:  Как перезагрузить windows жесткого диска

Here is what looks to be a nice solution if you are looking to avoid recompilation. Note it does require a change to each target machine.

If you have a 64 bit machine and want to run a .NET application that only works with the 32 bit CLR you would have to make changes to the .NET framework on your machine

Set the .NET framework to load the CLR in WOW mode through this command

Open up command prompt and type this command

Now you should be able to run apps that use only the .NET 32 bit CLR.

To revert back to the default 64 bit framework run

How can I run an exe in 32-bit mode on a 64-bit machine?

I have an executable that works fine when run on 32-bit windows but breaks when run on 64-bit windows.

Is there some way I can force it to run in 32-bit mode on a 64-bit machine?

I don’t have access to the source code.

4 Answers 4

How technical an answer do you want? You can probably force the exe to always run 32bit with a few SDK tools, but it does require a little work.

The easy answer is to launch from a 32bit process (eg. use %SystemRoot%\SYSWOW64\cmd.exe to launch).

The more complex is to check what kind of exe it is, then modify it yourself. Background here is to understand that compiled code from languages that directly work with the Windows APIs are created as 32bit or 64bit at compile time by the developer. This cannot then be changed without going back to the source code.

However increasingly applications are written via a virtualisation layer that makes writing applications easier. There are two common ones: .NET and Java. I’m not sure about Java except knowing that forcing the right Java runtime install with solve the problem.

For .NET you can use SDK tools to:

  • Validate that the application is «AnyCPU»: corflags myExe.exe . Using a utility from the .NET SDK to read the headers of a .NET assembly, for an exe will return something like:

the 32BITREQ tells me this is AnyCPU because 32bit is not required.

  • Use corflags with its /32BITREQ+ option to modify the exe to be 32bit only.

Create 32-bit exe’s from python code on 64-bit machine

I have already created a 64-bit program for windows using cx freeze on a 64-bit machine. I am using Windows 7 64-bit Home premium. py2exe is not working because as i understand it does not work with python 3.2.2 yet. Is there an option i have to specify in cx freeze to compile in 32-bit instead of 64-bit.

Читайте также:  Windows 10 лицензия для физических лиц

3 Answers 3

To produce 32 bit executables you need to install 32-bit versions of Python and cx_freeze.

In addition to the answers already given:

  1. To compile/freeze python code for different architectures (x86/x64), install both, x86 and x64 versions of python, to your system and corresponding variations of all required modules and libraries to your python installations so both installations have the same (required) set of packages installed.
  2. The next step is to check that your global OS environment is configuredcorrectly. The following Windows environment variables need to point to the appropriate installation of Python you want to freeze to, You should know which locations they need to point to:
    • %PATH%
    • %PYTHONHOME%
    • %PYTHONPATH%
  3. Once you’ve set them up properly, re-open any terminals to make sure you’ve got the new environment loaded (re-login to your Windows session if necessary to properly refresh your environment) and you are ready to run your cx_freeze and any other python-related build ops to get your final builds for that architecture.
  4. Once done with those builds, re-run the process from step 2. to change your Windows environment to the next python installation and build.

To speed up the environment-change process I either script those steps or use a VM.

Hope this helps.

All the «produce an executable from Python code» methods I know of basically create a file that bundles up the Python interpreter with the Python code you want to execute inside a single file. It is nothing at all like compiling C code to an executable; Python is just about impossible to compile to machine code in any significantly more useful way than just gluing the Python bytecode to the machine code for a Python interpreter.

So that’s almost certainly why you can’t produce a 32 bit exe from a 64 bit installation of Python; there isn’t a 32 bit interpreter to embed in the output file.

Not the answer you’re looking for? Browse other questions tagged python or ask your own question.

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Оцените статью