yohhoyの日記

技術的メモをしていきたい日記

VisualStudio11作成アプリをWinXP上で動作させるHACK

2012-11-29追記:2012年11月リリース"Visual Studio 2012 Update 1"により、Visual Studio 2012(MSVC11)でもWindows XP上で動作可能なアプリケーションを作成可能となった。
MSDN Blog - Visual Studio 2012 の Update 1 がご利用いただけるようになりました。


Visual Studio 11 (Beta)で作成されたアプリケーションについて、Windows XP上では動作しないとMicrosoftより公式回答されている。

This behavior is by design in MFC and CRT for Visual Studio 11 Beta. The minimum supported operating systems are Windows Server 2008 SP2 and Windows Vista. Windows XP is not a supported operating system for the Beta release (design-time or run-time).

http://connect.microsoft.com/VisualStudio/feedback/details/690617

…それでもWinXP上で動作させたい人のための強引なHACKが公開されていた。
How to get Visual C++ 2012 (VC 11 Beta) statically linked CRT and MFC applications to run on Windows XP | Ted's Blog

Simplified 4 step summary of solution:
(1) Add assembly language support to your existing project
(2) Add 4 files that I wrote that "wrap" the missing CRT and MFC functions (downloadable from my skydrive). You only need 2 of these files if your app is not using MFC.
(3) Add a post-build event that runs a small command line utility that sets the version your built app.
(4) Build your app, copy to XP and run it

2012-09-13追記:Targeting Windows XP with C++ in Visual Studio 2012 | Visual C++ Team Blogによれば、"Later this fall, Microsoft will provide an update to Visual Studio 2012 that will enable C++ applications to target Windows XP."と公式アナウンスがされている。

2012-10-09追記:Windows XP Targeting with C++ in Visual Studio 2012 | Visual C++ Team Blogによれば、Visual Studio 2012 Update 1にてWindows XPが正式サポートされる。(同記事はCTP版リリースアナウンス)