Here's what I use as a custom action to install a COM+ component.  The 
same should work for a Windows Service, or anything else using InstallUtil 
and an installer class.

                <customaction action="General.install" type="1025" 
source="InstallUtil" target="ManagedInstall" />
                <customaction action="General.install.SetProperty" 
type="51" source="General.install" target="/installtype=notransaction 
/action=install /LogFile= &quot;[#${General.id}]&quot; 
&quot;[#VSDFxConfigFile]&quot;" />

The General.id property is the FIle GUID for the assembly I want to 
install.  You will need to create explicit guids for each component and 
file in your install set, and use forceid to set them for the file.  By 
default, the msi tasks will create a new GUid for each file as it adds it 
to the component.  The uninstall action is the same, but in the target you 
change the action to uninstall.

You will also need to add the installutillib.dll and supporting files to 
the install:

             <!-- This section defines any binary files that are to be 
stored in the installer database. 
                 Binary files can be extracted during the install and 
invoked to perform custom actions etc.-->
            <binaries>
                <!-- InstallUtilLib file. This is used for installing and 
uninstalling COM+ components -->
                <binary name="InstallUtil" 
value="references/external/Microsoft/InstallUtilLib.dll" />
                <!-- Install support file.  Includes methods to check 
Framework verison etc. -->
                <binary name="MSVBDPCADLL" 
value="references/external/Microsoft/dpca.dll" />
                <!-- config file for InstallUtilLib -->
                <binary name="VSDNETCFG" 
value="references/external/Microsoft/dpapp.config" />
            </binaries>

and a custom action to extract it:

                <!-- Extracts the InstallUtilLib config configuration and 
adds a property for it to the Property table-->
                <customaction action="DIRCA_CheckFX" type="1" 
source="MSVBDPCADLL" target="CheckFX" />

These isn't really much documentation on this unfortunately.  I had to 
work most of it out from building installs in Visual Studio (which used 
InstallUtil) and then de-compiling them in Orca to see what was generated 
to perform the custom actions.

HTH,

Bill








From <[EMAIL PROTECTED]> 
08/10/2008 00:30


To
<[EMAIL PROTECTED]>, <nant-users@lists.sourceforge.net>, 
<[EMAIL PROTECTED]>
cc

Subject
Re: [NAnt-users] msi custom actions







Thanks for your reply.
 
I am not sure if I can implement your suggestion but as a workaround I 
created a console application that the EntryPoint in the Main method as a 
wrapper to my custom action.
So, my custom action changed for something like
 
            <customactions>
                        <customaction action=" Installer1CustomAction" 
type="2" source=" Installer1CustomActionBinary" target="Main" />
            </customactions>
 
Now, the point is: Am able to reference other assemblies from my custom 
action assembly?
 
Regards,
Fabricio Santanas
 

From: Bob Archer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 07, 2008 04:06
To: Santana, Fabricio; nant-users@lists.sourceforge.net; 
[EMAIL PROTECTED]
Subject: RE: [NAnt-users] msi custom actions
 
According to MS the target for custom action type 1 is as follows:
 
Target
 
The DLL is called through the entry point named in the Target field of the 
CustomAction table, passing a single argument that is the handle to the 
current install session. The entry point name specified in the table must 
match that exported from the DLL. Note that if the entry function is not 
specified by a .DEF file or by a /EXPORT: linker specification, the name 
may have a leading underscore and a "@4" suffix. The called function must 
specify the __stdcall calling convention.
 
So, I would say that you need to put the name of the function in the DLL 
to run. This is really for C/C++ dlls. Not sure if you can use this for a 
.Net DLL… but you can try it.
 
Here is a list of custom action types and what the target is supposed to 
contain.
 
http://msdn.microsoft.com/en-us/library/aa372048(VS.85).aspx
 
BOb
 
 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 07, 2008 2:18 PM
To: nant-users@lists.sourceforge.net; 
[EMAIL PROTECTED]
Subject: [NAnt-users] msi custom actions
 
Hey all,
 
I have a .net class library that I am trying to configure as a custom 
action in my build script.
The classlibrary contains one InstallerClass that is declared like:
 
Imports System.ComponentModel
Imports System.Configuration.Install
 
<RunInstaller(True)> Public Class Installer1
    Inherits System.Configuration.Install.Installer
 
Public Overrides Sub Install(ByVal savedState As IDictionary)
 
End Sub
 
End Class
 
In my build script I am configuring the custom action like:
 
            <binaries>
                        <binary name=" Installer1CustomActionBinary" 
value="${references.dir}\Installer1.dll" />
            </binaries> 
 
            <customactions>
                        <customaction action=" Installer1CustomAction" 
type="1" source=" Installer1CustomActionBinary" 
target="**************************" />
            </customactions>
 
            <sequences>
                        <sequence type="installexecute" 
action="Installer1CustomAction" value="6510" condition="NOT Installed" />
            </sequences>
 
Where you read ************************* is exactly where I am not sure 
what information to use.
What is the meaning of entry point for a net assembly?
Is it the namespace of the assembly, class name, method name, etc?
I have been trying several different values but the installer always 
displays the error message:
 
Action 15:02:20: Installer1CustomAction. 
Action start 15:02:20: Installer1CustomAction.
Error 1723. There is a problem with this Windows Installer package. A DLL 
required for this install to complete could not be run. Contact your 
support personnel or package vendor.  Action Installer1CustomAction, 
entry: ******************, library: C:\WINDOWS\Installer\MSI7B2.tmp 
MSI (s) (04:60) [15:02:22:177]: Product: -- Error 1723. There is a problem 
with this Windows Installer package. A DLL required for this install to 
complete could not be run. Contact your support personnel or package 
vendor.  Action Installer1CustomAction, entry: **********************, 
library: C:\WINDOWS\Installer\MSI7B2.tmp 
Action ended 15:02:22: SetupFrameworkPactualCustomAction. Return value 3.
Action ended 15:02:22: INSTALL. Return value 3.
 
Could you guys, please, provide me help on this issue.
 
Thanks in advance.
 
Regards,
Fabricio Santana

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Visit our website at http://www.ubs.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.
 
E-mails are not encrypted and cannot be guaranteed to be secure or 
error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses.  The sender 
therefore does not accept liability for any errors or omissions in the 
contents of this message which arise as a result of e-mail transmission. 
If verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities 
or related financial instruments.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's 
challenge
Build the coolest Linux based applications with Moblin SDK & win great 
prizes
Grand prize is a trip for two to an Open Source event anywhere in the 
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users


 

IMPORTANT 
The information contained in this e-mail and any attachments is intended for 
the addressee only
and may contain legally privileged or confidential information. If you are not 
the intended
recipient you must not use, disclose, copy, distribute, alter, or take any 
action in reliance
on the information and Avon Insurance plc will not accept liability for any 
loss or damage howsoever
arising, directly or indirectly in reliance on it and gives no warranty or 
representation as to its
accuracy or reliability. If you are not the addressee, please notify us 
immediately on 01789 202121*
and delete the material from your computer and destroy any copies.

Avon Insurance plc reserves the right to monitor and record incoming and 
outgoing email messages for
the purposes of investigating or detecting unauthorised use of its system and 
ensuring its effective operation.
Avon Insurance plc will not accept liability for any loss or damage as a result 
of any virus being passed on.

Avon Insurance plc (No. 209606).
Registered in England.
Registered Office: Tiddington Road, Stratford-upon-Avon, Warwickshire CV37 7BJ.
Authorised and regulated by the Financial Services Authority.
A member of the NFU Mutual group of companies and the Association of British 
Insurers.
For security and training purposes telephone calls may be recorded and 
monitored.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to