[wix-users] MoveFiles

Couture-Grenier, Nicolas nicolas.couture-grenier at cgi.com
Wed May 3 10:09:38 PDT 2017


You must include this in your C# code file:
using Microsoft.Deployment.WindowsInstaller

Mark your methods with the [CustomAction] attribute. The return type is ActionResult and it should take a Session object as parameter.

Compile to a DLL and reference your custom action project inside your setup project.

In your wix file, use a Binary element to reference your DLL file; SourceFile attribute set to $(var.<INSERT PROJECT NAMESPACE HERE>.TargetDir)<INSERT DLL FILE NAME HERE>. Reference your Binary's Id in the BinaryKey attribute of a CustomAction element and put the name of your method in the DllEntry attribute. The Execute attribute of the CustomAction element must be "deferred" and Impersonate="no" so as to allow your custom action to run with elevated privileges since we're moving files.

I also found the UPGRADINGPRODUCTCODE property useful to conditionally trigger my action upon uninstallation during an upgrade.

I hope this helps.

-----Message d'origine-----
De : wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] De la part de Carlos Sosa
Envoyé : 3 mai 2017 12:44
À : WiX Toolset Users Mailing List
Objet : Re: [wix-users] MoveFiles

You don't have to share your installer name or guis or anything like that, just the overall implementation.......
Hope you find some help to your issue.
Best.


-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Couture-Grenier, Nicolas
Sent: Wednesday, May 3, 2017 10:28 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] MoveFiles

Sorry, I can't share it.

-----Message d'origine-----
De : wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] De la part de Carlos Sosa Envoyé : 3 mai 2017 12:21 À : WiX Toolset Users Mailing List Objet : Re: [wix-users] MoveFiles

I had to use a Bundle , to do that.
Could you share how you implemented the Custom Action? I tried and Couldn't get it to work (not even compile :(
    
<Chain>
      <!--BackUp-->
      <PackageGroupRef Id='BackUp' />
      <!--Prerequisite 1-->
      <PackageGroupRef Id='RunTime' />
      <!--Prerequisite 2-->
      <PackageGroupRef Id='Patch' />
      <!--Prouct 3-->
      <MsiPackage SourceFile='$(var.Installer.TargetPath)'></MsiPackage>
      <!--Restore-->
      <PackageGroupRef Id='Restore' />
  </Chain>



-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Couture-Grenier, Nicolas
Sent: Wednesday, May 3, 2017 10:15 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] MoveFiles

Ok. It's because I need to backup files from a previous installation during an upgrade and then restore them in the new installation. I'm using a custom action in C# at the moment, but this causes an ICE63 warning that I can't get rid of and I thought MoveFiles could have helped me.

-----Message d'origine-----
De : wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] De la part de Hoover, Jacob Envoyé : 3 mai 2017 11:45 À : WiX Toolset Users Mailing List Objet : Re: [wix-users] MoveFiles

Yes... You use CopyFiles.  MoveFiles is for scheduling the sequence, as it's only valid parent is the InstallExecuteSequence and for most use cases you should never have to touch it.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Couture-Grenier, Nicolas
Sent: Wednesday, May 03, 2017 10:22 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] MoveFiles

No, http://wixtoolset.org/documentation/manual/v3/xsd/wix/movefiles.html

-----Message d'origine-----
De : wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] De la part de Hoover, Jacob Envoyé : 3 mai 2017 11:18 À : WiX Toolset Users Mailing List Objet : Re: [wix-users] MoveFiles

http://wixtoolset.org/documentation/manual/v3/xsd/wix/copyfile.html ?


-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Couture-Grenier, Nicolas
Sent: Wednesday, May 03, 2017 10:12 AM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] MoveFiles

How should I proceed to use the MoveFiles element? There seems to be little documentation on this topic.

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

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

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

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

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

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

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

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



More information about the wix-users mailing list