Thanks, Bill!
 
That helps me quit a lot! - I'll try both ways.
 
Regards,
Tom
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 18 July 2006 12:20 AM
To: Thomas Schroedter
Cc: nant-users@lists.sourceforge.net
Subject: Re: [NAnt-users] MSI Task: Remove all files/folder during uninstall


Hi Tom,

There are two ways to do this.  One is to use the RemoveFile table, and the other is to use a custom action.  The RemoveFile table is probably simpler as it links to the conponents you are installing, but unfortunately it's not directly supported by the <msi> task so you have to use the <tables> element to define it.  Try something like:

<tables>
    <table name="RemoveFile">
        <columns>
            <column name="FileKey" nullable="false" category="Identifier" key="true" description="Primary key used to identify this particular table entry." />
            <column name="Component_" nullable="false" category="Identifier" description="External key the first column of the Component table. This field references the component that controls the file to be removed." />
            <column name="FileName" nullable="true" category="WildCardFilename" description="This column contains the localizable name of the file to be removed. If this column is null, then the specified folder will be removed if it is empty. All of the files that match the wildcard will be removed from the specified directory." />
            <column name="DirProperty" nullable="false" category="Identifier" description="Name of a property whose value is assumed to resolve to the full path to the folder of the file to be removed. The property can be the name of a directory in the Directory table, a property set by the AppSearch table, or any other property that represents a full path." />
            <column name="InstallMode" nullable="false" category="Integer" description="1=Remove only when the associated component is being installed, 2=Remove only when the associated component is being removed, 3=Remove in either case." />
        </columns>
        <rows>
            <row>
                <columns>
                    <column name="FileKey" value="R_MyFiles" />
                    <column name="Component_" value="C_MY_COMPONENT" />
                    <column name="FileName" value="*.*" />
                    <column name="DirProperty" value="D_MY_DIR" />
                    <column name="InstallMode" value="2" />
                </columns>
            </row>
        </rows>
    </table>
</tables>


You can add as many <row> elements in the <rows> element as you wish to define the files and directories to be removed.  see http://msdn.microsoft.com/library/default.asp?url="" fopr more detail on the column values.  I haven't tried this myself, so you may have to play about with it a bit and run your script through msiexec with debug on to get it working.

If you really do need to take the Custom Action approach, then you could write a simple _vbscript_ function to delete the files and folders and add it to your <binaries> table.  Create a custom action of type 6 to execute the script.  Within the script, you will have a Session object provided by the installer, and you can get hold of the properties in the installer via the ProductProperty(string) property on this object.  That should presumably allow you to get hold of the folders/files you need to delete.

HTH,

Bill










From "Thomas Schroedter" <[EMAIL PROTECTED]>@lists.sourceforge.net
Sent by: [EMAIL PROTECTED]

10/07/2006 03:03


To
<nant-users@lists.sourceforge.net>
cc
Subject
[NAnt-users] MSI Task: Remove all files/folder during uninstall






Hi,

I want to add a custom action, which removes all files and folder of my installation during uninstall. Is there a way to add such a custom action inside the msi task? An example would be great!

Thanks,
Tom

****** IMPORTANT ******

This email and any attachments transmitted with it are confidential. If you are not the intended recipient or person responsible for delivering the email to the intended recipient, you are prohibited from disclosing, copying or using the information contained in it. If you have received this email in error, contact us by replying to this email and delete all copies of the message and attachments from your system.

Before opening or using attachments, check them for viruses and defects. We accept no responsibility for any damage caused by any computer viruses or other defects or conditions which may damage or interfere with data, hardware or software with which it might be used. This email and any attachment may have been modified or otherwise interfered with in the course of its transmission. We give no warranty that the integrity of this email has been maintained.

Fiducian Portfolio Services Limited ABN 13 073 845 931 AFS Licence 231101. Email: [EMAIL PROTECTED]


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

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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: Arden Street, Stratford upon Avon, Warwickshire CV37 6WA.
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.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to