Reputation: 3
I have one EXE (built in .Net) running on windows. When it runs, it'd get another EXE from server and execute under that same process. Using Process.Start I can execute the server EXE after dowloading but that'd start a new process with an extra step of downloading the EXE residing on the server. But I wanted a better solution.
Upvotes: 0
Views: 2417
Reputation: 44201
If the downloaded executable is a .NET application, see AppDomain.ExecuteAssembly.
If you need to create windows, create them after the executed application is running by attaching an event handler to the Application.Idle event. When the app is loaded and starts the WinForms message loop, this event will be raised. Here you can create windows or access the application's windows via Form.OpenForms.
Upvotes: 1