Hi All

I have tried taking the approach below for installing Performance Counters (I’m working with Microsofts Enterprise Library code), however in our organization we want to run InstallUtil against a dll to install the performance counters as well as register the same dll in the GAC. The trouble is the wix syntax for installing to the GAC means the file is not actually installed to the file system anywhere and consequently InstallUtil cannot be run on it.

 

Has anyone else who has used this InstallUtil hack come up against this problem?

 

I’ve tried having two <Component> elements, one to install the file to the GAC and 1 to install to the file system and run installutil as below, but the installer seems to get itself in a right muddle and fails.

 

Any insights appreciated.

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pavel Repin
Sent: 01 May 2006 20:38
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Wix Fragment Template That Invokes InstallUtil.exe

 

Hi,
Here's a "hack" we use at work, to invoke InstallUtil.exe as part of MSI Install Execute sequence.

  • The hack doesn't rely on embedding binaries that know how to run installer classes. We just assume that one of the appropriate .NET framework runtimes is present on the target system (in my organization it's a bullet-proof assumption, your mileage may vary).
  • You tell it which .NET runtime to use.
  • You can tell it to emit a log file when InstallUtil is run.
  • It uses CAQuietExec action from wixca.dll, which is part of WiX toolchain, to run InstallUtil.exe of your choice.


The WiX Fragment Template (it has some terse documentation in the comment block at the top):
<http://repin.com/wix/InstallUtilFragment.wxs.xml >

Usage in your WiX file may look like so:
    ...
    <Binary Id="wixca" src="">wixca.dll " />
    <FragmentRef Id="daemon.exe.InstallUtilFragment" />
    ...
    <Directory ...>
        <Component Id=" daemon.exe.Component" DiskId="1" Guid="8E44A97D-9FDF-414E-B2E7-58BFB1ED9A3F">
            <File Id="daemon.exe.File"
                Name=" daemon.exe"
                src="" KeyPath="yes" />
            <File Id="log4net.dll"
                Name=" log4net.dll"
                src="" />
        </Component>
        ...
    </Directory>
    ...

The snippet above assumes that you edited the WiX fragment and replaced @FILE@ tokens with daemon.exe, @CLR_VERSION@ tokens with v2.0.50727 (or whatever version of .NET framework you need), @WIXCA@ tokens with wixca.

Hope this helps.
--
Pavel Repin

PS: Let's not turn this thread into discussion of InstallUtil.exe being evil (it well might be evil). Instead it it should be a thread that helps some of us who have to live with InstallUtil for whatever reasons.

_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to