I'm starting out with the wix installer and got a setup project working.
The msi works in such a way that it uninstall a previous version if present
and then installs the new version.

Now, when trying to creating a managed bootstrapper application to
customize the installer experience I'm having a hard time understaning how
everything works together. From this blog post:

http://bryanpjohnston.com/2012/09/28/custom-wix-managed-bootstrapper-application/

I successfully set up a managed bootstrapper application and it works ok
but for starters I have a question (there will be more for sure ;-)

- When the bundle is installed it shows up in the "Uninstall programs and
features" list. The problem is that if I rebuild the solution so that a new
bundle installer is created it's installed side by side with the first
installation. Even if I don't change upgradecode or version of the bundle
between builds. I would like the previous installation to be automatically
uninstalled and then the new bundle to be installed. How can this be done?
The msi-file that is added in the bundle does just that; it checks for a
previous version and uninstall it but that does not happen for the
installed bundle.

Below is the "Bundle.wxs":

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"; xmlns:util="
http://schemas.microsoft.com/wix/UtilExtension"; xmlns:bal="
http://schemas.microsoft.com/wix/BalExtension";>
  <Bundle Name="My Test Application" Version="1.0.0.0" Manufacturer="Bryan"
UpgradeCode="C82A383C-751A-43B8-90BF-A250F7BC2863" >
    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
      <Payload SourceFile="..\TestBA\BootstrapperCore.config"/>
      <Payload SourceFile="..\TestBA\bin\x86\Debug\TestBA.dll"/>
      <Payload
SourceFile="..\TestBA\bin\Release\GalaSoft.MvvmLight.WPF4.dll"/>
      <Payload
SourceFile="..\External\Microsoft.Deployment.WindowsInstaller.dll"/>
    </BootstrapperApplicationRef>

    <Chain>
      <PackageGroupRef Id='Netfx45'/>
      <MsiPackage SourceFile="..\Installer\bin\Debug\Installer.msi"
Id="DummyInstallationPackageId" Cache="yes" Visible="yes"/>
    </Chain>
  </Bundle>

  <Fragment>
    <!-- Managed bootstrapper requires .NET as a dependency, since it was
written in .NET.
       WiX provides a Bootstrapper for the bootstrapper. The fragment below
includes .NET.
       For more information or examples see Heath Stewart's blog or the WiX
source:

http://blogs.msdn.com/b/heaths/archive/2011/10/28/introducing-managed-bootstrapper-applications.aspx
       -->

    <WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />

    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework
Setup\NDP\v4\Full" Value="Version" Variable="Netfx4FullVersion" />
  <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework
Setup\NDP\v4\Full" Value="Version" Variable="Netfx4x64FullVersion"
Win64="yes" />

<!-- .NET 4.5 only installed if Vista or higher AND it's not already
installed-->
<PackageGroup Id="Netfx45">
  <ExePackage Id="Netfx45" Cache="no" Compressed="yes" PerMachine="yes"
Permanent="yes" Vital="yes" InstallCommand="/q"
              SourceFile="..\External\dotNetFx45_Full_setup.exe"
              DetectCondition="(Netfx4FullVersion=&quot;4.5.50709&quot;)
AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))"
              InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0)
AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR
Netfx4x64FullVersion=&quot;4.5.50709&quot;))"/>
</PackageGroup>
  </Fragment>

</Wix>

Thanks for help!
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to