Results 1 to 6 of 6

Thread: Is possible to embedd simple app into solution?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2016
    Posts
    89

    Is possible to embedd simple app into solution?

    Hi!

    I'm creating GUI for command line application.
    Application is small program (have not source code) - single file.
    Is possible to embedd it into solution and call it from code?

    For example:

    Clicking OK performs:

    app.exe -c1 inputfile outputfile

    Thank you for each help.
    Miro

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: Is possible to embedd simple app into solution?

    You would simply deploy the EXE to the same folder as your own EXE. You can then execute it with a call to Process.Start, e.g.
    vb.net Code:
    1. Dim filePath = Path.Combine(Application.StartupPath, "app.exe")
    2.  
    3. Process.Start(filePath, "-c1 inputfile outputfile")
    In theory, you could embed the other EXE into your own as a resource and then extract it on demand but that is often flagged as questionable behaviour by anti-malware programs.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2016
    Posts
    89

    Re: Is possible to embedd simple app into solution?

    Ok, this I know - I want to avoid missing app file.
    Embedding as resource is maybe for AV software "dangerous" - I can try it - but how to extract it?
    In last few minutes I found source code on web but is in C, so can be used in Visual C++...
    How to combine two programming languages in one solution to build single executable?

    Thank you.
    Miro

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: Is possible to embedd simple app into solution?

    Why would you need to combine two languages? Why wouldn't you just look for information on using resources in VB.NET? It really couldn't be easier. You simply add the file on the Resources page of the project properties and then extract it by getting a property value from My.Resources. You really shouldn't do that though. It's really quite silly to worry about a missing file. How many applications do you think there are out there that are just one file? The vast majority of applications out there require far more than two files so why is it such a drama for your application?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2016
    Posts
    89

    Re: Is possible to embedd simple app into solution?

    Ok, I understand - this app has to be portable simple tool without any folder - simple single executable.
    Miro

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: Is possible to embedd simple app into solution?

    Quote Originally Posted by MIRKOSOFT View Post
    Ok, I understand - this app has to be portable simple tool without any folder - simple single executable.
    Miro
    Oh, I see. Yeah, it is impossible to copy two files from machine to machine so I can see your dilemma.

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