Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Mobile

A standalone messagebox (good for user interaction during the install process of your application)

3.91/5 (7 votes)
10 Nov 20051 min read 1   375  
ShowArgs displays a MessageBox and reads the parameter from command line.

Introduction

The VS2003 implementation of the MSI installer is not as flexible as we developers think...

If you like to (or have to) interact with your user during the installation process you can use the built-in dialog boxes of VS. But these dialog boxes are very limited. If you have to do something special (e.g. tell you user to plug in his USB connector to start the USB plug and play) you have to start a custom action in VS.

ShowArgs is a little EXE program, which displays a MessageBox(). In the command line you can specify what the message box should display: title, prompt text, icon, buttons etc. (Of course, you can customize ShowArgs to do much more, if you want to.)

Usage

Call ShowArg.exe at command line or as custom actions in VS with the following args:

  • /b_ok MessageBoxButtons.OK
  • /b_okcancel MessageBoxButtons.OKCancel
  • /b_abortretryignore MessageBoxButtons.AbortRetryIgnore
  • /b_retrycancel MessageBoxButtons.RetryCancel
  • /b_yesno MessageBoxButtons.YesNo
  • /b_yesnocancel MessageBoxButtons.YesNoCancel
  • /i_information MessageBoxIcon.Information
  • /i_hand MessageBoxIcon.Hand
  • /i_asterisk MessageBoxIcon.Asterisk
  • /i_error MessageBoxIcon.Error
  • /i_exclamation MessageBoxIcon.Exclamation
  • /i_none MessageBoxIcon.None
  • /i_question MessageBoxIcon.Question
  • /i_stop MessageBoxIcon.Stop
  • /i_warning MessageBoxIcon.Warning
  • /c "caption text" Title
  • "prompt text" Message

The return value of ShowArgs is the DialogResult value of MessageBox.Show() function, 0 (zero) for Yes and OK.

Example

The following dialog box is the result of the line: ShowArgs.exe /b_ok /i_information /c "Title" "Line 1\nLine 2\nSucess!".

Enjoy!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here