How to bind 64-bit and 32-bit executable into one?

后端 未结 2 1169
半阙折子戏
半阙折子戏 2020-12-19 05:48

Alright so my idea was some way to bind both 64-bit and 32-bit Windows executables into one application so if it doesn\'t run the 64-bit version it would then try the 32-bit

相关标签:
2条回答
  • 2020-12-19 06:02

    You could not create a single executable file, containing both x86 and x64 code. However you could create separate 32bit and 64bit applications, pack x64 app into the x86 app resources. On the program start you could check, that you are running x64 environment using IsWow64Process then if needed, unpack your x64 version and run it instead

    0 讨论(0)
  • 2020-12-19 06:06

    There are fat binaries in MacOS, Linux and DOS (or hybrid DOS-Windows) but not 32 and 64-bit Windows

    You can compile separate versions of the program and then select by a script of another executable

    Another way is installing only the desired version at install time. This is used by many programs like CCleaner. The installer is a 32-bit app or a universal one like .NET so that it can run anywhere. If it detects 64-bit Windows then it only install 64-bit version, same to 32-bit version.

    Read more:

    • Universal binary
    • Windows 8 fat binary (exe for x86 & ARM)
    • Windows NT has always been a multi-platform OS, but the binaries are not
    0 讨论(0)
提交回复
热议问题