Embedded a *.exe into a dll

前端 未结 5 1478
一个人的身影
一个人的身影 2020-12-16 05:15

does somebody know how can I embedd an exe file into a dll ?

I have a tool which is an exe file that I call from c# code.

The thing is that I want to have 1

5条回答
  •  轮回少年
    2020-12-16 05:31

    On a side note, remember that when you pull a file from your resources to disk and then execute code on it, you may trigger Windows Data Execution Prevention - basically, Windows tries to automatically detect if something is supposed to be code or data, and if it looks like data (which a resource would), then it will prevent that data from being executed as code.

    This becomes a particularly sticky issue if your .NET assembly is going to be used over a network instead of from a local drive - there are all sorts of .NET security configurations that might prevent this from working correctly.

    Another option, and not knowing the details of your project, take this with a grain of salt: add a .exe.readme file to your install that describes to any curious users or IT people why there is an executable they weren't expecting in the installation directory :)

提交回复
热议问题