How to unit test WIX to combine modules?

I am creating merge modules with WIX. The batch files that WIX tools invoke to create merge modules from * .wxs files are launched by my daily build.

I am trying to figure out how I can automate testing of these merge modules. The things that I would like to test is that the merge module installs the necessary files, are the file versions correct, etc.

One of my ideas is to write a script (maybe VB Script) to install the merge module in a temporary place and check if it installed everything correctly. However, I'm not sure if this is the right way to do this.

Are there standard ways to write unit tests for merge modules? Any ideas on how to do this are welcome.

+3
source share
3 answers

I often thought about it, but did not come up with anything that I like. First, I would call this integration testing not strictly unit testing. Secondly, the problem of “correct files” and “correct versions” is difficult to determine.

, WiX/MSI - , , . . , , , ? , , .

, , , MSI.

+1

,

  • msi msiexec (.. 0).
  • .

, , , . , :

msiexec /i myinstaller.msi /passive || echo ERROR: non-zero return code!

. , - :

"c:\program files\mystuff\app.exe" /selftest || echo ERROR: non-zero return code!

, . . "" , .

+3

, , .

, . script , script , , , , .. , script . , , . , , , , .

Ideally, the entire installation / uninstallation process should be performed on a separate computer or in a virtual one, in order to avoid interference with the build server.

You will have some work associated with all of these scenarios, but once you get it, you can use it with minor changes for any other future merge module projects or simple customization projects.

Hope this helps,

Adrian.

+1
source

Source: https://habr.com/ru/post/1781430/


All Articles