Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create copy of exe with different resource at runtime

Tags:

c#

.net

exe

We'd like to offer our client the ability to make customised exes, based on ours, for their clients.

ie, basically the ability to make a copy of an exe with a different xml configuration file embedded in it. The "include it in the install" is not an option - we want this to look as if it was custom made for our client's clients.

I'm currently thinking of writing a dll at runtime including the resource (using an AssemblyBuilder), and then calling ILMerge to embed it in the final exe, but this is slightly more hackish than I would like.

So it's a tall-ask, but perhaps worth asking anyway: is there a .NET library which allows modifying a .NET exe's resources which could avoid the whole "dll holding a resource embedded by ILMerge" bit?

Or alternatively, is there a better approach to this which still meets the stated goals?

like image 684
Mania Avatar asked Mar 19 '12 12:03

Mania


1 Answers

Sounds like alot of work to replace it once its already compiled. I would do it with a build script, a param, and different resource files.

like image 151
Micah Armantrout Avatar answered Oct 17 '22 13:10

Micah Armantrout