Hi,
I'm using a solution, which I found somewhere on the internet and it
works fine. Works only for .NET Installer implementation DLL. Here is
the fragment of our company's wikipedia for creation of WIX
installations, which I created:
---------------------------
Running .NET installer classes
Incorporating managed Custom Actions in WiX is a relatively simple
task. However, you have to pay attention to a few details to avoid
ending up with a headache just trying to figure out what's wrong with
the script.

The first thing you have to do is make sure that the installer class
was in the package, so if there is a file reference for the assembly
with the installer type:

<File Id="InstallerFile" Name="SAMPLE~1.DLL"
LongName="SampleInstaller.dll"
src="$(var.BinFolder)\SampleInstaller.dll" Vital="yes" KeyPath="yes"
DiskId="1" />

What's worth noting here is the specific Id for the file - because it
is necessary to reference that specific file later in the script.
To setup WiX to execute a managed installer class as a Custom Action,
we use 'InstallUtil'. This tool can be run from the command-line
('installutil.exe'). We use the WiX CAQuietExec custom action to run
the console application - we have to include binary "wixca.dll" to
support this functionality in our installation:

<Binary Id="wixca" src="wixca.dll " />

Setting up the Custom Action is simple, albeit not trivial. The Custom
Actions are calls to installutil. An advice is to always check these
using "InstallUtil.exe" via the command-line, to make sure they're
working ok. The best solution is to create fragment with installutil
support and then do simly reference from main installation code:

<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi";>
   <Fragment Id="@[EMAIL PROTECTED]">
       <CustomAction Id="@[EMAIL PROTECTED]" Property="@[EMAIL PROTECTED]"
         Value='"[EMAIL PROTECTED]@\InstallUtil.exe"
/installtype=notransaction /action=commit /LogFile="[INSTALLUTILLOG]"
"[EMAIL PROTECTED]@.File]"' />
       <CustomAction Id="@[EMAIL PROTECTED]" Property="@[EMAIL PROTECTED]"
         Value='"[EMAIL PROTECTED]@\InstallUtil.exe"
/installtype=notransaction /action=rollback
/LogFile="[INSTALLUTILLOG]" "[EMAIL PROTECTED]@.File]"' />
       <CustomAction Id="@[EMAIL PROTECTED]" Property="@[EMAIL PROTECTED]"
         Value='"[EMAIL PROTECTED]@\InstallUtil.exe"
/installtype=notransaction /action=install /LogFile="[INSTALLUTILLOG]"
"[EMAIL PROTECTED]@.File]"' />
       <CustomAction Id="@[EMAIL PROTECTED]"
Property="@[EMAIL PROTECTED]"
         Value='"[EMAIL PROTECTED]@\InstallUtil.exe"
/installtype=notransaction /action=uninstall
/LogFile="[INSTALLUTILLOG]" "[EMAIL PROTECTED]@.File]"' />
       <CustomAction Id="@[EMAIL PROTECTED]" BinaryKey="@WIXCA@"
DllEntry="CAQuietExec" Execute="commit" Return="check" />
       <CustomAction Id="@[EMAIL PROTECTED]" BinaryKey="@WIXCA@"
DllEntry="CAQuietExec" Execute="rollback" Return="check" />
       <CustomAction Id="@[EMAIL PROTECTED]" BinaryKey="@WIXCA@"
DllEntry="CAQuietExec" Execute="deferred" Return="check" />
       <CustomAction Id="@[EMAIL PROTECTED]" BinaryKey="@WIXCA@"
DllEntry="CAQuietExec" Execute="deferred" Return="check" />
       <InstallExecuteSequence>
         <Custom Action="@[EMAIL PROTECTED]"
After="InstallServices"><![CDATA[ [EMAIL PROTECTED]@.Component > 2 ]]></Custom>
         <Custom Action="@[EMAIL PROTECTED]"
After="@[EMAIL PROTECTED]"><![CDATA[ [EMAIL PROTECTED]@.Component > 2
]]></Custom>
         <Custom Action="@[EMAIL PROTECTED]"
After="@[EMAIL PROTECTED]"><![CDATA[ [EMAIL PROTECTED]@.Component > 2 
]]></Custom>
         <Custom Action="@[EMAIL PROTECTED]"
After="@[EMAIL PROTECTED]"><![CDATA[ [EMAIL PROTECTED]@.Component > 2
]]></Custom>
         <Custom Action="@[EMAIL PROTECTED]"
After="@[EMAIL PROTECTED]"><![CDATA[ [EMAIL PROTECTED]@.Component > 2 
]]></Custom>
         <Custom Action="@[EMAIL PROTECTED]"
After="@[EMAIL PROTECTED]"><![CDATA[ [EMAIL PROTECTED]@.Component > 2
]]></Custom>
         <Custom Action="@[EMAIL PROTECTED]"
After="MsiUnpublishAssemblies"><![CDATA[ [EMAIL PROTECTED]@.Component = 2
]]></Custom>
         <Custom Action="@[EMAIL PROTECTED]"
After="@[EMAIL PROTECTED]"><![CDATA[ [EMAIL PROTECTED]@.Component = 2
]]></Custom>
       </InstallExecuteSequence>
   </Fragment>
</Wix>

Here's the convention for identifying the binaries that this fragment expects:

The binary file must have the Id:
{SomeFile}.File
The compoment that contains this file must have the Id:
{SomeFile}.Component
'FILE' token will be replaced with {SomeFile}.
Good file and component Ids:
MyFile.exe.File
foobar1.File
MyFile.exe.Component
foobar1.Component
Bad file Ids:
foobar1
file1.whatever
foobar1.Cooomponeeent
The Simple code, which use this fragment then looks like this:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
 <Module Id="FNGInstallLib"
Guid="{971AF99B-8195-4248-9C21-776B2B3FD6C5}" Language="0"
Version="1.0.0">
   <Package Id="????????-????-????-????-????????????" InstallerVersion="200"
     Languages="1033" Manufacturer="SITRONICS Telecom Solutions, Czech
Republic a. s." SummaryCodepage="1252" AdminImage="no" ShortNames="no"
/>
   <Binary Id="wixca" src="wixca.dll " />
   <FragmentRef Id="InstallUtilFragment" />
   <Directory Id='TARGETDIR' Name='SourceDir'>
     <Directory Id='INSTALLDIR' Name='FORISD' LongName='FORIS Deployment'>
       <Component Id='FNGInstallLib.dll.Component'
Guid='{7B4F1AB6-E1B0-4c2c-A5C5-544B525413B1}'>
         <File Id='FNGInstallLib.dll.File' Name='Instrum.dll'
LongName='FNGInstallLib.dll' Source='FNGInstallLib.dll'  />
         <File Id='FNGInstallLib.dll.Cfg' Name='Instrum.cfg'
LongName='FNGInstallConfig.xml' Source='FNGInstallConfig.xml'/>
       </Component>
    </Directory>
   </Directory>
 </Module>
</Wix>

The fragment InstallUtilFragment then looks like this:


<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi";>
   <Fragment Id="InstallUtilFragment">
      <CustomAction Id="FNGInstallLib.dll.commit.SetProperty"
Property="FNGInstallLib.dll.commit"
         
Value='"[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe"
/installtype=notransaction /action=commit /LogFile="[INSTALLUTILLOG]"
"[#FNGInstallLib.dll.File]"' />
       <CustomAction Id="FNGInstallLib.dll.rollback.SetProperty"
Property="FNGInstallLib.dll.rollback"
         
Value='"[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe"
/installtype=notransaction /action=rollback
/LogFile="[INSTALLUTILLOG]" "[#FNGInstallLib.dll.File]"' />
       <CustomAction Id="FNGInstallLib.dll.install.SetProperty"
Property="FNGInstallLib.dll.install"
         
Value='"[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe"
/installtype=notransaction /action=install /LogFile="[INSTALLUTILLOG]"
"[#FNGInstallLib.dll.File]" ' />
       <CustomAction Id="FNGInstallLib.dll.uninstall.SetProperty"
Property="FNGInstallLib.dll.uninstall"
         
Value='"[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe"
/installtype=notransaction /action=uninstall
/LogFile="[INSTALLUTILLOG]" "[#FNGInstallLib.dll.File]"' />
       <CustomAction Id="FNGInstallLib.dll.commit" BinaryKey="wixca"
DllEntry="CAQuietExec" Execute="commit" Return="check" />
       <CustomAction Id="FNGInstallLib.dll.rollback" BinaryKey="wixca"
DllEntry="CAQuietExec" Execute="rollback" Return="check" />
       <CustomAction Id="FNGInstallLib.dll.install" BinaryKey="wixca"
DllEntry="CAQuietExec" Execute="deferred" Return="check" />
       <CustomAction Id="FNGInstallLib.dll.uninstall"
BinaryKey="wixca" DllEntry="CAQuietExec" Execute="deferred"
Return="check" />
       <InstallExecuteSequence>
         <Custom Action="FNGInstallLib.dll.commit.SetProperty"
After="InstallServices"><![CDATA[ $FNGInstallLib.dll.Component > 2
]]></Custom>
         <Custom Action="FNGInstallLib.dll.commit"
After="FNGInstallLib.dll.commit.SetProperty"><![CDATA[
$FNGInstallLib.dll.Component > 2 ]]></Custom>
         <Custom Action="FNGInstallLib.dll.rollback.SetProperty"
After="FNGInstallLib.dll.commit"><![CDATA[
$FNGInstallLib.dll.Component > 2 ]]></Custom>
         <Custom Action="FNGInstallLib.dll.rollback"
After="FNGInstallLib.dll.rollback.SetProperty"><![CDATA[
$FNGInstallLib.dll.Component > 2 ]]></Custom>
         <Custom Action="FNGInstallLib.dll.install.SetProperty"
After="FNGInstallLib.dll.rollback"><![CDATA[
$FNGInstallLib.dll.Component > 2 ]]></Custom>
         <Custom Action="FNGInstallLib.dll.install"
After="FNGInstallLib.dll.install.SetProperty"><![CDATA[
$FNGInstallLib.dll.Component > 2 ]]></Custom>
         <Custom Action="FNGInstallLib.dll.uninstall.SetProperty"
After="MsiUnpublishAssemblies"><![CDATA[ $FNGInstallLib.dll.Component
= 2 ]]></Custom>
         <Custom Action="FNGInstallLib.dll.uninstall"
After="FNGInstallLib.dll.uninstall.SetProperty"><![CDATA[
$FNGInstallLib.dll.Component = 2 ]]></Custom>
       </InstallExecuteSequence>
   </Fragment>
</Wix>

---------------------------

2007/9/18, chandan Koushik <[EMAIL PROTECTED]>:
>
>
> Alexei wrote:
> >
> >  And bear in mind that if you wish to simply run the custom action when
> > the installer is started then you would have to schedule it - instead of
> > attaching it to a GUI component.
> Thanks for your reply ,could you please provide a sample of how can i
> schedule the custom action.
>
>
> --
> View this message in context: 
> http://www.nabble.com/Calling-a-function-of-one-file-into-a-wix-file.-tf4247450.html#a12758697
> Sent from the wix-users mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to