Click here to Skip to main content
15,887,928 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionStandalone .NET framework exe Pin
LostTime7720-Jul-13 6:26
LostTime7720-Jul-13 6:26 
AnswerRe: Standalone .NET framework exe Pin
Dave Kreskowiak20-Jul-13 7:26
mveDave Kreskowiak20-Jul-13 7:26 
GeneralRe: Standalone .NET framework exe Pin
LostTime7620-Jul-13 8:01
LostTime7620-Jul-13 8:01 
GeneralRe: Standalone .NET framework exe Pin
LostTime7620-Jul-13 8:22
LostTime7620-Jul-13 8:22 
GeneralRe: Standalone .NET framework exe Pin
Dave Kreskowiak20-Jul-13 9:48
mveDave Kreskowiak20-Jul-13 9:48 
GeneralRe: Standalone .NET framework exe Pin
LostTime7620-Jul-13 10:26
LostTime7620-Jul-13 10:26 
GeneralRe: Standalone .NET framework exe Pin
Dave Kreskowiak20-Jul-13 10:36
mveDave Kreskowiak20-Jul-13 10:36 
GeneralRe: Standalone .NET framework exe Pin
LostTime7620-Jul-13 11:33
LostTime7620-Jul-13 11:33 
I might be able to relax my requirement of no files on the file system. After looking at how windows actually locates DLL files, it first looks in a known DLL directory (system32 for example). Then it looks in the directory that the process was executed from, etc.. What I am thinking is that if I just package all the required DLLs and plop them into the directory as hidden files or something, windows will be able to locate all the DLLs required for the runtime. Next, after peering into how the clr loads, we have some registry keys to sort out. Adding keys to the registry is very easy to do. As far as I can tell, the important key is the install location for .NET for the clr to load the .NET libraries it needs. We can point that to just about anywhere in the key.

So to summarize, We find all the required dll's via trial and error then we zip them up to make the resulting exe small. We package the zip as a resource. The exe itself will be a clr hosting shim. If the system does not have .NET X.X installed, we unzip the zip resource, copy those files to the local folder, and install the registry keys .NET requires. The program then just runs as if the .NET framework were installed. Of course, we can make the program fairly robust making sure all the known files are on disk, locking them while in use, etc. etc.. using the native C++ shim.

This seems like an extremely easy option to package our exe as a "standalone" exe. The resulting exe should not be very big either, considering the metric that I found earlier.
GeneralRe: Standalone .NET framework exe Pin
Dave Kreskowiak21-Jul-13 3:24
mveDave Kreskowiak21-Jul-13 3:24 
GeneralRe: Standalone .NET framework exe Pin
LostTime7621-Jul-13 5:33
LostTime7621-Jul-13 5:33 
GeneralRe: Standalone .NET framework exe Pin
Dave Kreskowiak21-Jul-13 6:03
mveDave Kreskowiak21-Jul-13 6:03 
GeneralRe: Standalone .NET framework exe Pin
LostTime7621-Jul-13 6:09
LostTime7621-Jul-13 6:09 
GeneralRe: Standalone .NET framework exe Pin
Dave Kreskowiak21-Jul-13 10:57
mveDave Kreskowiak21-Jul-13 10:57 
GeneralRe: Standalone .NET framework exe Pin
LostTime7621-Jul-13 13:32
LostTime7621-Jul-13 13:32 
GeneralRe: Standalone .NET framework exe Pin
Dave Kreskowiak21-Jul-13 14:53
mveDave Kreskowiak21-Jul-13 14:53 
GeneralRe: Standalone .NET framework exe Pin
LostTime7621-Jul-13 15:05
LostTime7621-Jul-13 15:05 
GeneralRe: Standalone .NET framework exe Pin
Dave Kreskowiak22-Jul-13 1:50
mveDave Kreskowiak22-Jul-13 1:50 
GeneralRe: Standalone .NET framework exe Pin
LostTime764-Aug-13 9:22
LostTime764-Aug-13 9:22 
GeneralRe: Standalone .NET framework exe Pin
Pete O'Hanlon4-Aug-13 9:51
mvePete O'Hanlon4-Aug-13 9:51 
GeneralRe: Standalone .NET framework exe Pin
LostTime764-Aug-13 10:19
LostTime764-Aug-13 10:19 
GeneralRe: Standalone .NET framework exe Pin
Dave Kreskowiak20-Jul-13 9:47
mveDave Kreskowiak20-Jul-13 9:47 
GeneralRe: Standalone .NET framework exe Pin
LostTime7620-Jul-13 10:30
LostTime7620-Jul-13 10:30 
GeneralRe: Standalone .NET framework exe Pin
Dave Kreskowiak20-Jul-13 10:38
mveDave Kreskowiak20-Jul-13 10:38 
GeneralRe: Standalone .NET framework exe Pin
LostTime7620-Jul-13 11:01
LostTime7620-Jul-13 11:01 
AnswerRe: Standalone .NET framework exe Pin
Eddy Vluggen20-Jul-13 23:36
professionalEddy Vluggen20-Jul-13 23:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.