0
votes

I'm working on multiple Wix installers for single-user, multi-user and demo installations. The first one for the single-user version works fine and also upgrades an old Visual Studio setup project fine based on the UpgradeCode.

But I'm having trouble with the other two, in both cases when I double-click the msi it shows "Could not find any previously installed compliant products on the machine for installing this product". This seems to relate to installer Error 1608.

It happens on both my development machine, but also another (clear) test machine I tried it on.

I did copy the code from the single-user project, but then changed the relevant names and locations and inserted a new upgradecode (or in one case, copied it from an old installer like I did for the single-user version).

It's true that there currently is no installed version on my machine to upgrade to, but I understood that it's not required, even though an upgradecode and a majorupgrade tag are there. This also means the registry items it's looking for are not in the Windows registry.

This is the code I'm using via Visual Studio 2013 (in Wix 3.9, I also tried 3.10, but this makes no difference):

    <?xml version="1.0" encoding="UTF-8"?>
    <?define Productname = "dealerdemo"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
    <Product Id="*" Name="$(var.Productname)" Language="1033" Version="2.1.65.0" Codepage="1252" Manufacturer="CompanyName" UpgradeCode="885e6689-9af3-45db-a241-fd35b8c60147">
    <Package InstallerVersion="200" Description="Installeer $(var.Productname)" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="Een nieuwere versie van $(var.Productname) is al geïnstalleerd." />
    <MediaTemplate EmbedCab="yes" />

    <Property Id="ARPPRODUCTICON" Value="20.ico" />

    <Feature Id="ProductFeature" Title="$(var.Productname)" Level="1">
      <ComponentGroupRef Id="Main" />
      <ComponentGroupRef Id="Documentation" />
      <ComponentRef Id="RegistryEntries" />
      <!--<ComponentRef Id="ApplicationShortcut" />-->
    </Feature>

    <Property Id="GETINSTALLFOLDER" ComplianceCheck="yes">
      <DirectorySearch Id="Search" Path="[WindowsVolume]" AssignToProperty="no">
        <DirectorySearch Id="GetFolder" Path="MU 2.0" />
      </DirectorySearch>
    </Property>

    <!-- Search for the InstallDir section in the registry and check the location still exists -->
    <Property Id="PREVIOUSINSTALLFOLDER" ComplianceCheck="no">
      <RegistrySearch Id="InstallDirSearch" Root="HKLM" Key="SOFTWARE\CompanyName\MU 2.0" Name="InstallDir" Type="raw">
        <DirectorySearch Id="Search" Path="[PREVIOUSINSTALLFOLDER]" />
      </RegistrySearch>
    </Property>

    <!-- Set default location -->
    <Property Id="INSTALLDIR" Value="C:\MU 2.0\"></Property>

    <!-- Try to find location in registry -->
    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
    <CustomAction Id="SetINSTALLDIR"  Property="INSTALLDIR" Value="[PREVIOUSINSTALLFOLDER]" Execute="firstSequence" />
    <InstallExecuteSequence>
      <Custom Action="SetINSTALLDIR" After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
    </InstallExecuteSequence>
    <InstallUISequence>
      <Custom Action="SetINSTALLDIR" After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
    </InstallUISequence>

    <!-- SHOW LICENSE, INSTALL DIR AND INSTALL FILES -->
    <WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
    <WixVariable Id="WixUIBannerBmp" Value="installeruibanner.bmp" />
    <WixVariable Id="WixUIDialogBmp" Value="installeruidailog.bmp" />

    <Icon Id="20.ico" SourceFile="20.ico" />
    <UIRef Id="WixUI_InstallDir" />

    <PropertyRef Id="NETFRAMEWORK45" />
    <Condition Message="Het .NET Framework 4.5.1 is niet gevonden. Herstart de installatie nadat deze is geïnstalleerd op deze PC.">
      <![CDATA[Installed OR (NETFRAMEWORK45 >= "#378675")]]>
    </Condition>

    <Condition Message="Oudere Windows versies dan Windows Vista SP2 worden niet ondersteund voor 2.1">
      <![CDATA[Installed OR ( VersionNT > 600 or ( VersionNT = 600 and ServicePackLevel > 1 ))]]>
    </Condition>

    </Product>

    <!-- DID NOT FIND WAY NOT TO MENTION PROGRAM FILES, ALTHOUGH IT'S NEVER SUGGESTED TO THE USER -->
     <Fragment>
     <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR" Name="MU 2.0" />
        <Directory Id="MANUALS" />
      </Directory>

      <!-- Save shortcut to program menu -->
      <Directory Id="ProgramMenuFolder">
        <Directory Id="Shortcut" Name="MU 2.1"/>
      </Directory>

      <!-- Save shortcut to desktop folder -->
      <Directory Id="DesktopFolder" SourceName="Desktop" />

      <!-- Create InstallDir registry item for upgrades-->
      <Component Id="RegistryEntries" Guid="A4E4CDC6-0635-4C03-BA1E-1B3856598536">

        <RegistryKey Root="HKLM"
                     Key="SOFTWARE\CompanyName\MU 2.0"
              Action="createAndRemoveOnUninstall">
          <RegistryValue Type="string" Name="InstallDir" Value="[INSTALLDIR]" />
        </RegistryKey>

        <!-- Create key for writing unhandled errors to Application eventlog-->
        <RegistryKey Root="HKLM"
                     Key="SYSTEM\CurrentControlSet\services\eventlog\Application\2.0"
                     Action="createAndRemoveOnUninstall">
          <RegistryValue Type="string" Name="eventlog" Value="" />
        </RegistryKey>

      </Component>

    </Directory>

    <SetDirectory Id="MANUALS" Value="[INSTALLDIR]\Handleidingen" />
   </Fragment>

   <!--INSTALL FILES-->
   <Fragment>
    <ComponentGroup Id="Main" Directory="INSTALLDIR">
      <Component>
        <File Source="D:\INSTALLER\MUdemo\2.0.exe" KeyPath="yes">
          <Shortcut Id="Shortcut" Directory="Shortcut" Name="MU 2.1" Description="MU 2.1" WorkingDirectory="INSTALLDIR" Advertise="yes" Icon ="20.ico" />
          <Shortcut Id="ApplicationDesktopShortcut" Directory="DesktopFolder" Name="MU 2.1" Description="MU 2.1" WorkingDirectory="INSTALLDIR" Advertise="yes" Icon ="20.ico" />
        </File>
        <RemoveFolder Id="Shortcut" Directory="Shortcut" On="uninstall"/>
        <RemoveFolder Id="DesktopFolder" Directory="DesktopFolder" On="uninstall"/>
      </Component>
      <Component>
        <File Source="D:\INSTALLER\MUdemo\2.0.exe.config"></File>
      </Component>
    </ComponentGroup>
    <ComponentGroup Id="Documentation" Directory="MANUALS">
      <Component>
        <File Source="D:\Handleidingen\activeren_administratie.pdf"></File>
      </Component>
      <Component>
        <File Source="D:\Handleidingen\2.0 MU\gebruikers_handleiding.pdf"></File>
      </Component>
      <Component>
        <File Source="D:\Handleidingen\2.0 MU\installatie_handleiding.pdf"></File>
      </Component>
     </ComponentGroup>
     </Fragment>
    </Wix>

I tried it without upgradecode and MajorUpgrade, but this didn't make any difference.

What am I missing? Is there a way to find out what this error is referring to?

1

1 Answers

0
votes

I suggest following up on the cause ofthe error message. The docs say this is consequence of something in the CCPSearch table. Assuming Windows Installer isn't behaving totally strangely:

  1. Open the MSI file with Orca to see if there is something in the CCPSearch table, and if so figure out where it came from and get rid of it.

  2. I assume there is a CCPSearch action in one or both of the sequences, again assuming that the error is what it says it is, so if you see it then figure out where it came from. I don't think WiX would insert the action (or the table) unless necessary. I didn't see any merge modules or anything in the source, but the MSI file may contain the action and the table.

  3. Take a verbose log and see what's going on. I'd expect to be related to the CCPSearch action and table.