[wix-users] (no subject)

John Cooper JoCooper at jackhenry.com
Wed Jul 27 06:04:12 PDT 2016


Is it started in the UI sequence (from a control)?  If so, there will be no logging.

--
John Merryweather Cooper
Senior Software Engineer -- Integration Development Group -- Enterprise Notification Service
Jack Henry & Associates, Inc.® | Lenexa, KS  66214 | Office:  913-341-3434x431050
JoCooper at jackhenry.com




-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Shintaro Takechi
Sent: Tuesday, July 26, 2016 7:43 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: [wix-users] (no subject)

The e-mail below is from an external source.  Please do not open attachments or click links from an unknown or suspicious origin.

Hi

I have very basic WiX Custom Action and .wxs file that is only running that custom action.

    <?xml version="1.0" encoding="UTF-8"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="WiXFileCopyTest" Language="1033"
Version="1.0.0.0" Manufacturer="testCompany"
UpgradeCode="012423ee-b380-4fce-9c79-1cc8fe6c5923">
    <Package InstallerVersion="200" Compressed="yes"
InstallScope="perMachine" />
         <Binary Id="DirectoryTreeCopyWiXCustomActionDLL"
SourceFile="$(var.DirectoryTreeCopyWiXCustomAction.TargetDir)DirectoryTreeCopyWiXCustomAction.CA.dll"
/>

        <CustomAction Id="CA_DirectoryTreeCopy"
                      BinaryKey="DirectoryTreeCopyWiXCustomActionDLL"
                      DllEntry="CopyDirectoryTree"
                      Execute="immediate"
                      Return="check"/>
         <InstallExecuteSequence>
        <Custom Action="CA_DirectoryTreeCopy"
                After="InstallInitialize"/>
        </InstallExecuteSequence>
    </Product>
    </Wix>

Following is the C# implementation of custom action.

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Microsoft.Deployment.WindowsInstaller;
    using System.IO;

    namespace DirectoryTreeCopyWiXCustomAction
    {
        public class CustomActions
        {
            [CustomAction]
            public static ActionResult CopyDirectoryTree(Session session)
            {
                session.Log("Begin CopyDirectoryTree");

                var EtapUserPath =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"test\\");
                var SourcePath = Path.Combine(EtapUserPath, "test 1.1\\");
                var DestinationPath = Path.Combine(EtapUserPath, "test 1.2\\");

                //Now Create all of the directories
                foreach (string dirPath in Directory.GetDirectories(SourcePath, "*", SearchOption.AllDirectories))
                    Directory.CreateDirectory(dirPath.Replace(SourcePath,
DestinationPath));

                //Copy all the files & Replaces any files with the same name
                foreach (string newPath in Directory.GetFiles(SourcePath, "*.*", SearchOption.AllDirectories))
                    File.Copy(newPath, newPath.Replace(SourcePath, DestinationPath), true);

                return ActionResult.Success;
            }
        }
    }


Of course, I do have the references on my wix project set to the DirectoryTreeCopyWiXCustomAction project, so that is out of equation.

I have tested the code so I know that the main C# code is functioning.

I opened the result msi and saw that CustomAction exist in the msi.

When I output the log, I do not see anywhere that states "Begin CpyDirectoryTree".

I just cannot figure out how to make the custom action work.

Seems extremely straight forward, but it is not working for me.

Thank you

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

NOTICE: This electronic mail message and any files transmitted with it are intended
exclusively for the individual or entity to which it is addressed. The message, 
together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution 
is strictly prohibited. If you have received this message in error, please 
immediately advise the sender by reply email and delete all copies.



More information about the wix-users mailing list