SXSの問題なしでWindows PC上で単に解凍して実行することができるアプリケーションはどのようにしていますか?

StackOverflow https://stackoverflow.com/questions/6031066

質問

特定のグループからの共通の苦情であることは、ファイルシステムとレジストリ全てのものをすべてスプレッションし、一部のアプリは単にファイルを解凍するために単に削除することができるようにオプションを提供します。しかし、彼らはどのようにしてVisual C ++ Redist、並列(SXS)などのすべての醜さを避けますか?

私は少しのユーティリティを持っています、そして本当に私はRun - Single .exeだけを配布することをお勧めします - インストーラはまったく、あるいはそれが小さいため、すなわち解凍さえしていません。これは実現可能ですか?

編集: 提案されているように、私は実行時間(/ MTの代わりに/ mt)に静的依存性を持って構築してみました。私は以下を手に入れました(中央部品が明快さに切り捨てられた):

1>Linking...
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: __mbschr already defined in LIBCMT.lib(mbschr.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _realloc already defined in LIBCMT.lib(realloc.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: __strdup already defined in LIBCMT.lib(strdup.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _abort already defined in LIBCMT.lib(abort.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: __stricmp already defined in LIBCMT.lib(stricmp.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _setlocale already defined in LIBCMT.lib(setlocal.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
.

役に立ちましたか?

解決

You can distribute a single EXE if you statically link to the VC runtime - on the project's Property Page -> Configuration Properties -> C/C++ -> Code Generation and set "Runtime Library" to a "non-dll" option.

Depending on your target audience, distributing as a .exe may be problematic as .exe files are sometimes blocked from downloading in corporate environments, so providing a .zip file as well is advisable.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top