0

I have created an application that installs and edits configuration settings for a 3rd party application. The application works fine but I need to prepare it for deployment, which means I need to edit it so that it can run silently. I've created it in Visual Studio 2012, if that makes any difference. It contains 3 Messagebox.Show for errors, that I suppose I should output to the error log, and the "Configuration Complete" prompt after success. There is a single button click to start the configuration function.

I have looked around and found only people trying to silently run other applications silently from within their code. If anyone can point me in the right direction I would be grateful.

Alex
  • 4,821
  • 16
  • 65
  • 106
S Chase
  • 43
  • 1
  • 10

1 Answers1

0

Just add a Module to your project.

Change your Startup Object to "Sub Main" in Project Properties>Application Tab

Then add a Sub Main your module:

Module Module1

    Sub Main()
        'call your program code here instead of from your button click
    End Sub

End Module

And yes you need to log your errors to a file instead of showing them in a Message Box

Matt Wilko
  • 26,994
  • 10
  • 93
  • 143
  • Will this allow me to still use the form or do I need to have the Sub Main decide to open the form or not based on command line arguments? – S Chase Jun 06 '13 at 15:19
  • @SChase - yes you can optionally show the Form from here is not running silently. Just check command line args and if not specified to run silently show the form – Matt Wilko Jun 06 '13 at 15:22