问题描述
可能的重复:
如何合并C++ windows dll进入 C# 应用程序 exe?
有人知道可以将多个 DLL 和一个 .EXE 打包成一个可执行文件的程序吗?我在这里不是在谈论 .NET 案例,我是在谈论通用 DLL,其中一些是我用 C++ 生成的,其他一些是我无法控制的外部 DLL.
我的具体案例是一个用py2exe打包的python程序,我想通过打包来隐藏"另一个DLL.不过这个问题很笼统.
看过的东西:
- ILMerge:特定于 .NET
- NETZ:特定于 .NET
- UPX:进行 DLL 压缩,但不进行多个 DLL + EXE 打包
- FileJoiner:
也许这不可能?
答案摘要:
DLL 的打开是由操作系统管理的,所以将 DLL 打包成可执行文件意味着在某些时候,它们需要被提取到操作系统可以找到它们的地方.没有灵丹妙药.
所以,我想要的是不可能的.
除非……
我们更改了操作系统中的某些内容.感谢 Conrad 向我指出 ThinInstall,它虚拟化了应用程序和操作系统加载机制.使用 ThinInstall,可以将所有内容打包到一个 exe 文件中(DLL、注册表设置等).
查看 ThinApp
Is anybody aware of a program that can pack several DLL and a .EXE into one executable. I am not talking about .NET case here, I am talking about general DLLs, some of which I generate in C++, some of others are external DLL I have no control over.
My specific case is a python program packaged with py2exe, where I would like to "hide" the other DLL by packing them. The question is general enough though.
The things that had a look at:
- ILMerge: specific to .NET
- NETZ: specific to .NET
- UPX: does DLL compression but not multiple DLL + EXE packing
- FileJoiner:
Maybe that's not possible ?
Summary of the answers:
DLL opening is managed by the OS, so packing DLL into executable means that at some point, they need to be extracted to a place where the OS can find them. No magic bullet.
So, what I want is not possible.
Unless...
We change something in the OS. Thanks Conrad for pointing me to ThinInstall, which virtualise the application and the OS loading mechanism. With ThinInstall, it is possible to pack everything in one exe (DLL, registry settings, ...).
Have a look at ThinApp
这篇关于将 exe + dll 打包成一个可执行文件(不是 .NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!