0

I have created a bundle containing 3 packages.

Each of the three package will be installed depending on the "InstallCondition", which I have defined in wxs file.

Now, in the custom MBA (which I have started creating), I need to show a list of all the packages that will be installed by my bundle along with the Installed state of each package. I need to show this in a UI dialog.

-----------------------------
Package       Installed State
-----------------------------
Package-1     Present
Package-2     Absent
Package-3     Absent
------------------------------

Now this should be done in DetectComplete callback. But I am confused since there is not enough information in it.

Any help will be appreciated.

dhiraj suvarna
  • 505
  • 7
  • 20

1 Answers1

1

You can listen to the DetectPackageComplete Event of the Bootstrapper. Which will get raised for every package. Then you can keep a track of the packages with your own logic.

Hope it helps.

krafty
  • 425
  • 4
  • 16
  • Yup, I missed that callback, thanks Rishikesh for the answer. – dhiraj suvarna Nov 11 '15 at 17:39
  • I would also like to know any suggestions for detecting the package. I have them written down in my wxs file as InstallConditions but how can i use them in the code is what i am wondering. Any pointers on that front would be helpful. – dhiraj suvarna Nov 11 '15 at 17:42
  • OK, to have conditional installs you can check and manage your own conditions in the Bootstrapper application, you can track the same conditions (packages, registry keys etc..). Listen to the ApplyBegin Event and then decide whether to continue to apply the package or not. Good luck. – krafty Nov 11 '15 at 18:05
  • So you are suggesting me to not use the "InstallCondition" of the ExePackage Element and instead do the Package Checking in the custom MBA? – dhiraj suvarna Nov 11 '15 at 18:13
  • It is upto you. Go for the easiest design option. If your packages can be customised from the UI and it causes some package validations based on dependencies then yes. Otherwise, its safe to do it in the wxs package file - way less overhead ;-) The more code you will write the more testing is required, and Boostrapper application testing is not straightforward. – krafty Nov 11 '15 at 18:17
  • I Agree with your last statement, well currently my approach would be to use a variable in the wxs which will hold the "install condition" and to use that variable inside the custom MBA to display the "install state" of the packages. – dhiraj suvarna Nov 11 '15 at 18:20
  • OK. The events used to select unselect the packages are the PlanPackageBegin, PlanMsiFeature, PlanComplete. For reference check this link: http://www.wrightfully.com/part-4-of-writing-your-own-net-based-installer-with-wix-handling-current-and-future-state/ – krafty Nov 11 '15 at 18:25
  • Thanks Rishikesh for the info, ideally there should be reference listing down when the events are fired so that we are able to handle it properly, as of now it seems trial and error is the only way to go :-( – dhiraj suvarna Nov 11 '15 at 18:50