unit test installers

I am starting to do some installer work using WiX (yay, not Installshield) and I was hoping to do some TDD of the installer. Does anybody know of an easy way to do this?

13.10.2009 21:38:11

It sounds to me more like an integration test than TDD.

As far as i can tell there are no MSI testing suits per se.

Nevertheless you could try something like this ( assuming you have a contiunous integration server):

  1. after successful build, install MSI on a clean virtual machine - if installation fails do something (mail, ticket, whatever)
  2. run whatever integration tests you have on your project

After that you can be sure that installed application does what it should.

1.11.2012 07:22:13
In addition to the above, I would highly recommend installing on top of previous installations repeatedly especially when you are using an MSI(Windows Installer). This way you will probably corrupt Windows Installer (registry, files, etc.) before the user experiences this, and develop a solution.
Ryan Gates 5.11.2012 22:17:19

It might not be a bad idea to run a few standard tests on a generated MSI. MSI files support a lot of different deployment scenarios: admin install to extract files, advertised install for active directory, silent install, maintenance install, uninstall etc... Maybe it is indeed an idea to create a small test suite for this - perhaps it's even being considered for the WIX toolset for all I know.

However, I think the first, best step towards delivering a quality setup would be to run the MSI through the MSI validation suite. These are referred to as ICE (Internal Consistency Evaluators) and they are delivered as *.cub file with the Windows Installer SDK. Running these scripts tend to reveal lots of bad design constructs in the MSI. The WIX tool for this is called smoke.exe.

16.10.2009 02:01:17
I think there is no need to call smoke explicitly. Light runs ice test in darice.cub and mergemod.cub(when needed) installing.blogspot.com/2006/04/msi-validation-in-wix.html
Bartek Szafko 16.10.2009 12:56:25

Does it make sence, if you create some script file that checks that files are on the right places. I expect make it as perl or python script


msiexec /x product.msi # remove
msiexec /i product.msi /silent # install

ASSERT_EXIST_FILE(PFILE, 'productname/application.exe')

and etc.

18.07.2011 12:27:00

I want to add link to post about how to create unit test for WIX installer database: http://miroslawmiodonski.blogspot.com/2012/10/how-to-create-unit-test-for-wix.html

1.11.2012 04:53:15