[wix-users] How to validate something using a product that will be installed during the current installation process

Edwin Castro egcastr at gmail.com
Fri Apr 24 15:29:13 PDT 2020


The WiX Toolset does not provide a mechanism to do this natively so you
must start from first principles. In other words, you have to ask yourself
how you would accomplish this with a basic MSI without any other tool
support.

The best option is for the Validator.exe and all of its DLL dependencies be
provided to you in static lib form so you can write a custom action that
can call functions to do the work for you. For installation software you
really want everything statically linked to avoid dependencies. This is an
opportunity to educate developers who don't know better. If they're
providing stuff for you to use, then they should provide stuff that works
with the Windows Installer engine rather than trying to force the Windows
Installer engine to workaround what is "easy" for development to provide.
Generally speaking the Windows Installer engine is more rigid than
developers and very finicky if you try to force it to do things it wasn't
meant to do.

If that is not possible, then you are going to want to add Validator.exe as
well as *all* of its DLL dependencies in to the Binary table. Then you'll
want to write a custom action that extracts all of those binaries, writes
them to temporary files on disk, executes Validator.exe with appropriate
arguments, and finally removes those temporary files. Effectively you'd be
building something similar to what InstallShield does but custom tailored
to your specific situation. Of course, this assumes that these files are
compressed into the MSI. If they are not, then perhaps you can access them
directly from SourceDir but I've never done that and I wouldn't know how to
advice you there. In any case, really it is much easier if development
provides you static libs you can use in your custom actions. They can still
build Validator.exe if they need it at application runtime but they should
provide you a static lib you can use.

I should say I made an assumption above that you're working within an MSI
context. If you are using a bundle and a bootstrapper application then
suggestions would be different. The Windows Installer engine matters less
in that scenario but you do need to conform to the WiX Burn engine and the
requirements of your chosen bootstrapper application.

--
Edwin G. Castro


On Fri, Apr 24, 2020 at 2:53 PM Tigran Galoyan via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> Hi Community,
>
> Let's say my installation package will install two products at the
> same time. One of the products have let's say Validator.exe that basically
> needs to be run somewhere in the middle, e.g. after the EULA is accepted,
> in order to validate if there is a valid license. If there is no license
> then we cancel the installation at all. If there is a valid license then we
> install both products (including the product with Validator.exe).
>
> The thing is that InstallShield has something like SUPPORTDIR where it
> temporarily keeps all the components of all products to be installed during
> the installation process. Whereas, WiX doesn't support that, for security
> reasons. So now my task is how could I use that Validator.exe (note it has
> its dependencies DLLs...) in the middle while it's not installed as part of
> its product yet and is not available to my custom action to run it and
> verify the existence of the valid license?
>
> How can I achieve this? Thanks in advance.
>
> Best,
> Tigran
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list