[wix-users] Replacing newer files
Phil Wilson
phil.wilson at mvps.org
Sat Jun 11 10:32:46 PDT 2016
The problem scenario is very unclear. It might be a major upgrade, but that
isn't explicitly stated. Also, if the problem is to make a new MSI that
replaces the previous product, then do a major upgrade and sequence it after
InstallInitialize so that it removes all the old files then installs the new
files. It's also possible that "I made the same MSI but this time it did not
replace the files" means literally that, so nothing at all is happening
because it's an attempt to install the exact same product with the same
ProductCode, which will send it into maintenance mode, and the default
action might be uninstall.
The original question asked about "replacing older files" without defining
what "older" means, because there is no "older" in Windows Installer.
Whether a file is "newer" has nothing to do with overwrite rules. The only
way to properly deal with this in the case of binaries that can be versioned
is to actually USE file versions in build systems and increment them when
they are changed, then build patches, major upgrades.
So there are probably several solutions that do not require "amus" to be
used at all. I've seen "amus" do some truly dreadful things, many of them
merge module related, where critical Dlls from Microsoft (with security
fixes in them) and Crystal Reports were replaced by obsolete versions from
an "amus" install. Similarly, shared versions of the customers own products
in Common Files were reverted to older versions! "amus" really is the worst
possible way to fix the issue - I don't think there is a solution that is
worse.
Phil W
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Walter Dexter
Sent: Friday, June 10, 2016 11:16 AM
To: WiX Toolset Users Mailing List
Subject: Re: [wix-users] Replacing newer files
Be warned that you can really, really mess up your installed result with
"amus."
It tells Windows Installer "I don't care what you think, just install this."
Windows Installer is actually pretty smart and will usually do the right
thing.
I would look at the RemoveFile solution again. You may need to tweak order,
or may have messed up your components, becasue it should work. Do a detailed
log (/l*v or /l*xv) and try to figure out why it isn't replacing the others.
It'll be in there.
In my (far from expert) opinion, only use "amus" if you have a controlled
environment (like you're creating installers for internal use and you have
control over when it's run or not run.)
I'm still recovering from our deployment team sending out version 1.1 with
REINSTALLMODE="amus" and installing on top of version 1.2.
They did it to 14,000 systems that are scattered all over the US. The thing
that seems to fix it the easiest is to install version 1.3.
On Fri, Jun 10, 2016 at 6:22 AM, Winter,Stijn S. de <
stijn.dewinter at student.fontys.nl> wrote:
> This works like I wanted, thanks
>
> Kind regards,
> Stijn de Winter
> ________________________________________
> Van: wix-users <wix-users-bounces at lists.wixtoolset.org> namens James
> Buchan <James.Buchan at servelec-synergy.com>
> Verzonden: vrijdag 10 juni 2016 12:26
> Aan: WiX Toolset Users Mailing List
> Onderwerp: Re: [wix-users] Replacing newer files
>
> This should do the trick:
> <Property Id="REINSTALLMODE" Value="amus"/>
>
> But please be sure that you understand what it will do (and if/how it
> will impact your users).
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/aa371182(v=vs
> .85).aspx
>
>
> James Buchan
> Development Engineer
>
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On
> Behalf Of Winter,Stijn S. de
> Sent: 10 June 2016 10:56
> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> Subject: Re: [wix-users] Replacing newer files
>
> Okay i tried this.
>
> But i encountered a problem:
> When running the MSI which replaces the files ONLY older files will be
> replaced.
> I made the same MSI but this time it did not replace the files,
> instead it only removed it. Same code for removal!
> This way all files are removed.
>
> This is ofcourse not the way I want it. Ideas?
>
> Kind regards,
> Stijn de Winter
> ________________________________________
> Van: wix-users <wix-users-bounces at lists.wixtoolset.org> namens Phill
> Hogland <phill.hogland at rimage.com>
> Verzonden: dinsdag 7 juni 2016 15:00
> Aan: WiX Toolset Users Mailing List
> Onderwerp: Re: [wix-users] Replacing newer files
>
> First it would be good to clarify that this is not a wix behavior but
> defined behavior of MSI.
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/aa368599(v=vs
> .85).aspx
>
> There may be other approaches to this issue depending on your exact
> requirements, but when I need to 'always overwrite' a file I use the
> following pattern:
>
> <Component Id="someid" Directory="myDir" >
> <!-- Always Overwrite pattern, otherwise file copy is skipped
> for unversioned-modified file. . -->
> <RemoveFile Id="remove_fileid" Name="file.ext" On="install" />
> <File Id="fileid" Source="!(bindpath.name)\file.ext" />
> </Component>
>
> I do this rarely, but I do have a scenario where this pattern is used.
> ________________________________________
> From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of
> Winter,Stijn S. de <stijn.dewinter at student.fontys.nl>
> Sent: Tuesday, June 7, 2016 7:10:00 AM
> To: WiX Toolset Users Mailing List
> Subject: [wix-users] Replacing newer files
>
> Hello All,
>
>
> My installer has to replace some files, some files are newer than the
> one it will be replaced with.
>
> WiX seems to refuse to do this. Can I force WiX to overwrite existing
> files?
>
>
> Kind regards,
>
> Stijn de Winter
>
>
> ==========================================================
> Op deze e-mail zijn de volgende voorwaarden van toepassing:
> http://www.fontys.nl/disclaimer
> The above disclaimer applies to this e-mail message.
>
> ____________________________________________________________________
> 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