?
Solved

C# command line app, invisible to windows installer

Posted on 2014-01-21
5
Medium Priority
?
438 Views
Last Modified: 2014-02-05
Hi Experts,
I need to create a C# command line app that won't show a window popup when called from a windows installer.  Is my best bet a "console application" or an "empty project"?  I need the return code of the main to indicate the success or failure of the command line.

Thanks,
Mike
0
Comment
Question by:thready
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 2000 total points
ID: 39798530
Create a console app and called from custom install methods using Process start method.
Your console app will return 0 when running OK or a number if there is an error, also you write the errors to console and use RedirectStandardOutput on ProcessStartInfo to capture output of your console app directly

Note: I used this construct all the time when I need to run silence updates in installers
0
 
LVL 1

Author Closing Comment

by:thready
ID: 39803521
You rock.  Thanks!
0
 
LVL 1

Author Comment

by:thready
ID: 39836887
Side question, sorry - do you know if it's possible to create a c# forms application that would not have any UI that could also redirect its output?  Or would "console" not even be available in this type of project?   I ask this because the command line is part of an installer and I don't want to see the black window come up while it does its thing...

Thanks,
Mike
0
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 39837315
Set this property to Hidden(not visible) when you run console app.
0
 
LVL 1

Author Comment

by:thready
ID: 39837324
Thank you very much! :-)
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question