Pavan,

I have run into this myself, and assuming it is not a user-modified file, it is 
usually caused by a 'patch' or previous install that was performed which did 
not use Windows Installer. You can also encounter this issue in the field when 
upgrading from a previous scripted setup which was upgraded, and migrate to 
Windows Installer. This can be tricky to test, because the Windows Installer 
upgrade from the previous version will work in fine the lab, but fail 
mysteriously in the field. The root cause is often a previous field upgrade 
which changed the date modified to later. Windows Installer service plays a 
trick by always resetting creation date to date modified, which avoids the 
issue in its upgrade path.

There are several ways to handle this:
Adding files to the RemoveFile table is the first (and perhaps preferred) 
way.You can also artificially -- read 'fake' -- version your files to be 
replaced in the installer File table. This will cause the file versioning rules 
to be enforced as if was replacing a nonversioned file. [Version always wins 
over nonversioned.]Update your installer (or system) to use 
REINSTALLMODE=e[mus] or REINSTALLMODE=a[mus]. The installer uses the file 
versioning rules specified by the REINSTALLMODE property when installing, 
reinstalling, or repairing a file. Use extreme caution here. The 'e' will do 
equal or older file version, but the 'a' will always overwrite. This is for all 
files, and could result in overwriting a new file. The 'a' is almost never 
recommended, as you could have a merge module or other dependency updating a 
system file which may inadvertently cause a downgrade.


The documented information on file versioning regarding datetime stamps often 
blogged about is sometimes misleading. If the creation datestamp is newer than 
the modified datestamp, the file will still be replaced. Technically, the file 
did not change, it was just copied over to a new source. However, the issue 
you're experiencing was a post creation change or update.


https://msdn.microsoft.com/en-us/library/aa368599.aspx


-Matt

> From: pavan.kond...@accelrys.com
> To: wix-users@lists.sourceforge.net
> Date: Tue, 5 May 2015 15:37:54 -0700
> Subject: Re: [WiX-users] File not getting overwritten
> 
> So what is the best way to overwrite the files that I want?
> Using the "Remove File" element for each of those files?
> 
> --Pavan
> 
> -----Original Message-----
> From: Phil Wilson [mailto:phildgwil...@gmail.com]
> Sent: Tuesday, May 05, 2015 2:57 PM
> To: General discussion about the WiX toolset.
> Subject: Re: [WiX-users] File not getting overwritten
> 
> Correct, docs here:
> https://msdn.microsoft.com/en-us/library/aa370531(v=vs.85).aspx
> ---------------
> Phil Wilson
> 
> 
> On Tue, May 5, 2015 at 12:07 PM, Pavan Konduru <pavan.kond...@accelrys.com> 
> wrote:
> > Thank you Phil for your response.
> > >From what I get you are saying:
> >         --There is a file X on a system
> >         --User modifies it at some point in time
> >         --Installer checks that this file has been modified since being 
> > installed and does not overwrite it?
> >
> > --Pavan
> >
> > -----Original Message-----
> > From: Phil Wilson [mailto:phildgwil...@gmail.com]
> > Sent: Tuesday, May 05, 2015 11:59 AM
> > To: General discussion about the WiX toolset.
> > Subject: Re: [WiX-users] File not getting overwritten
> >
> > You might be misunderstanding "check for modified dates". The absolute 
> > values are irrelevant. There is no "later version" based on later dates. An 
> > unversioned file will not be overwritten if its modified date is different 
> > to its creation date, no matter what the values are.
> > Windows Installer will set modified and creation dates the same at install 
> > time so it can see that the file has been altered.
> >
> > ---------------
> > Phil Wilson
> >
> >
> > On Tue, May 5, 2015 at 10:54 AM, Pavan Konduru <pavan.kond...@accelrys.com> 
> > wrote:
> >> Hi All,
> >>
> >> We have an installer that basically is trying to overwrite some files that 
> >> is on the host system. The files that are being overwritten were not 
> >> installed by the installer.
> >> When I run my installer, all these files get overwritten. On one 
> >> particular machine, these files don't seem to be overwritten no matter 
> >> what. Here is a log entry for one of the files.
> >>
> >> File: C:\Program Files\xxx \lib\xxx.jar;   Won't Overwrite;             
> >> Won't patch;      Existing file is unversioned but modified
> >>
> >> All the other machines where I have run the installer this is the log, 
> >> where it gets overwritten:
> >>
> >> File: C:\Program Files \xx \lib\xxx.jar;     Overwrite;           Won't 
> >> patch;      Existing file is unversioned and unmodified - hash doesn't 
> >> match source file
> >>
> >> As per the MSI policy for overwriting files if they don't have versions is 
> >> to check for the modified dates. The file on system has a 2014 date and 
> >> the file from the installer has a 2015 date. The hashes don't match as the 
> >> file content has changed. So, why is the file not being replaced?
> >>
> >> --Pavan
> >>
> >> This email and any attachments are intended solely for the use of the 
> >> individual or entity to whom it is addressed and may be confidential 
> >> and/or privileged.
> >>
> >> If you are not one of the named recipients or have received this
> >> email in error,
> >>
> >> (i) you should not read, disclose, or copy it,
> >>
> >> (ii) please notify sender of your receipt by reply email and delete
> >> this email and all attachments,
> >>
> >> (iii) Dassault Systemes does not accept or assume any liability or 
> >> responsibility for any use of or reliance on this email.
> >>
> >> For other languages, go to http://www.3ds.com/terms/email-disclaimer
> >> ---------------------------------------------------------------------
> >> -
> >> -------- One dashboard for servers and applications across
> >> Physical-Virtual-Cloud Widest out-of-the-box monitoring support with
> >> 50+ applications Performance metrics, stats and reports that give you
> >> Actionable Insights Deep dive visibility with transaction tracing
> >> using APM Insight.
> >> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> >> _______________________________________________
> >> WiX-users mailing list
> >> WiX-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> > ----------------------------------------------------------------------
> > -------- One dashboard for servers and applications across
> > Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ 
> > applications Performance metrics, stats and reports that give you 
> > Actionable Insights Deep dive visibility with transaction tracing using APM 
> > Insight.
> > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> > This email and any attachments are intended solely for the use of the 
> > individual or entity to whom it is addressed and may be confidential and/or 
> > privileged.
> >
> > If you are not one of the named recipients or have received this email
> > in error,
> >
> > (i) you should not read, disclose, or copy it,
> >
> > (ii) please notify sender of your receipt by reply email and delete
> > this email and all attachments,
> >
> > (iii) Dassault Systemes does not accept or assume any liability or 
> > responsibility for any use of or reliance on this email.
> >
> > For other languages, go to http://www.3ds.com/terms/email-disclaimer
> >
> > ----------------------------------------------------------------------
> > -------- One dashboard for servers and applications across
> > Physical-Virtual-Cloud Widest out-of-the-box monitoring support with
> > 50+ applications Performance metrics, stats and reports that give you
> > Actionable Insights Deep dive visibility with transaction tracing
> > using APM Insight.
> > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications Performance 
> metrics, stats and reports that give you Actionable Insights Deep dive 
> visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
> This email and any attachments are intended solely for the use of the 
> individual or entity to whom it is addressed and may be confidential and/or 
> privileged.
> 
> If you are not one of the named recipients or have received this email in 
> error,
> 
> (i) you should not read, disclose, or copy it,
> 
> (ii) please notify sender of your receipt by reply email and delete this 
> email and all attachments,
> 
> (iii) Dassault Systemes does not accept or assume any liability or 
> responsibility for any use of or reliance on this email.
> 
> For other languages, go to http://www.3ds.com/terms/email-disclaimer
> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
                                          
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to