[wix-users] Calling DLL Interfaces from Wix

Hoover, Jacob Jacob.Hoover at greenheck.com
Tue Feb 26 08:20:19 PST 2019


Managed or Native?

Assuming native, you just need to conform to the signature of a CA.

Ex:
EXPORT UINT __stdcall VJSharp20InstalledCA(MSIHANDLE hInstall)

And then you reference that in your WXS authoring:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>
    <Condition Message="This application requires Microsoft Visual JSharp 2.0. Please install Microsoft Visual JSharp 2.0 then run this installer again.">
      <![CDATA[Installed OR VJSHARP20]]>
    </Condition>
    <Property Id="VJSHARP20" Secure="yes"/>
    <CustomAction Id="VJSharp20InstalledCA" BinaryKey="Prerequisites" DllEntry="VJSharp20InstalledCA" Return="check" Execute="firstSequence" />
    <InstallUISequence>
      <Custom Action="VJSharp20InstalledCA" After="AppSearch">NOT Installed</Custom>
    </InstallUISequence>
    <InstallExecuteSequence>
      <Custom Action="VJSharp20InstalledCA" After="AppSearch">NOT Installed</Custom>
    </InstallExecuteSequence>
  </Fragment>
  <Fragment>
    <Binary Id="Prerequisites" SourceFile='$(var.SourceFolder)\Bin\Prerequisites.dll' />
  </Fragment>
</Wix>

Note, in this use case my CA does the searches, and assigns a value to the VJSHARP20 property.  This allows me to PropertyRef that property in installers which need it and wix will ensure all the needed bits are included.


-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Jayaprakash, Bs via wix-users
Sent: Tuesday, February 26, 2019 9:42 AM
To: Blair Murri <osito at live.com>; Steven Ogilvie <stogilvie at genetec.com>; WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Jayaprakash, Bs <bs.jayaprakash at intel.com>
Subject: Re: [wix-users] Calling DLL Interfaces from Wix

I have seen this link. Need one help.
How can I call any dll Interface from Wix? Any pointers?

Regards,
Jayaprakash
-------------------------------------------------
Advanced System Tools Wiki<https://wiki.ith.intel.com/display/ccb/Advanced+System+Tools+Wiki>,  Download<https://sharepoint.amr.ith.intel.com/sites/PCCGUtil/SitePages/Home.aspx>
-------------------------------------------------

From: Blair Murri [mailto:osito at live.com]
Sent: Tuesday, February 26, 2019 4:51 AM
To: Steven Ogilvie <stogilvie at genetec.com>; WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Jayaprakash, Bs <bs.jayaprakash at intel.com>
Subject: Re: Calling DLL Interfaces from Wix

This webpage, perchance?
https://docs.microsoft.com/en-us/windows-hardware/drivers/install/difx-guidelines
Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org<mailto:wix-users-bounces at lists.wixtoolset.org>> on behalf of Jayaprakash, Bs via wix-users <wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>>
Sent: Monday, February 25, 2019 9:02:20 AM
To: Steven Ogilvie; WiX Toolset Users Mailing List
Cc: Jayaprakash, Bs
Subject: Re: [wix-users] Calling DLL Interfaces from Wix

Thanks. I heard from few folks saying "Difx" will not be supported by Microsoft going forward. So I am trying to write DLL which uses windows APIs to install the driver.

Regards,
Jayaprakash
 -------------------------------------------------
Advanced System Tools Wiki,  Download
-------------------------------------------------

-----Original Message-----
From: Steven Ogilvie [mailto:stogilvie at GENETEC.COM]
Sent: Monday, February 25, 2019 10:29 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>>
Cc: Jayaprakash, Bs <bs.jayaprakash at intel.com<mailto:bs.jayaprakash at intel.com>>
Subject: RE: Calling DLL Interfaces from Wix

Not sure if this will help, but WiX comes with an extension to install
drivers:
http://wixtoolset.org/documentation/manual/v3/xsd/difxapp/driver.html

But back to your question, you might have to 'wrap' your C DLL with a C++ or C# custom action DLL, i.e. use DllImport

i.e.:
[DllImport("advapi32.dll", EntryPoint = "CloseServiceHandle")]
        public static extern int CloseServiceHandle(IntPtr hScObject);

Steve


> -----Original Message-----
> From: wix-users 
> <wix-users-bounces at lists.wixtoolset.org<mailto:wix-users-bounces at lists
> .wixtoolset.org>> On Behalf Of Jayaprakash, Bs via wix-users
> Sent: February 25, 2019 11:40 AM
> To: WiX Toolset Users Mailing List 
> <wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>
> >
> Cc: Jayaprakash, Bs 
> <bs.jayaprakash at intel.com<mailto:bs.jayaprakash at intel.com>>
> Subject: [wix-users] Calling DLL Interfaces from Wix
>
> Hi,
> We have written DLL using C code and exposed few interfaces like below.
>
> 1.       InstallDriver (Inf file, HWID)
>
> 2.       UnInstallDriver (Inf file, HWID)
> We are able to test this with testapp. Can you please let me know how 
> to
use
> the DLL from Wix and call the Interfaces using Custom action?
>
> Regards,
> Jayaprakash
> -------------------------------------------------
> Advanced System Tools
> Wiki<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
> wiki
<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki%0b>> .ith.intel.com%2Fdisplay%2Fccb%2FAdvanced%2BSystem%2BTools%2BWiki&a
> mp;data=02%7C01%7Cstogilvie%40genetec.com%7C5adb3fa8e37b47b38c110
> 8d69b3ff8bb%7C7ba8d2fb46604a19802e4d015a17e167%7C0%7C0%7C636867
> 096418170968&sdata=6N4JgGj%2BZjYFe%2FWdP7%2BXwjvn2TaqSBPRfq
> 25xN3X%2Flc%3D&reserved=0>,
> Download<https://na01.safelinks.protection.outlook.com/?url=https%3A%2
> F%
<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%25%0b>> 2Fsharepoint.amr.ith.intel.com%2Fsites%2FPCCGUtil%2FSitePages%2FHome.a
> spx&data=02%7C01%7Cstogilvie%40genetec.com%7C5adb3fa8e37b47b3
> 8c1108d69b3ff8bb%7C7ba8d2fb46604a19802e4d015a17e167%7C0%7C0%7C6
> 36867096418170968&sdata=EkfA772rOsBvF3L%2Fh0kS2ZPyhgm2xLP6eU
> ZvVxuFxnM%3D&reserved=0>
> -------------------------------------------------
>
>
> ________________________________________________________________
> ____
> WiX Toolset Users Mailing List provided by FireGiant 
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fi
> re giant.com%2F&data=02%7C01%7Cstogilvie%40genetec.com%7C5adb3fa
> 8e37b47b38c1108d69b3ff8bb%7C7ba8d2fb46604a19802e4d015a17e167%7C0
> %7C0%7C636867096418170968&sdata=JLQm%2Bcz0JjaBMGXqOe%2Bvt
> TYPfJwUm6sZLv0nAk8Fyu0%3D&reserved=0

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
NOTE: This email was received from an external source. Please use caution when opening links or attachments in the message.



More information about the wix-users mailing list