开发者

Portable Windows application (not the source code!) with Visual C++ 2005/2008/2010?

开发者 https://www.devze.com 2023-02-22 20:56 出处:网络
I don\'t mean \"portable\" in a way that you can re-compile the source code under Linux or whatever, but rather a Windows-only application that does not require installation, so you just put the .exe

I don't mean "portable" in a way that you can re-compile the source code under Linux or whatever, but rather a Windows-only application that does not require installation, so you just put the .exe and some dll-s in a folder and copy it to another machine and it works.

It didn't require any effort at all with VS 2003 and earlier, but with 2008 putting the missing dll-s into same folder doesn't work, it requires installing re-distributables. I remember hearing that the p开发者_JAVA百科roblem can be solved with manifests, which I have never encountered before.

So, how can I do that?


Link with static libraries for CRT, MFC, and anything else you use. Make sure you don't use Win32 APIs that were introduced in Vista or Win7 (i.e., keep WIN32_WINNT <= 0x501). Use Dependency Walker to ensure that your executable only imports kernel32, user32, gdi32, or other things that are guaranteed to be in a default windows install.


What about statically linking the c runtime? Your resulting executable will be bigger though.


Also look at the backward binary compatibility reports for all interested versions of Windows: https://abi-laboratory.pro/index.php?view=windows

And check if your binaries/dlls import any of the removed/changed symbols.

The reports have been generated by the abi-compliance-checker tool.

Portable Windows application (not the source code!) with Visual C++ 2005/2008/2010?

0

精彩评论

暂无评论...
验证码 换一张
取 消