[wix-users] Update version number not via MSI / uninstall same-upgrade-code MSI when uninstalling

Alon Dean alondean at gmail.com
Tue Oct 12 08:26:15 PDT 2021


Hi again, Nir

If you can spare some time to help me:
As I mentioned before, I need to update the version number of an already
installed msi.
You suggested I'll use a patch, and the POC worked as expected, but:
In order to create a patch, I need the original and new msi in order to
create a sort of diff between the two, from which the patch will be created
- that is if I got this right.

But the problem is, I don't have access to, or knowledge of, the original
msi AND the new msi. Since I don't need to change any file etc. and only
need to set a new version number, in theory, I should be fine :)

So I tried the minor upgrade approach.
I successfully created a minor upgrade msi which successfully updates the
version number in the control panel:
It has the same product code as the original msi (I can assume I'll have
access to it when creating the minor upgrade), and I install it via:
"msiexec /i update.msi REINSTALLMODE=v

But the problem is, an uninstall of the upgrade doesn't trigger an
uninstall of the original msi and I guess that's because I see the original
msi is being deleted from the Windows\Installer directory, and it doesn't
exist anymore.
I also guess the original msi is deleted cause they both have the same
product code?

So I thought I'll implement the same uninstallation process from the
original msi at the upgrade msi but this can't be done also, cause it is
composed of custom actions which are implemented in a dll which I don't
have access to when creating the update msi.

I'm sorry for the long explanation, this is a very complicated situation
(mistakes were made), and the while windows installer world is new to me
and I'm learning on the go.

So:
1. Is there a way to create a patch that only updates the version number at
the control panel, without having possession of the original and new msi?
2.Is there a way to create some kind of an upgrade which only updates the
version number in the control panel, but which will still be able to remove
the original msi when it is being removed?

Thank you very much!!
Alon


On Sun, Oct 3, 2021 at 6:54 PM Alon Dean <alondean at gmail.com> wrote:

> Thank you! I was able to create a POC which updates the version number via
> a patch
>
> On Sun, Oct 3, 2021 at 1:26 PM Nir Bar via wix-users <
> wix-users at lists.wixtoolset.org> wrote:
>
>> The best-practice solution would be to use a patch package (.msp) for the
>> hotfix instead of the custom mechanism you're using
>>
>> The patch package includes only changed and added files, so it is small
>> in size
>>
>> Additionally, it updates the version number to the new one without
>> needing to hide and add any entry
>>
>> See https://docs.microsoft.com/en-us/windows/win32/msi/patch-packages
>>
>>
>>
>> --
>>
>> Nir Bar
>>
>> WiX Expert
>>
>>
>>
>>
>>
>> ---- On Sun, 03 Oct 2021 11:33:40 +0300 Alon Dean via wix-users <
>> wix-users at lists.wixtoolset.org> wrote ----
>>
>>
>> Hi,
>> I know the title may be confusing, so let me explain what I'm trying to
>> accomplish:
>> (At my work) I created a hybrid MSI - It does *some* of the installation
>> operations, and the rest of the operations are being performed by custom
>> actions.
>> This was done as part of my task of embedding a software-update mechanism
>> to our application (using squirrel.windows)
>>
>> The problem is that when an update occurs, it doesn't involve the MSI in
>> any way - so the client gets a new version (not via MSI), and the MSI
>> doesn't reflect that in the version number at the control panel (from the
>> registry)
>> So I need to find a solution for that...
>>
>> I've seen this SO question and the answers to it:
>>
>> https://stackoverflow.com/questions/28195435/update-installed-msi-version-from-exe
>>
>> I don't want to hack the registry for that, what I would like to do is:
>>
>> Create another small MSI, with a version number that will be changed
>> according to the update's version number.
>> Once an update is installed, this MSI will also be installed, adding an
>> entry to the control panel with the *correct* version number.
>> Then, I'll need to hide the 'main' MSI from the control panel.
>>
>> My problem is: how to make the new, small MSI uninstall the 'main' MSI
>> once
>> uninstalling?
>> I know this is related to the upgrade code but not sure how to accomplish
>> it.
>>
>> And overall, would you say, given the assumption that my updates'
>> framework
>> doesn't involve the MSI, that I'm taking the right approach?
>>
>> Any help would be much appreciated
>> Thanks!
>> Alon
>>
>> ____________________________________________________________________
>> 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