2

I have a windows form application that I am trying to use as an all in on installer for a set of other tools I have. Each of these tools installs via an installer (by pressing next, finish, ect).

I want to know if there is a way to not only start the installation of those installers but also automatically click through them so that in one click I can have all the tools install themselves.

Is this possible through a windows forms application?

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Habeeb Ahmed
  • 217
  • 4
  • 9

3 Answers3

2

If the other tools are windows installer msi files, you can probably install them silently, see e.g Silent installation of a MSI package, so your application would launch processes by using Process.Start() to run msiexec.exe /qn firstSetup.msi and so on.

However, there is a much more elegant solution that

  • gives you a setup.exe for the full bundle
  • shows the bundle in add/remove programs so it can be removed.

The "Burn" tool included in the Windows Installer Xml Toolkit (WiX) . It allows you to specify a set of packges which can be executables, msi files etc. and installs them, acting like a single installer. The bundle setup can use a GUI (called a bootstrap application).

WiX ships with a standard bootstrapper application, http://wixtoolset.org/documentation/manual/v3/bundle/wixstdba/

But you can choose to make your own bootstrapper app as a WPF dll, examples: http://bryanpjohnston.com/2012/09/28/custom-wix-managed-bootstrapper-application/ http://neilsleightholm.blogspot.se/2012/10/wix-bootstrapper-application.html

The WiX project(s) even integrate with VS so you can build them straight in the IDE.

Community
  • 1
  • 1
Anders Forsgren
  • 10,827
  • 4
  • 40
  • 77
1

Unless the installers for the other apps expose an API for automation, which is unlikely, then you would have to employ the Windows API to achieve your aim. You would have to use FindWindow to get the handle of the installer's top-level window, FindWindowEx to get the handle of appropriate child windows, e.g. text boxes and buttons, and then SendMessage to set text and click. This combination is very common so you would be able to find plenty of examples. The catch is that you'll actually have to run those installers multiple times to determine what windows you need to access and then test that your code works.

jmcilhinney
  • 50,448
  • 5
  • 26
  • 46
0

You can make a .bat file and run the tools installer while this parameter

/qb

This parameter setup the installer with defaults or with your presets. For example if you want to install .Net freamework you can do this :

START /qb /norestart dotnet\dotNetFx40.exe

Write your command in a .bat file and call it in your windows form application to setup.

Saman Gholami
  • 3,416
  • 7
  • 30
  • 71