将 exe + dll 打包成一个可执行文件(不是 .NET) [英] Packing an exe + dll into one executable (not .NET)

查看:26
本文介绍了将 exe + dll 打包成一个可执行文件(不是 .NET)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<块引用>

可能的重复:
如何合并C++ windows dll进入 C# 应用程序 exe?

有人知道可以将多个 DLL 和一个 .EXE 打包成一个可执行文件的程序吗?我在这里不是在谈论 .NET 案例,我是在谈论通用 DLL,其中一些是我用 C++ 生成的,其他一些是我无法控制的外部 DLL.

我的具体案例是一个用py2exe打包的python程序,我想通过打包来隐藏"另一个DLL.不过这个问题很笼统.

看过的东西:

  • ILMerge:特定于 .NET
  • NETZ:特定于 .NET
  • UPX:进行 DLL 压缩,但不进行多个 DLL + EXE 打包
  • FileJoiner:
<块引用>差点就搞定了.它可以将可执行文件和任何内容打包到一个 exe 文件中,但是当打开时,它将为每个打包的文件启动默认的打开程序.因此,如果用户用户 dlldepend 已安装,它将启动它(因为这是默认的 dll 开启程序).

也许这不可能?

<小时>

答案摘要:

DLL 的打开是由操作系统管理的,所以将 DLL 打包成可执行文件意味着在某些时候,它们需要被提取到操作系统可以找到它们的地方.没有灵丹妙药.

所以,我想要的是不可能的.

除非……

我们更改了操作系统中的某些内容.感谢 Conrad 向我指出 ThinInstall,它虚拟化了应用程序和操作系统加载机制.使用 ThinInstall,可以将所有内容打包到一个 exe 文件中(DLL、注册表设置等).

解决方案

查看 Thinstall ThinApp

Possible Duplicate:
How can a C++ windows dll be merged into a C# application exe?

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:

Almost got it. It can pack executable + anything into one exe but when opened, it will launch the default opener for every file that was packed. So, if the user user dlldepend installed, it will launch it (becaues that's the default dll opener).

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 Thinstall ThinApp

这篇关于将 exe + dll 打包成一个可执行文件(不是 .NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆