Question

I've been working on creating multiple instances for my install and this is the code I have so far NOTE: Obvious data has been removed. I get the UI come up and I get all the way up to the Install phase and just when it hits the Progress Dialog I get an error message.

I know it's not my msiexec version or the service as I have checked everything. Can anyone let me know exactly what is causing this issue?

<!--Multi-instance-->
<InstanceTransforms Property="INSTANCEID">
  <Instance Id="Inst1" Inst1PProductductCode="**GUID**" Inst1PProductductName="Inst1PProductductInst1"/>
  <Instance Id="Inst1Stage" Inst1PProductductCode="**GUID**" Inst1PProductductName="Inst1PProductductInst1Stage"/>
  <Instance Id="Inst3" Inst1PProductductCode="**GUID**" Inst1PProductductName="Inst1PProductductInst3"/>
  <Instance Id="Inst4" Inst1PProductductCode="**GUID**" Inst1PProductductName="Inst1PProductductInst4"/>
  <Instance Id="Other" Inst1PProductductCode="**GUID**" Inst1PProductductName="Inst1PProductductOther"/>
  <Instance Id="Other2" Inst1PProductductCode="**GUID**" Inst1PProductductName="Inst1PProductductOther2"/>
  <Instance Id="Other3" Inst1PProductductCode="**GUID**" Inst1PProductductName="Inst1PProductductOther3"/>
</InstanceTransforms>

<!--Registering Multiple Instances-->
<Property Id="Inst1INSTALLEDInst1PProductductCODE">
  <RegistrySearch Id="Inst1Inst1PProductductCodeLookUp" Key="$(var.RegKeyDir)\Inst1" Name="**GUID**" Productot="HKLM" Type="raw"/>
</Property>
<Property Id="Inst1STAGEINSTALLEDInst1PProductductCODE">
  <RegistrySearch Id="Inst1StageInst1PProductductCodeLookUp" Key="$(var.RegKeyDir)\Inst1Stage" Name="**GUID**" Productot="HKLM" Type="raw"/>
</Property>
<Property Id="Inst3INSTALLEDInst1PProductductCODE">
  <RegistrySearch Id="Inst3Inst1PProductductCodeLookUp" Key="$(var.RegKeyDir)\Inst3" Name="**GUID**" Productot="HKLM" Type="raw"/>
</Property>
<Property Id="Inst4INSTALLEDInst1PProductductCODE">
  <RegistrySearch Id="Inst4Inst1PProductductCodeLookUp" Key="$(var.RegKeyDir)\Inst4" Name="**GUID**" Productot="HKLM" Type="raw"/>
</Property>
<Property Id="OTHERINSTALLEDInst1PProductductCODE">
  <RegistrySearch Id="OtherInst1PProductductCodeLookUp" Key="$(var.RegKeyDir)\Other" Name="**GUID**" Productot="HKLM" Type="raw"/>
</Property>
<Property Id="OTHER2INSTALLEDInst1PProductductCODE">
  <RegistrySearch Id="Other2Inst1PProductductCodeLookUp" Key="$(var.RegKeyDir)\Other2" Name="**GUID**" Productot="HKLM" Type="raw"/>
</Property>
<Property Id="OTHER3INSTALLEDInst1PProductductCODE">
  <RegistrySearch Id="Other3Inst1PProductductCodeLookUp" Key="$(var.RegKeyDir)\Other3" Name="**GUID**" Productot="HKLM" Type="raw"/>
</Property>

<!--Installation Files-->
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="PProductgramFilesFolder" Name="PProductgramFiles">
    <Directory Id="INSTALLDIR" Name="Inst1PProductduct">
      <Directory Id="Inst1PProductductWEB"> <!--Name="Inst1PProductduct(Inst1) Web"-->
        <!--RegCompCode-->

        <!--IISWebPoolCode-->
        <Component Id="IISWebPool" Guid="$(var.IISWebPoolCode)" Win64="no" MultiInstance="yes" Permanent="yes">
          <iis:WebAppPool Id="Inst1PProductduct" Name="Inst1PProductductAppPool" ManagedRuntimeVersion="[NET_VER]" IdleTimeout="0" RecycleMinutes="0" ManagedPipelineMode="integrated"/>
          <CreateFolder />
        </Component>

        <!--IISWebRegCode-->
        <Component Id="IISWebReg" Guid="$(var.IISWebRegCode)" KeyPath="yes" MultiInstance="yes">
          <iis:WebVirtualDir Id="ProductVirtualDir" Alias="[SHORTCUT]" Directory="Inst1PProductductWEB" WebSite="DefaultWebSite" >
            <iis:WebApplication Id="ProductWebApp" Name="[SHORTCUT]" WebAppPool="Inst1PProductduct" />
            <iis:WebDirPProductperties Id="ProductWebDir" AnonymousAccess="yes" WindowsAuthentication="yes" />
          </iis:WebVirtualDir>
          <CreateFolder />
        </Component>

        <!--WebDataFilesCode-->
        <Component Id="WebDataFiles" Guid="$(var.WebDataFilesCode)" MultiInstance="yes">              
          <File Id="clientaccesspolicy.xml" Source="$(var.Inst1PProductductWebFiles)\clientaccesspolicy.xml" Vital="yes" DiskId="1"/>
          <File Id="Default.aspx" Source="$(var.Inst1PProductductWebFiles)\Default.aspx" Vital="yes" DiskId="1"/>
          <File Id="Global.asax" Source="$(var.Inst1PProductductWebFiles)\Global.asax" Vital="yes" DiskId="1"/>
          <File Id="Global.asax.cs" Source="$(var.Inst1PProductductWebFiles)\Global.asax.cs" Vital="yes" DiskId="1"/>
          <File Id="Help.aspx" Source="$(var.Inst1PProductductWebFiles)\Help.aspx" Vital="yes" DiskId="1"/>
          <File Id="Help.aspx.cs" Source="$(var.Inst1PProductductWebFiles)\Help.aspx.cs" Vital="yes" DiskId="1"/>
          <File Id="Print.aspx" Source="$(var.Inst1PProductductWebFiles)\Print.aspx" Vital="yes" DiskId="1"/>
          <File Id="Report.aspx" Source="$(var.Inst1PProductductWebFiles)\Report.aspx" Vital="yes" DiskId="1"/>
          <File Id="Inst1PProductductHelp.aspx" Source="$(var.Inst1PProductductWebFiles)\Inst1PProductductHelp.aspx" Vital="yes" DiskId="1"/>
          <File Id="Silverlight.js" Source="$(var.Inst1PProductductWebFiles)\Silverlight.js" Vital="yes" DiskId="1"/>
          <File Id="WcfPortal.svc" Source="$(var.Inst1PProductductWebFiles)\WcfPortal.svc" Vital="yes" DiskId="1"/>
          <File Id="WcfSecurePortal.svc" Source="$(var.Inst1PProductductWebFiles)\WcfSecurePortal.svc" Vital="yes" DiskId="1"/>
          <File Id="Web.sample.config" Source="$(var.Inst1PProductductWebFiles)\Web.sample.config" Vital="yes" DiskId="1"/>
          <File Id="WpfWcfPortal.svc" Source="$(var.Inst1PProductductWebFiles)\WpfWcfPortal.svc" Vital="yes" DiskId="1"/>
          <File Id="Web.config" KeyPath="yes" Source="$(var.Inst1PProductductWebFiles)\Web.config" Vital="yes" />
          <util:XmlFile Id="SetConn" Action="setValue" ElementPath="/configuration/connectionStrings/add[\[]@name='Inst1PProductductConnectionString'[\]]/@connectionString"
                        Value="Data Source=[SERVERNAME];Initial Catalog=[DBNAME];Password=&quot;encrypted:kUrWr7n47L3akvAu89Evew==&quot;;User ID=Productster;"
                        File="[#Web.config]" SelectionLanguage="XPath" Sequence="1" />
        </Component>

        <!--RegisterFolderCode-->
        <!--<Component Id="RegisterFolder" Guid="$(var.RegisterFolderCode)">
          <RegistryValue Id="AppAlias" Name="AppAlias" Productot="HKLM" Key="SOFTWARE\Inst1PProductduct\Inst1PProductductWeb(Inst1)" Type='string' Value="[SHORTCUT]" KeyPath='yes'/>
          <RegistryValue Id="VirtualDir" Name='VirtualDir' Productot='HKLM' Key='SOFTWARE\Inst1PProductduct\Inst1PProductductWeb(Inst1)' Type='string' Value='[SHORTCUT]'/>
        </Component>-->

        <!--Registering Individual Instances-->
        <Component Id="Registry_Inst1" Guid="$(var.RegInst1Comp)">
          <Condition><![CDATA[INSTANCEID = "Inst1"]]></Condition>
          <RegistryKey Productot="HKLM" Key="$(var.RegKeyDir)\[INSTANCEID]" >
            <RegistryValue Id="Presence_Inst1" Action="write" Name="Inst1Inst1PProductductCode" Value="[Inst1PProductductCode]" Type="string" KeyPath="yes" />
          </RegistryKey>
        </Component>
        <Component Id="Registry_Inst1Stage" Guid="$(var.RegInst1StageComp)">
          <Condition><![CDATA[INSTANCEID = "Inst1Stage"]]></Condition>
          <RegistryKey Productot="HKLM" Key="$(var.RegKeyDir)\[INSTANCEID]" >
            <RegistryValue Id="Presence_Inst1Stage" Action="write" Name="Inst1StageInst1PProductductCode" Value="[Inst1PProductductCode]" Type="string" KeyPath="yes" />
          </RegistryKey>
        </Component>
        <Component Id="Registry_Inst3" Guid="$(var.RegInst3Comp)">
          <Condition><![CDATA[INSTANCEID = "Inst3"]]></Condition>
          <RegistryKey Productot="HKLM" Key="$(var.RegKeyDir)\[INSTANCEID]" >
              <RegistryValue Id="Presence_Inst3" Action="write" Name="Inst3Inst1PProductductCode" Value="[Inst1PProductductCode]" Type="string" KeyPath="yes" />
          </RegistryKey>
        </Component>
      </Directory>
    </Directory>
  </Directory>
</Directory>

<!--Create web applicaton under Default Website-->
<iis:WebSite Id="DefaultWebSite" Description="[SHORTCUT]" Directory="Inst1PProductductWEB">
  <iis:WebAddress Id="AllUnassigned" Port="80" />
</iis:WebSite>

<Feature Id="$(var.Feature)Install" 
         Title="$(var.InstallName) Installer" 
         Description="$(var.InstallName) Setup Wizard"
         Display="expand" 
         Level="1" 
         ConfigurableDirectory="Inst1PProductductWEB">
  <Feature Id="$(var.Feature)" Title="$(var.InstallName)" Description="$(var.InstallName)" Level="1">
    <ComponentRef Id="IISWebPool" />
    <ComponentRef Id="IISWebReg" />
    <ComponentRef Id="WebDataFiles" />
    <ComponentRef Id="BinFiles" />
    <ComponentRef Id="ClientBinFiles" />
    <ComponentRef Id="Registry_Inst1" />
    <ComponentRef Id="Registry_Inst1Stage" />
    <ComponentRef Id="Registry_Inst3" />
  </Feature>
</Feature>

<!--UI-->
<UI Id="Installer_UI">
  <UIRef Id="WixUI_Mondo"/>
  <Property Id="WIXUI_INSTALLER" Value="TARGETDIR"/>

  <DialogRef Id="InstallerUIDlg"/>
  <DialogRef Id="InstallDlg"/>
  <DialogRef Id="InstallPProductgressDlg"/>

  <Publish Dialog="ExitDialog" ContProductl="Finish" Event="EndDialog" Value="Return" Order="999"></Publish>
  <Publish Dialog="LicenseAgreementDlg" ContProductl="Next" Event="NewDialog" Value="InstallerUIDlg" Order="2">LicenseAccepted = "1"</Publish>
  <Publish Dialog="SetupTypeDlg" ContProductl="Back" Event="NewDialog" Value="InstallerUIDlg" Order="2">1</Publish>
  <Publish Dialog="PProductgressDlg" ContProductl="Next" Event="NewDialog" Value="InstallerUIDlg" Order="2">1</Publish>

</UI>
<UIRef Id="WixUI_Common"/>

<!--Custom Actions-->
<CustomAction Id="SetInst1PProductductName" Property="Inst1PProductductName" Value="[[Inst1PProductductNameProperty][INSTANCEID]]" />
<CustomAction Id="SetInstanceDirectory" Property="Inst1PProductductWEB" Value="[INSTALLDIR][INSTANCEID]\"/>
<CustomAction Id="SetTransforms" Property="TRANSFORMS" Value="{:[INSTANCEID];}[TRANSFORMS]" />
<CustomAction Id="SetNewInstance" Property="MSINEWINSTANCE" Value="1" />

<CustomAction Id="SetInstance_Inst1" Property="INSTANCEID" Value="Inst1" />
<CustomAction Id="SetInstance_Inst1Stage" Property="INSTANCEID" Value="Inst1Stage" />
<CustomAction Id="SetInstance_Inst3" Property="INSTANCEID" Value="Inst3" />
<CustomAction Id="SetInstance_Inst4" Property="INSTANCEID" Value="Inst4" />
<CustomAction Id="SetInstance_Other" Property="INSTANCEID" Value="Other" />
<CustomAction Id="SetInstance_Other2" Property="INSTANCEID" Value="Other2" />
<CustomAction Id="SetInstance_Other3" Property="INSTANCEID" Value="Other3" />

<InstallExecuteSequence>
  <Custom Action="SetInst1PProductductName" Before="ValidateInst1PProductductID" />
  <Custom Action="SetInstanceDirectory" Before="CostFinalize"><![CDATA[Inst1PProductductWEB = ""]]></Custom>
  <RemoveExistingInst1PProductducts Before="InstallInitialize" />
</InstallExecuteSequence>

<InstallUISequence>
  <Custom Action="SetInstance_Inst1" Before="SetTransforms"><![CDATA[ACTION = "INSTALL" AND INSTANCEID = "Default" AND Inst1INSTALLEDInst1PProductductCODE = ""]]></Custom>
  <Custom Action="SetInstance_Inst1Stage" After="SetInstance_Inst1"><![CDATA[ACTION = "INSTALL" AND INSTANCEID = "Default" AND Inst1STAGEINSTALLEDInst1PProductductCODE = ""]]></Custom>
  <Custom Action="SetInstance_Inst3" After="SetInstance_Inst1Stage"><![CDATA[ACTION = "INSTALL" AND INSTANCEID = "Default" AND Inst3INSTALLEDInst1PProductductCODE = ""]]></Custom>
  <Custom Action="SetInstance_Inst4" After="SetInstance_Inst3"><![CDATA[ACTION = "INSTALL" AND INSTANCEID = "Default" AND Inst4INSTALLEDInst1PProductductCODE = ""]]></Custom>
  <Custom Action="SetInstance_Other" After="SetInstance_Inst4"><![CDATA[ACTION = "INSTALL" AND INSTANCEID = "Default" AND OTHERINSTALLEDInst1PProductductCODE = ""]]></Custom>
  <Custom Action="SetInstance_Other2" After="SetInstance_Other"><![CDATA[ACTION = "INSTALL" AND INSTANCEID = "Default" AND OTHER2INSTALLEDInst1PProductductCODE = ""]]></Custom>
  <Custom Action="SetInstance_Other3" After="SetInstance_Other2"><![CDATA[ACTION = "INSTALL" AND INSTANCEID = "Default" AND OTHER3INSTALLEDInst1PProductductCODE = ""]]></Custom>

  <Custom Action="SetTransforms" Before="ExecuteAction"><![CDATA[ACTION = "INSTALL"]]></Custom>
  <Custom Action="SetNewInstance" Before="ExecuteAction"><![CDATA[ACTION = "INSTALL"]]></Custom>

</InstallUISequence>
Was it helpful?

Solution

My understanding is that you must set the TRANSFORMS and MSINEWINSTANCE values before the MSI package is launched. The MSI SDK shows it in the topic: Installing Multiple Instances with Instance Transforms. It is possible you could set MSINEWINSTANCE via a custom action as you are but I'm pretty certain that the TRANSFORMS property must be set before the MSI package is opened by the Windows Installer because the transform is applied as the MSI package is opened.

Basically, you need some sort of bootstrapper or documented command-line process to set these correctly. Multiple instance packages in the Windows Installer are challenging because of these types of issues.

OTHER TIPS

I would try testing/troubleshooting from the command line first to eliminate the complexity of the UI.

You should always pass in your transform and always specify MSINEWINSTANCE=1 from the command line when installing an instance.

msiexec /i App.msi TRANSFORMS=:Inst1 MSINEWINSTANCE=1
msiexec /i App.msi TRANSFORMS=:Inst1Stage MSINEWINSTANCE=1
msiexec /x App.msi TRANSFORMS=:Inst1
msiexec /x App.msi TRANSFORMS=:Inst1Stage

I'm thinking if you can verify things are right via the command line, then you can confirm your issue is specific to the GUI and the CAs associated with setting your instance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top