Hello.

We have a need for a service we develop (Windows Service) to be installed
side-by-side multiple times on a single computer, differing by installation
path and configuration file(connection string, log path etc). I've developed
a WIX Installer that does the "custom installation" part just fine, but
ofcourse I'm hitting a snag when I want to install another service of the
same type, with the same installation program.

MSI thinks(knows) that the product is already installed, and just gives the
option to uninstall. What I'd like is for the installer to accept "multiple
installs" of the same product but to different paths. Is there a way to
achieve this? Some sort of GUID auto generation?

Here's the wxs file for reference (our company name has been replace with
OurCompany and the application we're integrating with with this service has
been replaced with ExternalApplication).



<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension";
>
  <Product Id="ccebbaed-ba86-4942-a93c-5939f5baca16"
           Name="OurCompany ExternalApplication Integration Service"
           Language="1033"
           Version="1.2.0.0"
           Manufacturer="OurCompany AS"
           UpgradeCode="e883a4fe-b855-4856-b2d5-d9993a6b6809">

    <Package InstallerVersion="200" Compressed="yes"
InstallPrivileges="elevated" />
    <Media Id="1" Cabinet="
OurCompany.Integration.ExternalApplication.WIXInstaller.cab" EmbedCab="yes"
/>

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Component Id="ServiceComponent"
Guid="c12f647b-67f0-4b95-87c5-86ef9ff85b30" Location="local">
        <File Id="ExternalApplicationServiceEXE"
              Name="OurCompany.Integration.ExternalApplication.exe"

Source="../../OurCompany.Integration.ExternalApplication/bin/$(var.BUILD
)/OurCompany.Integration.ExternalApplication.Exe"
                  />
        <File Id="ELCommonDLL"
              Name="Microsoft.Practices.EnterpriseLibrary.Common.dll"

Source="../../OurCompany.Integration.ExternalApplication/bin/$(var.BUILD
)/Microsoft.Practices.EnterpriseLibrary.Common.dll"
                  />
        <File Id="ELLoggingDLL"
              Name="Microsoft.Practices.EnterpriseLibrary.Logging.dll"

Source="../../OurCompany.Integration.ExternalApplication/bin/$(var.BUILD
)/Microsoft.Practices.EnterpriseLibrary.Logging.dll"
                  />

        <File Id="ELObjectBuilderDLL"
              Name="Microsoft.Practices.ObjectBuilder.dll"

Source="../../OurCompany.Integration.ExternalApplication/bin/$(var.BUILD
)/Microsoft.Practices.ObjectBuilder.dll"
                  />
        <File Id="CONFIGBase"
              Name="OurCompany.Integration.ExternalApplication.exe.config"

Source="../../OurCompany.Integration.ExternalApplication/bin/$(var.BUILD
)/OurCompany.Integration.ExternalApplication.Exe.config"
                  />

        <util:XmlConfig Id="AddDSN"
                       Action="create"
                       ElementPath="//configuration/connectionStrings"

File="[TARGETDIR]\OurCompany.Integration.ExternalApplication.exe.config"
                       Name="add"
                       Node="element"
                       On="install"
                       Sequence="1"/>

        <util:XmlConfig Id="AddDSNKey"

File="[TARGETDIR]\OurCompany.Integration.ExternalApplication.exe.config"
                       ElementPath="AddDSN"
                       Name="name"
                       Value="OdbcConnectionString"
                       Sequence="2" />

        <util:XmlConfig Id="AddDSNValue"

File="[TARGETDIR]\OurCompany.Integration.ExternalApplication.exe.config"
                        ElementPath="AddDSN"
                        Name="connectionString"
                        Value="DSN=[ODBCDSN];"
                        Sequence="3" />

        <ServiceInstall Id="ExternalApplicationServiceEXE"
Name="ExternalApplicationService_[ODBCDSN]" DisplayName="OurCompany
ExternalApplication Service [ODBCDSN]"
                        Type="ownProcess" Interactive="yes" Start="auto"
Vital="yes" ErrorControl="normal" />
        <ServiceControl Id="ExternalApplicationServiceEXE"
Name="ExternalApplicationService_[ODBCDSN]" Stop="uninstall"
Remove="uninstall"
                        Wait="yes" />
      </Component>
    </Directory>

    <Feature Id="ServiceFeature" Title="
OurCompany.Integration.ExternalApplication.WIXInstaller" Level="1">
      <ComponentRef Id="ServiceComponent" />
    </Feature>

    <UIRef Id="WixUI_Common"/>

    <UI>
      <!--Begin Stock stuff -->
      <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
      <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
      <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
      <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes"
/>

      <Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" />
      <Property Id="ARPNOMODIFY" Value="1" />

      <DialogRef Id="BrowseDlg" />
      <DialogRef Id="DiskCostDlg" />
      <DialogRef Id="ErrorDlg" />
      <DialogRef Id="FatalError" />
      <DialogRef Id="FilesInUse" />
      <DialogRef Id="MsiRMFilesInUse" />
      <DialogRef Id="PrepareDlg" />
      <DialogRef Id="ProgressDlg" />
      <DialogRef Id="ResumeDlg" />
      <DialogRef Id="UserExit" />

      <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog"
Value="Return" Order="999">1</Publish>
      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog"
Value="LicenseAgreementDlg">1</Publish>
      <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog"
Value="WelcomeDlg">1</Publish>
      <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog"
Value="ServiceSetupDlg">LicenseAccepted = "1"</Publish>

      <Publish Dialog="ServiceSetupDlg" Control="Back" Event="NewDialog"
Value="LicenseAgreementDlg">1</Publish>
      <Publish Dialog="ServiceSetupDlg" Control="Next" Event="NewDialog"
Value="InstallDirDlg" Order="1">1</Publish>

      <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog"
Value="ServiceSetupDlg">1</Publish>
      <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath"
Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
      <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog"
Value="VerifyReadyDlg" Order="2">1</Publish>

      <Publish Dialog="InstallDirDlg" Control="ChangeFolder"
Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
      <Publish Dialog="InstallDirDlg" Control="ChangeFolder"
Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog"
Value="InstallDirDlg" Order="1">NOT Installed</Publish>
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog"
Value="MaintenanceTypeDlg" Order="2">Installed</Publish>

      <Publish Dialog="MaintenanceWelcomeDlg" Control="Next"
Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
      <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton"
Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
      <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton"
Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
      <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog"
Value="MaintenanceWelcomeDlg">1</Publish>

      <Dialog Id="ServiceSetupDlg" Width="370" Height="270"
Title="[ProductName] Detaljer">
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15"
Transparent="yes" NoPrefix="yes"
Text="{\WixUI_Font_Title}Serviceinformasjon" />
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280"
Height="15" Transparent="yes" NoPrefix="yes" Text="The following information
is required. The ODBC DSN must be preexisting." />

        <Control Id="OdbcDsnLabel" Type="Text" X="20" Y="60" Width="290"
Height="13" Text="ODBC DSN:" />
        <Control Id="OdbcDsn" Type="Edit" X="20" Y="72" Width="320"
Height="18" Property="ODBCDSN" Text="47"/>

        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370"
Height="0" />
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56"
Height="17" Default="yes" Text="Next" />
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56"
Height="17" Text="Back" />
        <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>
  </Product>
</Wix>


-- 
Henning K.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to