0

Is it possible to include a command line utility in my C# WinForm Application? To be more specific, is it possible to compile a command line util into an .exe file so that I can write a GUI to control the command line tool?

9
  • You can control it by starting the command line tool with parameters. Commented May 14, 2012 at 20:08
  • yeah I know that, but I want to have in compiled into my .exe file and not having it roaming around in the install directory. Commented May 14, 2012 at 20:13
  • You could have it as a resource that you then unpack when you start the app Commented May 14, 2012 at 20:14
  • That will be difficult, you'll have to find a temporary location to unpack the resource. You can't just dump it in the same folder as your app because the user is unlikely to have write permission to that folder. Commented May 14, 2012 at 20:15
  • 3
    Anyway, I'm not sure what the motivation is to have a single EXE. If you're writing something targeting the .NET Framework, you're not going to be able to avoid a sea of dependencies. You'll essentially require an installer (or some other deployment mechanism like ClickOnce), therefore what does it matter if there's another EXE you depend on? Commented May 14, 2012 at 20:22

1 Answer 1

2

If you have a dependency on another application, then packaging that utility inside your EXE is a bad idea, because that means every time that dependency is updated, you should be updating your application. I would just build your windows application and help the user find the required EXE. This is how Exact Audio Copy works which relies on another 3rd party application for encoding (specifically LAME).

Sign up to request clarification or add additional context in comments.

2 Comments

Decreasing coupling seems like a good idea in theory, but probably won't bear out all that well in practice. If the command line utility that he's interfacing with undergoes non-trivial changes, then the GUI interface will need to change in response.
Actually it does, for multiple application I use. When LAME gets an update that doesn't require me to get a new GUI for EAC, I can replace the console lame.exe without fear. By tightly coupling the two, it simply increases complexity and reduces options.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.