I was able to use the System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
and Ubinder to extract itself.
But in Wix 3.10.3 stable, BA just extracts a slim ba.exe
to temp folder, and then it will switch to run the slim ba.exe
which has no msi in it. Extracting itself will not work. While I still cannot get the first startup full ba.exe
since it's already closed.
If there is any property I can get from BootstrapperApplication
class to point out the full ba.exe
(it should has some trace since the msi should be extracted when it starts to install) or can I invoke the extraction before it starts to install msi?
Using the
Unbinder
class, you can extract the embedded MSIs into a working folder. Note this only works if you're using embedded MSIs for your bundle.I've included the code below, which requires you to provide the path to your bundle executable (which is different from the ba.exe). I've written up how I did this on my blog, which you can view here: https://www.wrightfully.com/extracting-wix-bundled-msi-files-without-running-the-installer/