[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

C# command line app, invisible to windows installer

Posted on 2014-01-21
5
Medium Priority
?
440 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

649 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