CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2005
    Posts
    141

    combine executables

    hi

    i'm just wondering, how could we combine two executables (program A and program B) into one file (one executables, lets say program C), and if we run the 'program C', both the program A and B would be run. Because i've seen some program does this.

    any idea on how I could do it? using C#?

    thanks

  2. #2
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: combine executables

    Well if you want something basic you have a few implementation options in program C:

    1. Assembly.Load()
    2. AppDomain.Load()
    3. Process.Start()

    Have a look at those options and see which one is best for you.

  3. #3
    Join Date
    Jul 2005
    Posts
    141

    Re: combine executables

    Quote Originally Posted by nelo
    Well if you want something basic you have a few implementation options in program C:

    1. Assembly.Load()
    2. AppDomain.Load()
    3. Process.Start()

    Have a look at those options and see which one is best for you.
    thanks for replying, but as far as i know, these options won't combine two programs into one file, right?

  4. #4
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: combine executables

    Is is very strange demand. Are you sure it is the best way?

    Only way I can imagine is to embed the two assemblies (A,B) as resources into the the result one (C), and if the C is run, it extract A.B from resources to specified (temporary?) folder and run them.

    But as I've said before. It si strange. What is the reason for doing it?
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

  5. #5
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: combine executables

    I agree with boudino. I was about to suggest the same thing but my tests were not successful. Although I didn't extract them to a temporary folder. I was hoping to use the Assembly.Load() overload which takes an array of bytes. I would get the array of bytes straight from the resource manager. But as I said it didn't work and I didn't have time to investigate why. Hopefully imin can verify if it is a viable option...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured