Load EXE and run from memory - is it possible in C# ?

  • Thread starter Thread starter Just D.
  • Start date Start date
J

Just D.

Hi All,

I have a question. I need to load some EXE file into memory and then find a
way how to run it from the memory without saving to disk. I know that it was
possible in C++ to execute any code already loaded into memory. What about
C#? Does anybody know how to do that?

The main purpose - to download a small installer from my www and then using
this installer to download some big installer (like SETUP.EXE) and run it
without saving to a client disk. That's a requirement, the purpose is to
keep the client always up-to-date and don't allow him to keep old installer
files on the remote machine. The small installer should test the remote
application version and understand what version is running to stop it and
update if it's needed.

Thanks,
Dmitri.
 
Just D. said:
Hi All,

I have a question. I need to load some EXE file into memory and then find a
way how to run it from the memory without saving to disk. I know that it was
possible in C++ to execute any code already loaded into memory. What about
C#? Does anybody know how to do that?

The main purpose - to download a small installer from my www and then using
this installer to download some big installer (like SETUP.EXE) and run it
without saving to a client disk. That's a requirement, the purpose is to
keep the client always up-to-date and don't allow him to keep old installer
files on the remote machine. The small installer should test the remote
application version and understand what version is running to stop it and
update if it's needed.

Thanks,
Dmitri.

Why not use Assembly.LoadFrom? It can load assemblies from the web:

http://msdn.microsoft.com/library/d...stemreflectionassemblyclassloadfromtopic1.asp

Erik
 
Dimitri,

AFAIK, This is not possible in C#. But, if this is a .NET application, you
may want to look into self-updating applications.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/updater.asp

--
HTH

Kyril Magnos
"I'm not a developer anymore, I'm a software engineer now!" :-)

| Hi All,
|
| I have a question. I need to load some EXE file into memory and then find
a
| way how to run it from the memory without saving to disk. I know that it
was
| possible in C++ to execute any code already loaded into memory. What about
| C#? Does anybody know how to do that?
|
| The main purpose - to download a small installer from my www and then
using
| this installer to download some big installer (like SETUP.EXE) and run it
| without saving to a client disk. That's a requirement, the purpose is to
| keep the client always up-to-date and don't allow him to keep old
installer
| files on the remote machine. The small installer should test the remote
| application version and understand what version is running to stop it and
| update if it's needed.
|
| Thanks,
| Dmitri.
|
|
 
Thanks for these answers. That's bad, but the main SETUP.EXE is written in
VB6 and my task is to write an installer. I can use C++ but I don't have a
ready code to download installer from a password protected FTP server. I
have this code written in C# and want to use it.

Dmitri.

"Kyril Magnos"
AFAIK, This is not possible in C#. But, if this is a .NET application, you
may want to look into self-updating applications.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/updater.asp
 
What about InstallShield's "Install From The Web" technology for the setup
packages and a background C# app to monitor and remove the local installer
files? Would that work?

Also, did you ever get that VB6 app upgraded and moved into C#? (I have a
good memory... lol)

--
HTH

Kyril Magnos
"I'm not a developer anymore, I'm a software engineer now!" :-)

| Thanks for these answers. That's bad, but the main SETUP.EXE is written in
| VB6 and my task is to write an installer. I can use C++ but I don't have a
| ready code to download installer from a password protected FTP server. I
| have this code written in C# and want to use it.
|
| Dmitri.
|
| "Kyril Magnos"
|
| > AFAIK, This is not possible in C#. But, if this is a .NET application,
you
| > may want to look into self-updating applications.
| >
| >
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/updater.asp
|
|
 
Hi Kyril,
What about InstallShield's "Install From The Web" technology for the setup
packages and a background C# app to monitor and remove the local installer
files? Would that work?

Did you see that for VB6?-)
Also, did you ever get that VB6 app upgraded and moved into C#?

Physically it wasn't my application. I gave some recommendations..., and
that's all. It's still VB.s

(I have a good memory... lol)

That's a very good advantage...)
"I'm not a developer anymore, I'm a software engineer now!" :-)

Looks like the same...)

Dmitri.
 
| Hi Kyril,
|
| > What about InstallShield's "Install From The Web" technology for the
setup
| > packages and a background C# app to monitor and remove the local
installer
| > files? Would that work?
|
| Did you see that for VB6?-)

http://www.installshield.com/products/setup/update.asp

That might help :-) I know for a fact that you can use InstallShield for
VB6, but this might be even more suited to your needs.

|
| > Also, did you ever get that VB6 app upgraded and moved into C#?
|
| Physically it wasn't my application. I gave some recommendations..., and
| that's all. It's still VB.s
|

Sounds like a lot of places I have worked at. ;-)

| (I have a good memory... lol)
|
| That's a very good advantage...)
|
| > "I'm not a developer anymore, I'm a software engineer now!" :-)
|
| Looks like the same...)

You know, that is what I told my manager, and he said that it is different
in terms of pay. So I accept it. lol

|
| Dmitri.
|
|
 
Back
Top