[wix-users] Silent Upgrade Issue

Hoover, Jacob Jacob.Hoover at greenheck.com
Wed Jul 11 12:33:40 PDT 2018

Make 2 MSI's?  You can't have half of one version of a MSI, and half of a previous version of the same product.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Ven H via wix-users
Sent: Wednesday, July 11, 2018 12:43 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Ven H <venh.123 at gmail.com>
Subject: [wix-users] Silent Upgrade Issue

I have a Product.wxs file as below.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="CACFB702-D5E1-4B27-82AE-C843E6423688"
Name="SilentInstallSample" Language="1033" Version=""
Manufacturer="Silent Installer"
    <Package InstallerVersion="200" Compressed="yes"
InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallExecute" />
    <MediaTemplate EmbedCab="yes" />

    <Property Value="1" Id="MSIUSEREALADMINDETECTION"/>
    <Property Value="1" Id="MSIFASTINSTALL"/>
    <Property Value="v" Id="MsiLogging"/>
    <Property Value="0" Id="INSTALL_APP" />
    <Property Value="0" Id="INSTALL_DB" />

    <Feature InstallDefault="local" Description="App Feature Description"
Title="App Feature" Level="1" Id="AppFeature" Absent="allow"
AllowAdvertise="no" Display="expand">
      <ComponentGroupRef Id="AppCG"/>
    <Feature InstallDefault="local" Description="DB Feature Description"
Title="DB Feature" Level="1" Id="DBFeature" Absent="allow"
AllowAdvertise="no" Display="expand">
      <ComponentGroupRef Id="DbCG"/>
  <Binary Id="SetFeatureCADLL"
SourceFile="$(var.SolutionDir)SetFeatureCA\bin\debug\SetFeatureCA.CA.dll" />
  <CustomAction Id="CA_SetFeature" BinaryKey="SetFeatureCADLL"
DllEntry="SetFeatures" Execute="immediate" Return="check" />
    <Custom Action="CA_SetFeature"
Before="LaunchConditions"><![CDATA[(UILevel <= 3) AND (NOT REMOVE~="ALL")]]></Custom>

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR">
          <Directory Id="APP_DIR" Name="SilentInstallApp" />
        <Directory Id="DB_DIR" Name="SilentInstallDB">
          <Directory Id="DB_LOG_DIR" Name="Log" />

    <ComponentGroup Id="AppCG" Directory="APP_DIR">
      <Component Id="AppCmp" Guid="F21E7372-C85D-4708-8874-A4F6E571442C">
        <File Id="SampleTxt" Name="Sample.txt"
Source="SilentInstallApp\Sample.txt" KeyPath="yes"/>
    <ComponentGroup Id="DbCG" Directory="DB_DIR">
      <Component Id="DBCmp" Guid="587B85F9-C545-4660-B8EA-1CCEFE50E539">
        <File Id="StringSearchSQL" Name="StringSearch.sql"
Source="SilentInstallDB\StringSearch.sql" KeyPath="yes"/>

I also have a Custom Action as below.

        public static ActionResult SetFeatures(Session session)
                session.Log("Begin SetFeatures CA...");
                session["ADDLOCAL"] = "ALL";
                if (string.IsNullOrEmpty(session["Installed"]))
                    if (session["INSTALL_APP"] == "")
                        session["REMOVE"] = "AppFeature";
                    if (session["INSTALL_DB"] == "")
                        session["REMOVE"] = "DBFeature";
                session.Log("End SetFeatures CA...");
                return ActionResult.Success;
            catch (Exception ex)
                session.Log("Exception occurred in SetFeatures CA: " + ex.ToString());
                return ActionResult.Failure;

I use the following commands for Silent Install.

start /wait msiexec /qn /i MyMSI.msi /l*v App.log INSTALL_APP="1"

start /wait msiexec /qn /i MyM.msi /l*v Db.log INSTALL_APP="" INSTALL_DB="1"

This works fine. Now during upgrade, I change the Product ID and Version. I also change the content of the Sample text file and Sql file for upgrade.
Then when I execute the first command above, it is unfortunately upgrading both the features. I want to control this behavior. Can anyone please help?

WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

More information about the wix-users mailing list