[wix-users] Error in deleting deployed configuration from custom action

ರಾಘವೇಂದ್ರ ಎಸ್ raghavendra.yadavs at gmail.com
Thu Oct 12 03:16:16 PDT 2017


Hi,

I have 3 msi's in a bundle chain. They are getting installed in below
directory:

C:\Program Files (x86)\MyDirectory\A
C:\Program Files (x86)\MyDirectory\B
C:\Program Files (x86)\MyDirectory\C

Now i have a configuration file(A.config) which resides in "A" directory. I
have written following custom action to move A.Config file from A to
MyDirectory so that all the 3 msi's can use common settings.

<CustomAction Id="CopyConfig"
    BinaryKey="CustomActionBinary"
        DllEntry="CopyConfigFile"
        Execute="immediate"
  Return="check"
 />

 <InstallExecuteSequence>
   <Custom Action="CopyConfig" Before="InstallFinalize">
        NOT REMOVE
   </Custom>
 </InstallExecuteSequence>
[CustomAction]
        public static ActionResult CopyConfigFile(Session session)
        {
                string srcPath = "C:\Program Files
(x86)\MyDirectory\A\A.config";
                string destPath = "C:\Program Files
(x86)\MyDirectory\A.config";

                File.Move(srcPath, destPath);

                if(File.Exists(srcPath))
                    File.Delete(srcPath);

                return ActionResult.Success;

        }
>From the log i can see that custom action run successfully and copy
A.Config from A to MyDirectory *and also deleted A.config in A*. After
finishing the installation A.config is getting regenerated again in the A
directory which i don't want.
Any help on how this config is regenerated again?



Warm Regards
Raghavendra S
9900495868


More information about the wix-users mailing list