How to get WiX to call a method in a .NET assembly as part of the installation process?

I am porting some existing products to use WiX 3.5 (I am using Votive VS integration). Some elements that I install must be registered in a third-party structure. The requirement is that I have to call the Register () method in a third-party .NET assembly to inform it of the presence of the elements that I set. He is expecting a COM version of ProgID.

I can't figure out how to get WiX to do this. I was thinking of creating a binary user action, but I can’t find a way to pass the parameter (a string containing the ProgID) to this user action. I don’t want to hardcode it, because I need it to be reusable code. I don’t see a way to do this declaratively, because the Register () function is a black box.

Man is a steep learning curve. What is my best approach here?

+3
source share
2 answers

Take a look at Foundation Tools Foundation (DTF) for WIX. There is a DTF.chm file with a WIX installation with lots of information.

Assuming the installation process is similar to

  • , /ProgID, ..

( )

  • SetupRegistration
  • DoRegistration

SetupRegistration , , . ProgID , CustomActionData "DoRegistration" (, )

DoRegistration - InstallExecuteSequence, , InstallFiles, . Session.CustomActionData ProgID, , .

+2

, .

CustomAction (), . , , .

:

<Custom Action="ActionName" After="InstallFinalize">CONDITION = "1"</Custom>

:

<CustomAction Id="TestConnection" BinaryKey="SetupCustomActions" DllEntry="TestConnection" Execute="immediate" Return="check" />
-1

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


All Articles