[wix-users] Error in Patch Creation in WiX

Ven H venh.123 at gmail.com
Tue Nov 14 04:59:52 PST 2017


I have a WiX Project created in Visual Studio 2017 with a CustomDialog, a
variable file, a localization file and a Product.wxs with the following
structure.
In the Project, I have added two dll references (WixUIExtension and
WixUtilExtension). I have 4 folders added to the project.

Binary
1.0.0
1.0.1
Localization

The following are the contents inside the folders.

Binary
------
Sample.ico
SampleWinSvc.exe
SampleWinSvc.exe.config

1.0.0
-----
Manual.pdf
Sample.txt

1.0.1
------
Sample.txt (the contents of this are different from the one in 1.0.0)

Localization
-------------
en-us.wxl

The contents of the en-us.wxl are as follows.

en-us.wxl
----------
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="
http://schemas.microsoft.com/wix/2006/localization">
<String Id="LANG">1033</String>
  <String Id="ProductName">Sample MSI Product(EN-US)</String>
  <String Id="InstallFolderName">MSI Sample(EN-US)</String>
</WixLocalization>

The project also has the following files.

License.rtf (a sample license file)
Product.wxs
ServiceAccountDlg.wxs
Variables.wxi

The following are the contents of each file.

Product.wxs
------------
<?xml version="1.0" encoding="UTF-8"?>
<?include 1.0.0\Variables.wxi ?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util='
http://schemas.microsoft.com/wix/UtilExtension'>
  <Product Id="$(var.ProductCode)" Name="$(var.ProductName)"
Language="!(loc.LANG)" Version="$(var.ProductVersion)"
Manufacturer="MyCompany" UpgradeCode="$(var.UpgradeCode)">

    <Package InstallerVersion="200" Compressed="yes"
InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName]
is already installed." />

    <Condition Message='This application only runs on Windows 7 or higher
OS versions.'>
      <![CDATA[Installed OR (VersionNT64 >= 601)]]>
    </Condition>

    <MediaTemplate />

    <Property Id="MSIFASTINSTALL" Value="1"/>
    <Property Id="MsiLogging" Value="v" />
    <Property Id="INSTALLDIR">
      <RegistrySearch Id='MSISampleRegistry' Type='raw' Root='HKLM'
Key='SOFTWARE\MyCompany\App' Name='INSTALLDIR' Win64='yes' />
    </Property>

    <WixVariable Id="WixUILicenseRtf" Value="License.rtf" />

    <Feature Id='Complete' Title='Foobar 1.0' Description='The complete
package.'
    Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'
AllowAdvertise='no' InstallDefault='local' Absent='disallow'>
      <Feature Id="ProductFeature" Title="SampleMSI" Level="1"
AllowAdvertise='no' InstallDefault='local' Absent='disallow'
Display='expand'>
        <ComponentRef Id="ProductComponent"/>
        <ComponentRef Id="ServiceComponent"/>
        <ComponentRef Id="RegistryComponent"/>
        <ComponentRef Id="deleteFolder"/>
      </Feature>

      <Feature Id='Documentation' Title='Description' Description='The
instruction manual.' Level='2' AllowAdvertise='no'
InstallDefault='followParent' Absent='disallow'>
        <ComponentRef Id='Manual' />
      </Feature>

    </Feature>

    <!--<UIRef Id="WixUI_Mondo"/>
    <UIRef Id="WixUI_ErrorProgressText" />-->

    <UI Id="MyWixUI_Mondo">
      <UIRef Id="WixUI_Mondo" />

      <DialogRef Id="ServiceAccountDlg" />

      <Publish Dialog="LicenseAgreementDlg" Control="Next"
Event="NewDialog" Value="ServiceAccountDlg" Order="2">LicenseAccepted =
"1"</Publish>
      <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog"
Value="ServiceAccountDlg">1</Publish>
    </UI>
    <UIRef Id="WixUI_ErrorProgressText" />

    <Icon Id="Sample.ico" SourceFile="Binary\Sample.ico" />
  </Product>

  <Fragment>
    <Component Id='Manual' Guid='7470A2CD-B07C-4AB4-9152-8C6AA53FA0F7'
Directory='INSTALLDIR'>
      <File Id='Manual' Name='Manual.pdf' DiskId='1'
Source='$(var.ProductVersion)\Manual.pdf' KeyPath='yes'>
        <Shortcut Id="startmenuManual" Directory="DesktopFolder"
Name="Instruction Manual" Advertise="yes" />
      </File>
    </Component>
  </Fragment>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR" Name="$(var.InstallFolderName)" />
      </Directory>
      <Directory Id="DesktopFolder" Name="Desktop" />
      <Directory Id="CommonAppDataFolder">
        <Directory Id="TestInstallerLogs" Name="TestInstallerLogs">
          <Component Id="deleteFolder"
Guid="323549D2-90B7-4D5D-8A36-EEA0ACCCC35E">
            <RemoveFile Id="deleteServiceFile" Name="TestWinSvcLog.txt"
On="both" Directory="TestInstallerLogs"/>
            <RemoveFolder Directory="TestInstallerLogs"
Id="TestInstallerLogs" On="both"/>
          </Component>
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <Component Id="ProductComponent" Directory="INSTALLDIR">
      <File Id="SampleTextFile.txt" Name="Sample.txt"
Source="$(var.ProductVersion)\Sample.txt" KeyPath="yes">
        <Shortcut Id="startmenuSampleText" Directory="DesktopFolder"
Name="MSI Sample" WorkingDirectory='INSTALLDIR' Icon='Sample.ico'
Advertise='yes' />
      </File>
    </Component>
  </Fragment>

  <Fragment>
    <Component Id='ServiceComponent' Directory="INSTALLDIR">
      <util:User Domain="[DOMAIN]" Id="svcUser" Name="[USER_NAME]"
Password="[PASSWORD]" LogonAsService="yes"/>
      <File Id='testWinSvc' Name='TestWinSvc.exe'
Source='Binary\TestWinSvc.exe' KeyPath='yes' />
      <ServiceInstall Id="installTestWinSvc" Name="TestWinSvc"
DisplayName="Install Test Windows Service" Start="auto"
ErrorControl="normal" Type="ownProcess" Account="[DOMAIN]\[USER_NAME]"
Password="[PASSWORD]" />
      <ServiceControl Id="sc_TestWinSvc" Name="TestWinSvc" Start="install"
Stop="both" Remove="uninstall" Wait="yes" />
      <ServiceControl Id="stopAndStartIIS" Name="IISADMIN"
Start="uninstall" Stop="install" Wait="yes" />
      <ServiceControl Id="stopAndStartSQL" Name="MSSQLSERVER"
Start="uninstall" Stop="install" Wait="yes" />
    </Component>
  </Fragment>

  <Fragment>
    <Component Id="RegistryComponent" Directory="INSTALLDIR">
      <RegistryValue Root='HKCU'
Key='Software\[Manufacturer]\[ProductName]' Type='string' Value=''
KeyPath='yes' />
    </Component>
  </Fragment>

</Wix>

ServiceAccountDlg.wxs
----------------------
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
    <UI>
      <Dialog Id="ServiceAccountDlg" Title="Service Account Credentials"
Width="370" Height="270" NoMinimize="yes">
        <Control Id="lblDomain" Type="Text" X="45" Y="35" Width="100"
Height="15" TabSkip="no" Text="&Domain:" />
        <Control Id="txtDomain" Type="Edit" X="45" Y="50" Width="220"
Height="18" Property="DOMAIN" Text="{80}" />
        <Control Id="lblUserName" Type="Text" X="45" Y="73" Width="100"
Height="15" TabSkip="no" Text="&User Name:" />
        <Control Id="txtUserName" Type="Edit" X="45" Y="85" Width="220"
Height="18" Property="USER_NAME" Text="{80}" />
        <Control Id="lblPassword" Type="Text" X="45" Y="110" Width="100"
Height="15" TabSkip="no" Text="&Password:" />
        <Control Id="txtPassword" Type="Edit" Password="yes" X="45" Y="122"
Width="220" Height="18" Property="PASSWORD" Text="{80}" />

        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56"
Height="17" Text="&Back">
          <Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
        </Control>
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56"
Height="17" Default="yes" Text="&Next">
          <Publish Event="SpawnWaitDialog"
Value="WaitForCostingDlg">CostingComplete = 1</Publish>
          <Publish Event="NewDialog" Value="SetupTypeDlg"></Publish>
        </Control>
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56"
Height="17" Cancel="yes" Text="Cancel">
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
        </Control>
      </Dialog>
    </UI>
</Fragment>
</Wix>

Variables.wxi
--------------
<?xml version="1.0" encoding="utf-8"?>
<Include>
  <?define ProductCode = "21080224-9B1A-46D7-8560-2760B8E429DD" ?>
  <?define UpgradeCode = "BFF39007-24DC-4F27-AF79-A3D99DC58FB9" ?>

  <?define ProductName = "!(loc.ProductName)" ?>

  <?define InstallFolderName = "!(loc.InstallFolderName)" ?>
  <?define ProductVersion = "1.0.0" ?>
  <?define ProductURL = "http://mycompany.com/products/1/" ?>
  <?define BinaryDirectory = "$(var.ProjectDir)\Binary" ?>
</Include>

I also have a Patch.wxs file with the following contents. This file is
outside the project directory.

Patch.wxs
----------
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Patch
        AllowRemoval="yes"
        Manufacturer="MyCompany"
        MoreInfoURL="https://www.mycompany.com/"
        DisplayName="Test Patch"
        Description="Test Update Patch"
        Classification="Update"
        >

        <Media Id="5000" Cabinet="RTM.cab">
            <PatchBaseline Id="RTM"/>
        </Media>
        <PatchFamilyRef Id="TestPatchFamily"/>
    </Patch>
    <Fragment>
        <PatchFamily Id='TestPatchFamily' Version='1.0.0' Supersede='yes'>
            <ComponentRef Id="ProductComponent"/>
        </PatchFamily>
    </Fragment>
</Wix>

Since Visual Studio doesn't seem to provide a good support for Patch
creation, I am using command prompt to generate the transform and the MSP
file. I used the project in Visual Studio mainly because, it is really
helpful in most of the other scenarios except Patch creation.

In a command prompt (I have already added WixToolSet location in
environment variables), I navigated to the Project directory and executed
the following commands.

candle.exe -ext WiXUtilExtension -dProjectDir="D:\Projects\WiX\SampleMSI"
-dVersion=1.0.0 *.wxs -out 1.0.0\
light.exe -ext WixUIExtension -ext WiXUtilExtension -sval 1.0.0\*.wixobj
-cultures:en-us -loc Localization\en-us.wxl -xo -out
1.0.0\OldSampleMSI.wixout

candle.exe -ext WiXUtilExtension -dProjectDir="D:\Projects\WiX\SampleMSI"
-dVersion=1.0.1 *.wxs -out 1.0.1\
light.exe -ext WixUIExtension -ext WiXUtilExtension -sval 1.0.1\*.wixobj
-cultures:en-us -loc Localization\en-us.wxl -xo -out
1.0.1\NewSampleMSI.wixout

torch.exe -p -xi 1.0.0\OldSampleMSI.wixout 1.0.1\NewSampleMSI.wixout -out
Patch\Diff.Wixmst

candle.exe D:\MyProjects\WIX\Patch.wxs -out Patch\
light.exe Patch\Patch.wixobj -out Patch\Patch.WixMsp

pyro.exe Patch\Patch.WixMsp -out Patch\Patch.msp -t RTM Patch\Diff.wixmst

The Pyro command is giving a warning and error. I am not sure what is
missing or incorrect. Can anyone please help?

Warning (in Patch.wxs): PYRO1079 : The cabinet RTM.cab does not contain any
files. If this patch contains no files, then this warning can likely be
safely ignored. Otherwise, try passing -p to the torch.exe when first
building the transforms, or add a ComponentRef to your PatchFamily
authoring to pull changed files into the cabinet.

Error (in wixmst): PYRO0227: The transform being built did not contain any
differences so it could not be created.

Can anyone please help me?


More information about the wix-users mailing list