[wix-users] WiX Bundle upgrade or install new to run side by side

Harinatha Narisetty harinatha.narisetty at us.abb.com
Thu Feb 2 07:32:56 PST 2017


Why would need to look for 1.2 detect code when I am authoring for 1.2 itself? I am little confused.

Thanks
Hari

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Phill Hogland
Sent: Wednesday, February 01, 2017 3:57 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side


>>Also, What If user has 1.0, 1.1  and now he is installing 1.2


For each bundle I would:


So Bundle_v1.0 would have:

<RelatedBundle Action='Detect' Id='Bundle_v1.0_DetectCode' />


In Bundle_v1.1 I know when authoring that I need to look for v1.0:

<RelatedBundle Action='Detect' Id='$(var.Bundle_v1.1_DetectCode)' />

<RelatedBundle Action='Upgrade' Id='$(var.Bundle_v1.0_UpgradeCode)' />


In Bundle_v1.2 I know when authoring that I need to look for v1.0 or 1.1:

<RelatedBundle Action='Detect' Id='$(var.Bundle_v1.2_DetectCode)' />

<RelatedBundle Action='Upgrade' Id='$(var.Bundle_v1.0_UpgradeCode)' />

<RelatedBundle Action='Upgrade' Id='$(var.Bundle_v1.1_UpgradeCode)' />

In my DetectRelatedBundle handlers I also use the result of authoring Bundle/@Tag for each bundle to help sort out which related bundle I care about, and as Jacob pointed out author the UI as desired and then author the PlanXxx handlers for the action desired for the detected related bundle.

________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Hoover, Jacob <Jacob.Hoover at greenheck.com>
Sent: Wednesday, February 1, 2017 2:12:46 PM
To: WiX Toolset Users Mailing List
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

For me, I normally use wix variables.

Bundle.wxs:
<Bundle Name="..." Version="$(var.ProductVersion)"
  Manufacturer="$(var.Manufacturer)"
  UpgradeCode="$(var.UpgradeCode)"
  IconSourceFile="...">

Bundle.wixproj:

  <PropertyGroup Condition=" ... ">
    <Manufacturer>Foo</Manufacturer>
    <UpgradeCode>0F8E9B51-56F6-47B6-8C15-D748BF21C9A7</UpgradeCode>
    <DefineConstants>
      $(DefineConstants);
      Manufacturer=$(Manufacturer);
      UpgradeCode=$(UpgradeCode);
    </DefineConstants>
  </PropertyGroup>

For each newer bundle that should offer to install an older bundle, it will need a RelatedBundle element telling the newer bundle to search for the older bundle.  Since you are using a custom MBA, you can do your UX however you like to offer check boxes.

As for programmatically adding these, if you define a Property/Variable that is a list of guids to relate to, you might be able to do something like:

<?foreach UpCode in $(var.UpgradeCodes)?>
    <RelatedBundle Id="$(var.UpCode)" Action="Upgrade" /> <?endforeach?>


-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Harinatha Narisetty
Sent: Wednesday, February 01, 2017 1:37 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

Is there any way I can add this programmatically?
Also, What If user has 1.0, 1.1  and now he is installing 1.2

I really want to show 1.0, 1.1 in a listbox with checkboxes and ask users to replace or leave as is or install 1.2 separate... in that case how do I handle RelatedBundle?


Thanks
Hari

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Hoover, Jacob
Sent: Wednesday, February 01, 2017 2:19 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

In the 1.1 Bundle.wxs, add <RelatedBundle Id="d0f125f6-37ab-4ec9-99c4-cb1cbd3447fa" Action="Upgrade" />

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Harinatha Narisetty
Sent: Wednesday, February 01, 2017 12:47 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

I am testing this. My question is If I change the upgrade code for both Bundle and Product for each version.
1. Install 1.0 and 1.1 side by side... works fine.
2. Install 1.1 and remove 1.0, but copy config files from 1.0 to 1.1: For this scenario, how will it detect related bundles? How do I remove 1.0 ?

I posted the little sample on Git here... Can you take a look at and write your comments..

https://github.com/Hnarisetty/WixTest


Thanks
Hari



-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Hoover, Jacob
Sent: Wednesday, February 01, 2017 1:05 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

You could publish it on GitHub. But really all you need to do is parameterize your builds so that the GUID's change or create separate projects for each and manually update the GUID's. I would think you would have a 1.0 branch in git, and when you switch to 1.1, on a new 1.1 branch you would then update the upgrade codes. This would allow you to go back to the 1.0 branch and create a service release for those staying on 1.0.

For the purposes of your test case, it's probably easier to duplicate the Bundle and MSI projects and manually update the GUID's.  Or if your familiar with MSBuild, you could change the wxs to use wix variables and then create a few conditional item groups in the wixproj to pass in the guid and version based upon which version your build is targeting.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Harinatha Narisetty
Sent: Wednesday, February 01, 2017 11:17 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

I am using Burn. I have a simple sample app ready... is there any way to send that to you?
If not.
Here are the files: WixBA.cs is my custom bootstrapper.

InstallationViewModel.cs

        public InstallationViewModel(RootViewModel root)
        {
                WixBA.Model.Bootstrapper.DetectBegin += this.DetectBegin;
                WixBA.Model.Bootstrapper.DetectRelatedBundle += this.DetectedRelatedBundle;
                WixBA.Model.Bootstrapper.DetectComplete += this.DetectComplete;
        }

          private void Bootstrapper_PlanRelatedBundle(object sender, PlanRelatedBundleEventArgs e)
        {
            e.State = RequestState.Present;
        }

        private void DetectBegin(object sender, DetectBeginEventArgs e)
        {
            this.root.DetectState = e.Installed ? DetectionState.Present : DetectionState.Absent;
            WixBA.Model.PlannedAction = LaunchAction.Unknown;
        }

         private void DetectedRelatedBundle(object sender, DetectRelatedBundleEventArgs e)
        {

            code = e.ProductCode;

        }



Bundle.wxs
---------------

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle Name="Awesome Software"
          Version="1.0.1.0"
          Manufacturer="Awesome Company"
          Copyright="(c) All rights reserved."
          UpgradeCode="d0f125f6-37ab-4ec9-99c4-cb1cbd3447fa">

    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
      <Payload SourceFile="..\ConsoleApplication1\bin\Debug\BootstrapperCore.config" />
      <Payload SourceFile="..\ConsoleApplication1\bin\Debug\WpfCustomControlLibrary1.dll"/>
      <Payload SourceFile="..\ConsoleApplication1\bin\Debug\BootstrapperCore.dll"/>
    <Payload SourceFile="..\ConsoleApplication1\bin\Debug\Microsoft.Deployment.WindowsInstaller.dll"/>
    </BootstrapperApplicationRef>

    <WixVariable Id="WixMbaPrereqLicenseUrl"
                 Value=""/>
    <WixVariable Id="WixMbaPrereqPackageId"
                 Value=""/>

    <Chain>
      <MsiPackage SourceFile="$(var.WixTest.TargetPath)"
                  DisplayInternalUI='no'
                  Visible='no'
                  Permanent='no'
                  Compressed='yes'
                  Vital='yes'
                  />
    </Chain>
  </Bundle>
</Wix>

Product.wxs
_________________
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*"
           Name="WixTest"
           Language="1033"
           Version="1.0.1.0"
           Manufacturer="ABB"
           UpgradeCode="abc316ce-f5b2-46bb-abf8-5515053bbd63">
    <Package InstallerVersion="200"
             Compressed="yes"
             InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage='A newer version is already installed.' />
    <MediaTemplate EmbedCab="yes" />

    <Feature Id="ProductFeature"
             Title="WixTest"
             Level="1">
      <ComponentGroupRef Id="ProductComponents" />
    </Feature>
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR"
               Name="SourceDir">
      <Directory Id="ProgramFiles64Folder">
        <Directory Id="WixTest"
                   Name="WixTest1.0.0" />
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents"
                    Directory="WixTest">
      <Component Id="ProductComponent">
        <File Source="$(var.WixTester.TargetPath)" />
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>



Thanks
Hari

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Hoover, Jacob
Sent: Wednesday, February 01, 2017 11:34 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

The list strips attachments.  Your UpgradeCode has to be different for 1.0, 1.1, 2.0, 2.1, etc in order to be able to support side by side installs.  That's why I suggested using burn, so that you could use RelatedBundles to remove the older bundles conditionally.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Harinatha Narisetty
Sent: Wednesday, February 01, 2017 8:50 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

Bundle.wxs:
        UpgradeCode="d0f125f6-37ab-4ec9-99c4-cb1cbd3447fa"
Product.wxs:
        UpgradeCode="abc316ce-f5b2-46bb-abf8-5515053bbd63"

I am not passing anything parameters to MSI...
private void Bootstrapper_PlanRelatedBundle(object sender, PlanRelatedBundleEventArgs e) {
            e.State=RequestState.Present;

}

I have attached my entire test project that is being held with operator for review. Please take a minute to review and advise me.

Thanks lot.


Thanks
Hari

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Hoover, Jacob
Sent: Tuesday, January 31, 2017 11:52 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

What does the upgrade code of each of the MSI's look like?

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Harinatha Narisetty
Sent: Tuesday, January 31, 2017 5:25 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

private void DetectedRelatedBundle(object sender, DetectRelatedBundleEventArgs e) {
            //add all the bundles to a list

}
Currently the above method fires once...as I have one version is already installed.
private void Bootstrapper_PlanRelatedBundle(object sender, PlanRelatedBundleEventArgs e) {
            e.State=RequestState.Present;

}
This is retaining the bundle in Add/remove programs. I can see it. But the underlying MSI is removed and the corresponding folder from program files is removed as well.

What am I doing wrong here?

Bundle file.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle Name="Awesome Software"
          Version="1.0.1.0"
          Manufacturer="Awesome Company"
          Copyright="(c) All rights reserved."
          UpgradeCode="d0f125f6-37ab-4ec9-99c4-cb1cbd3447fa">

    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
      <Payload SourceFile="..\ConsoleApplication1\bin\Debug\BootstrapperCore.config" />
      <Payload SourceFile="..\ConsoleApplication1\bin\Debug\WpfCustomControlLibrary1.dll"/>
      <Payload SourceFile="..\ConsoleApplication1\bin\Debug\BootstrapperCore.dll"/>
    </BootstrapperApplicationRef>

    <WixVariable Id="WixMbaPrereqLicenseUrl"
                 Value=""/>
    <WixVariable Id="WixMbaPrereqPackageId"
                 Value=""/>

    <Chain>
      <MsiPackage SourceFile="$(var.WixTest.TargetPath)"
                  DisplayInternalUI='no'
                  Visible='no'
                  Permanent='no'
                  Compressed='yes'
                  Vital='yes'
                  />
    </Chain>
  </Bundle>
</Wix>


Thanks
Hari
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Hoover, Jacob
Sent: Tuesday, January 31, 2017 5:44 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

1.A/2.A this should happen automatically.
1.B I would use a semi-custom action to schedule the copyfile from the previous install (Ref https://www.joyofsetup.com/2007/07/01/semi-custom-actions/ ) 1.C/2.B
  Capture the intel of related bundles from OnDetectRelatedBundle (Your bundles Should have RelatedBundle elements for prior bundles with either a detect or upgrade action on them)
  Based on the user selection in your BA, respond appropriately in OnPlanRelatedBundle.

Not 100% certain on this but it would seem logical that you could set it to by default always remove the older bundles via Upgrade, and then override this when you want them to stay via OnPlanRelatedBundle.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Harinatha Narisetty
Sent: Tuesday, January 31, 2017 4:33 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

Ok. I changed to have Unique Install folder for each version.
C:\Program files\Company\Product1.0.0
C:\Program files\Company\Product1.1.0
C:\Program files\Company\Product2.0.0
C:\Program files\Company\Product3.0.0

I do see the bundle detect events getting fired. Now how to

1. When earlier version is found. User selection is "Upgrade"
        A. Install this version
      B. Copy the config files from previous version to this version folder
        c. Remove Previous Version
2. When earlier version is found. User selection is "Side by Side"
        A. Install this version
      B. Do not remove previous version

Can you help me with this?

Thanks
Hari

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Hoover, Jacob
Sent: Tuesday, January 31, 2017 5:11 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] WiX Bundle upgrade or install new to run side by side

I don't think you can achieve this with a single MSI, in the manner your describing.  I think the most robust solution would be to have a unique install folder and upgrade code for each upgrade you release(you can still service each upgrade with patches).  Then your problem becomes, if I detect an older version, do I want to merge the configuration from it, as well should I uninstall the old version after upgrading.

The first problem could be solved via a property driven CA in the MSI (assuming the bundle is detecting the old version and allowing the user to choose between a clean install and an upgrade), where you pass the user choice from the BA to the MSI via a Variable and a MsiProperty.

The second problem can be solved again with the bundle detecting and optionally prompting for removal of the old version, in which you want to look at the RelatedBundle* callbacks and element.  This will allow you to relate your newer bundles with all of the prior bundles, and use the callbacks to determine if you only want to detect the related bundle or have it plan to remove it.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Harinatha Narisetty
Sent: Tuesday, January 31, 2017 3:55 PM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] WiX Bundle upgrade or install new to run side by side

Hi,
I have a wix bundle with custom bootstrapper (and several screens) that installs a MSI package. For upgrades, I want to provide an option for user to choose either update the existing version (merge config files) or install as new version. I am not sure how to achieve this. Here are my bundle and prouct wxs files.


Bundle Name='My company software $(var.ShortVersionNumber)'
      Manufacturer='my company(r)'
      Version='$(var.FullVersionNumber)'
      UpgradeCode='D414EA8E-A3BF-44E1-B362-91E34074B55B'
      Compressed='yes'
      Copyright='(c) 2015 mycomapny(r) - All rights reserved'
      AboutUrl='http://www.mycompany.com'
      HelpUrl='http://www.mycompany.com/support'
      IconSourceFile='..\..\abc.ico'
      SplashScreenSourceFile='Splash.bmp'>

all other nodes...
<MsiPackage Id='application' SourceFile='..\Output\en-us\Client.msi'
              DisplayInternalUI='no' Visible='no' Permanent='no' Compressed='yes' Vital='yes'>




The Product.wxs file is

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' ....           >

  <Product Id='*'

       Name='My Company software $(var.ShortVersionNumber)'

       Manufacturer='MyCompany(r)'

       Version='$(var.FullVersionNumber)'

       Language='1033'

       Codepage='65000'

       UpgradeCode='0D126835-8687-4A37-ADB1-EAF28724FFE4'>



I have all the events subscribed in my c# code.

Please give me some direction on how to achieve this.



Thanks
Hari

____________________________________________________________________
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/

____________________________________________________________________
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/

____________________________________________________________________
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