[wix-users] Custom action to backup folder before install

Carlos Sosa carlos.sosa.us at outlook.com
Wed Oct 19 13:43:15 PDT 2016


Thnx for the input, but I still can't get it to work.

The db still gets deleted/replaced everytime.
 
Now there are 2 attributes that have to be set if you don't want the file to
be overwritten Permanent and NeverOverwrite, if these are set to yes, the
file will not be replaced.
However....

On version 1 I did not set those options (and the app has already been
deployed)  so when I run the update v2, it gets overwritten (if I run v3 it
will stay safe)

<Component Id ="BackEnd"
                 Guid="4C2F753B-XXXX-4075-XXXX-E6AC646FBACA"
                 Permanent="yes"
                 NeverOverwrite="yes">
        <File Id ="BackEnd"
              Source ="..\..\Lib\BE.accdb"
              KeyPath ="yes">
          <util:PermissionEx User ="Users"
                             GenericAll="yes"/>
        </File>
      </Component>

I looked at the upgradecode element but there is not much info:
http://wixtoolset.org/documentation/manual/v3/xsd/wix/upgrade.html
I also try some settings under the scheduling attribute
http://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html but
no luck.

I may be missing something.




-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Phil Wilson
Sent: Wednesday, October 19, 2016 12:37 PM
To: 'WiX Toolset Users Mailing List' <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] Custom action to backup folder before install

Exactly, yes. The Windows Installer overwrite rules don't replace files that
have been altered since the install:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa370531(v=vs.85).a
spx

And a similar case with hashing.

Phil  

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Wheeler, Blaine (DSHS/DCS)
Sent: Tuesday, October 18, 2016 3:08 PM
To: 'WiX Toolset Users Mailing List'
Subject: Re: [wix-users] Custom action to backup folder before install

The db wouldn't be overwritten by the installer because it changed from the
original installation if you are doing an upgrade.  Check out the
UpgradeCode and MajorUpgrade element

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Carlos Sosa
Sent: Tuesday, October 18, 2016 12:51 PM
To: 'WiX Toolset Users Mailing List'
Subject: Re: [wix-users] Custom action to backup folder before install

Because the INSTALLFOLDER contains a database that has been modified and I
need to keep.
I was able to do this using a .bat file

Thank you.


-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Wheeler, Blaine (DSHS/DCS)
Sent: Tuesday, October 18, 2016 8:56 AM
To: 'WiX Toolset Users Mailing List' <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] Custom action to backup folder before install

Why?  The installer service creates a restore point and also makes a
roll-back source so it can recover from a failed or cancelled installation.
At the end of the successful installation the roll-back is deleted.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Carlos Sosa
Sent: Monday, October 17, 2016 2:36 PM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] Custom action to backup folder before install


Hello I need to back up the INSTALLFOLDER before upgrade/install.
I'm using a custom action as follows:

<InstallExecuteSequence>
    <Custom Action="BackupDB" After="InstallInitialize" />
</InstallExecuteSequence>


But I cannot seem to be able to define the custom action appropriately

<Fragment>

   <CustomAction Id='BackupDB'
                 BinaryKey='FooBinary'
                 DllEntry='FooEntryPoint'
                 Execute='immediate'
                 Return='check'>


    <CopyFile Id="SomeId" SourceProperty="SOURCEDIRECTORY"
      DestinationDirectory="INSTALLFOLDER" SourceName="*" />


   </CustomAction>



  </Fragment>


Using Visual Studio 2015 and Wix 3.1
Any help is appreciated.
Regards

____________________________________________________________________
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