[wix-users] How to Detect if Bundle is Being Upgraded vs Uninstalled

Edwin Castro egcastr at gmail.com
Tue Apr 28 15:41:35 PDT 2020


This might help:

https://support.firegiant.com/hc/en-us/articles/230912327-How-the-InstallCondition-attribute-is-used-


--
Edwin G. Castro


On Tue, Apr 28, 2020 at 3:33 PM Kristoffer M <kristofferm2929 at gmail.com>
wrote:

> I'm currently doing that exact thing now. I have a DetectCondition that
> checks if it already exists. But during and upgrade and an uninstall, the
> package will exist in both cases and will therefore run the
> UninstallArgument. This is the behavior I want during an uninstall but not
> during an upgrade. I'd like the bundle to just do nothing to this
> ExePackage during an upgrade (basically completely ignore it during
> upgrade).
>
> On Tue, Apr 28, 2020 at 3:21 PM Edwin Castro <egcastr at gmail.com> wrote:
>
>> I was under the impression that all packages are installed after planning
>> and that all planning occurs after all detections.
>>
>> Any who, perhaps you can do a product search or registry search or other
>> some search that tells you that this ExePackage is already installed
>> (really, the bundle doesn't matter does it?) and set DetectCondition on
>> that ExePackage based on the results of that search. If the ExePackage is
>> already installed as would be the case during an upgrade, then it properly
>> detects it as already installed and doesn't try to run the ExePackage
>> again. If something else already installed that ExePackage before your
>> bundle installed it, then would you want to install it again? I'd guess
>> probably not.
>>
>> --
>> Edwin G. Castro
>>
>>
>> On Tue, Apr 28, 2020 at 2:33 PM Kristoffer M <kristofferm2929 at gmail.com>
>> wrote:
>>
>>> Hi Edwin,
>>>
>>> Thank you for your reply. The WixBunleInstalled would be set to true in
>>> the instances of upgrade and uninstall so I don't think this can be used to
>>> differentiate one over the other. BOOTSTRAPPER_ACTION, according to the
>>> documentation, is "updated during the call to IBootstrapperEngine::Plan()".
>>> This is an issue for me because ExePackage, if I understand correctly,
>>> executes before Plan().
>>>
>>> On Tue, Apr 28, 2020 at 8:52 AM Edwin Castro <egcastr at gmail.com> wrote:
>>>
>>>> See
>>>> https://wixtoolset.org/documentation/manual/v3/bundle/bundle_built_in_variables.html
>>>>
>>>>
>>>> Perhaps WixBundleInstalled and/or WixBundleAction would be helpful.
>>>>
>>>> The BOOTSTRAPPER_ACTION enum is defined at
>>>>
>>>>
>>>> https://github.com/wixtoolset/wix3/blob/develop/src/burn/inc/IBootstrapperEngine.h
>>>>
>>>> --
>>>> Edwin G. Castro
>>>>
>>>>
>>>> On Tue, Apr 28, 2020 at 7:36 AM Kristoffer M via wix-users <
>>>> wix-users at lists.wixtoolset.org> wrote:
>>>>
>>>>> Hello All,
>>>>>
>>>>> I am using a bundle to install a couple MSI packages and some
>>>>> prerequisites. One of the prerequisites is a program that uses
>>>>> InstallShield to install it. The bundle uses an ExePackage element with
>>>>> CommandLine conditions to call the installshield installer based on if
>>>>> something else exists.
>>>>>
>>>>> Installing and Uninstalling the bundle works just fine but there are
>>>>> issues
>>>>> that occur during the upgrade process. Is there a way to detect if the
>>>>> bundle is being upgraded vs uninstalled. I want the ExePackage to
>>>>> basically
>>>>> do nothing during the upgrade. When using the Product element, there
>>>>> are
>>>>> certain properties that can be leveraged such as 'INSTALLED', 'NOT
>>>>> REINSTALL', 'REMOVE=ALL', ect... Are there similar properties that can
>>>>> be
>>>>> used in the bundle element?
>>>>>
>>>>> Thanks very much!
>>>>>
>>>>> ____________________________________________________________________
>>>>> WiX Toolset Users Mailing List provided by FireGiant
>>>>> http://www.firegiant.com/
>>>>>
>>>>



More information about the wix-users mailing list