I do this in some MSIs that we deploy strictly silently via Microsoft
system management stuff.

My upgrade block looks like this:

<Upgrade Id="$(var.UpgradeCode)">
    <UpgradeVersion
IgnoreRemoveFailure="yes"
IncludeMinimum="yes"
IncludeMaximum="yes"
Minimum="$(var.MinVersion)"
Maximum="$(var.MaxVersion)"
MigrateFeatures="yes"
Property="UPGRADE_1"
>
    </UpgradeVersion>
</Upgrade>

And also this, which I think matters:

<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize" />
</InstallExecuteSequence>


Then I have a wxi file that I include that contains:

<Include>
<?define ProductName="Wonder-product blah blah blah" ?>
<?define UpgradeCode="{USE-YOUR-OWN-UPGRADE-GUID}" ?>
<?define ProductVersion="1.0.7.0" ?> <!-- Product version. -->
<?define MaxVersion="1.0.7.0" ?> <!-- Highest version this should upgrade.
Most of the time, should be same as ProductVersion.-->
<?define MinVersion="1.0.0.0" ?> <!-- Lowest version this should upgrade.
-->
</Include>

You don't really need the vars and the .wxi file - I just like having the
version numbers, upgrade code and product name all together instead of
scattered around.

I'm pretty sure this is all the stuff that matters to make this work, but
it's been months, and I pretty much just beat on it until it worked.


On Fri, May 30, 2014 at 11:03 AM, Ben Metheny <benmeth...@gmail.com> wrote:

> I have a requirement to allow 'overwrite' of same version. I've tried
> various combinations of <Upgrade>, here is my current:
>
> <Upgrade Id="INSERT_GUID_HERE">
>       <UpgradeVersion OnlyDetect="yes" Property="SELFFOUND"
>         Minimum="1.0.0" IncludeMinimum="yes"
>         Maximum="1.0.0" IncludeMaximum="yes" />
>       <UpgradeVersion OnlyDetect="yes" Property="NEWERFOUND"
>         Minimum="1.0.1" IncludeMinimum="no" />
>     </Upgrade>
>
> and in InstallExecuteSequence I have:
>
>  <RemoveExistingProducts Before="InstallInitialize" />
>
> I think the 'right' thing to do is to require uninstall and then reinstall
> 'manually', but my requirement is to allow user to go through installer
> forms - using custom managed BA - and change values, including
> 'INSTALLLOCATION'. I've been able to handle a 'Modify' operation correctly
> in the BA, showing all required screen with values from previous install
> filled. Is there some way to force MSI to uninstall itself then install
> again? I suppose I could, from the BA, run the msi with /uninstall options
> then run it again with /install options but is this the best way to do
> something like that?
>
> ------------------------------------------------------------------------------
> Time is money. Stop wasting it! Get your web API in 5 minutes.
> www.restlet.com/download
> http://p.sf.net/sfu/restlet
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to