﻿<?xml version="1.0" encoding="utf-8" ?>

<InstBroker>
  <BrokerRequests>

    <BrokerRequest Name="Prerequisite Check">

      <!--OS Check-->
      <Request Name="CheckOS" Library="InstallTools" Class="Installer.InstallRequests.CheckOSRequest"
               EstTime="1000" TimeOut="100000" UIName="#CheckOperatingSystemRequiremen" ProgressBar="Animation" ActionOnFail="Continue"
               ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ValidOS>WindowsServer2008|Windows7|WindowsServer2008R2|Windows8|WindowsServer2012</ValidOS>
        <ValidServicePacks>0|0|0|0|0</ValidServicePacks>
        <ValidArch>x32|x64</ValidArch>
        <InvalidEditions>Starter</InvalidEditions>
      </Request>

      <!--Previous ENM/APM Install Check-->
      <Request Name="CheckPreviousENMInstalls" EstTime="500" TimeOut="100000" UIName="#SER_CheckingSystemForPreviousENMInstalls" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder</globalSetupType>
        </ConditionTrue>
        <Method>
          <!--APM 6.3-->
          <CheckRegistryValueDataNOTExistingInView Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.SetupRegistry" UIMessageOnFail="#SER_APMDetected" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <regPath>SOFTWARE\Schneider-Electric\PowerLogic eSolutions\APM</regPath>
            <value>Version</value>
            <dataValues>6.3.0.0</dataValues>
            <registryView>Registry32</registryView>
          </CheckRegistryValueDataNOTExistingInView>
        </Method>
      </Request>

      <!--Previous SER Install Check-->
      <Request Name="CheckPreviousSERInstalls" EstTime="500" TimeOut="100000" UIName="#SER_CheckingSystemForPreviousSERInstalls" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder</globalSetupType>
        </ConditionTrue>
        <Method>
          <!--SER 7.3-->
          <CheckRegistryValueDataNOTExistingInView Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.SetupRegistry" UIMessageOnFail="#SER_SERDetected" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <regPath>SOFTWARE\Schneider-Electric\PowerLogic eSolutions\SER</regPath>
            <value>Version</value>
            <dataValues>7.3.0.0</dataValues>
            <registryView>Registry32</registryView>
          </CheckRegistryValueDataNOTExistingInView>

        </Method>
      </Request>

      <!--Check SER Formal Product Name-->
      <Request Name="CheckFormalProductName" EstTime="500" TimeOut="100000" UIName="#SER_CheckingSystemFormalProductName" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <Method>
          <!--Fixes the Formal Product Name - in Installer Framework v1.7 the globalFormalProductName is used for the install directory
          After the File Destination page in the install is loaded we need to change the variable to be more specific to our product.
          Since SER and ENM share the same directory it is originally named to StruxtureWare Solutions in the Setup.xml -
          Afterwards it is changed here to be more specific so that the name displayed in Add/Remove Programs is different.-->
          <fixSharedProductName Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.SharedComponents" SetReturnProperty="globalBrandProductFormalName" UIMessageOnFail="#SER_FailedFixingFormalProductName"
                                   ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <productName>@globalBrandProductName</productName>
          </fixSharedProductName>
        </Method>
      </Request>

      <!--SQL Version Check-->
      <Request Name="CheckSQLServerVersionEdition32bit" EstTime="500" TimeOut="100000" UIName="#Check32bitSQLServerVersionandE" ProgressBar="Progress" ActionOnFail="Continue">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
          <globalIsx64>false</globalIsx64>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" UIMessageOnFail="#Errorsettingconnectionstring">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>
          <CheckSqlEdition Library="DatabaseBusiness" Class="Installer.InstallTools.DBInstaller" UIMessageOnFail="#TheEditonoftheselectedSQLServe">
            <RequiredSQLEdition>Express Edition|Express Edition with Advanced Services|Standard Edition|Enterprise Edition</RequiredSQLEdition>
          </CheckSqlEdition>
          <CheckSqlVersion Library="DatabaseBusiness" Class="Installer.InstallTools.DBInstaller" UIMessageOnFail="#TheVersionoftheselectedSQLServ">
            <RequiredSQLVersionString>10.0.1600.0</RequiredSQLVersionString>
            <RequiredSQLVersionString>11.0.2100</RequiredSQLVersionString>
          </CheckSqlVersion>
        </Method>
      </Request>

      <Request Name="CheckSQLServerVersionEdition64bit" EstTime="500" TimeOut="100000" UIName="#Check64bitSQLServerVersionandE" ProgressBar="Progress" ActionOnFail="Continue">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
          <globalIsx64>true</globalIsx64>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" UIMessageOnFail="#Errorsettingconnectionstring">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>
          <CheckSqlEdition Library="DatabaseBusiness" Class="Installer.InstallTools.DBInstaller" UIMessageOnFail="#TheEditonoftheselectedSQLServe">
            <RequiredSQLEdition>Express Edition (64-bit)|Express Edition with Advanced Services (64-bit)|Standard Edition (64-bit)|Enterprise Edition (64-bit)</RequiredSQLEdition>
          </CheckSqlEdition>
          <CheckSqlVersion Library="DatabaseBusiness" Class="Installer.InstallTools.DBInstaller" UIMessageOnFail="#TheVersionoftheselectedSQLServ">
            <RequiredSQLVersionString>10.0.1600.0</RequiredSQLVersionString>
            <RequiredSQLVersionString>11.0.2100</RequiredSQLVersionString>
            <!-- SQL Server 2008 RTM is 10.0.1600.22 -->
          </CheckSqlVersion>
          <IsDatabaseLocalOrClustered Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" UIMessageOnFail="#DatabaseLocationInvalid">
            <machineName>@globalEEMDBName</machineName>
          </IsDatabaseLocalOrClustered>
        </Method>
      </Request>

      <!--SQL Local Instance Check-->
      <Request Name="CheckSQLServerInstance" EstTime="500" TimeOut="100000" UIName="#SER_CheckingLocalSQLInstance" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <IsDatabaseLocalOrClustered Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" UIMessageOnFail="#DatabaseLocationInvalid">
            <machineName>@globalEEMDBName</machineName>
          </IsDatabaseLocalOrClustered>
        </Method>
      </Request>

      <!--SQL Connection Check-->
      <Request Name="CheckSQLServerConnection" EstTime="500" TimeOut="100000" UIName="#SER_CheckSQLServerConnection" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>
          <VerifyConnection Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" UIMessageOnFail="#Errorvalidatingconnectionstring">
          </VerifyConnection>
        </Method>
      </Request>

      <!--SQL Permissions Check-->
      <Request Name="CheckSqlServerAccountPermission" EstTime="500" TimeOut="100000" UIName="#SER_CheckSQLServerPermissions" ProgressBar="Progress" ActionOnFail="Continue"
               ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <CheckServiceWriteAccess Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.NTServiceController" UIMessageOnFail="#SER_CheckSQLServerPermError"
                                   ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <serviceName>@globalSQLServiceName/@</serviceName>
            <directory>@globalDatabaseBackupFolder/@</directory>
          </CheckServiceWriteAccess>
        </Method>
      </Request>

      <!-- Upgrade check for AEHistory-->
      <Request Name="CheckAEHistorySchema" EstTime="1000" TimeOut="100000" UIName="#SER_CheckDBSchema" ProgressBar="Animation" ActionOnFail="Continue"
               ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <Method>
          <SetConnectionString Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString"
                               ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>

          <CheckDBSchemaForUpgrade Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" SetReturnProperty="globalAction" UIMessageOnFail="#SER_CheckDBSchemaFailed"
                                   ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <versionToInstall>@globalDisplayVersion</versionToInstall>
            <dbName>PLES_AEHistory</dbName>
          </CheckDBSchemaForUpgrade>
        </Method>
      </Request>

      <!--.NET 4.5.1 Check-->
	  <!--
      <Request Name="CheckNet4_5_1" EstTime="500" TimeOut="100000" UIName="#SER_CheckNet4_5_1" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <GetNet451FromRegistry Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.SetupRegistry" UIMessageOnFail="#SER_CheckNet4_5_1Error"
                                 ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer" />

        </Method>
      </Request>
	  -->

      <!--ASP.NET Check-->
      <Request Name="CheckASPNET" EstTime="500" TimeOut="100000" UIName="#SER_CheckASPNETRequirement" ProgressBar="Progress" ActionOnFail="Prompt" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <CheckHKLMRegistyExisting Library="RegistrySetup" Class="Installer.InstallTools.SetupRegistry" UIMessageOnFail="#SER_ASPNET4NotFound" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <regpath>SOFTWARE\Microsoft\ASP.NET\4.0.30319.0</regpath>
            <id>Path</id>
          </CheckHKLMRegistyExisting>
          <CheckWindowServiceExisting Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_ASPNETNotInstalled" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <serviceName>aspnet_state</serviceName>
            <machineName></machineName>
          </CheckWindowServiceExisting>
        </Method>
      </Request>

      <!--Administration User Credentials Check-->
      <Request Name="VerifyWindowsAdminUser" EstTime="500" TimeOut="100000" UIName="#SER_CheckingDatabaseMaintenanceCredentials" ProgressBar="Animation" ActionOnFail="Stop" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <CheckLocalUserExists Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_InvalidUserCredentials" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <userName>@globalUserName2</userName>
            <password>@globalUserPassword2</password>
          </CheckLocalUserExists>
          <CheckLocalUserIsAdministrator Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_UserNotAdministrator" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <userName>@globalUserName2</userName>
          </CheckLocalUserIsAdministrator>
        </Method>
      </Request>
      <Request Name="VerifySQLMixedMode" EstTime="500" TimeOut="100000" UIName="#SER_CheckingSQLMixedMode" ProgressBar="Animation" ActionOnFail="Stop" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <IsAuthMixedMode Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_MixedModeNotEnabled" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
          </IsAuthMixedMode>
        </Method>
      </Request>

    </BrokerRequest>

    <BrokerRequest Name="InstallMsi">



      <!--This broker request only contains one request-->
      <Request Name="LaunchMsiRequest" Library="InstallTools" Class="Installer.InstallRequests.LaunchMsiRequest" EstTime="0" TimeOut="0" UIName="#Deployingfilestosystem" ProgressBar="Progress" ActionOnFail="Prompt">
        <!--Install x86 CLR Types for 2012 Support -->
        <MsiFile Name="SQLSysClrTypes.msi" Path="SetupSupport\SQLSystemCLRTypes\x86" SizeInMB="22" ProductGUID="3E27ADB0-07FE-4342-A8D8-FC8C2851919F">
          <ConditionTrue>
            <globalSetupType>SequenceEventsRecorder|DbServer|AppServer</globalSetupType>
            <globalIsx64>false</globalIsx64>
            <Custom_APMInstalled>false</Custom_APMInstalled>
          </ConditionTrue>
          <CommandLine>
            <INSTALLDIR>
              @globalProgramFileFolder
            </INSTALLDIR>
            <REBOOT>
              ReallySuppress
            </REBOOT>
          </CommandLine>
        </MsiFile>

        <!--Install x64 CLR Types for 2012 Support -->
        <MsiFile Name="SQLSysClrTypes.msi" Path="SetupSupport\SQLSystemCLRTypes\x64" SizeInMB="22" ProductGUID="7627E4E1-591B-485F-A209-FF0747548C5D">
          <ConditionTrue>
            <globalSetupType>SequenceEventsRecorder|DbServer|AppServer</globalSetupType>
            <globalIsx64>true</globalIsx64>
            <Custom_APMInstalled>false</Custom_APMInstalled>
          </ConditionTrue>
          <CommandLine>
            <INSTALLDIR>
              @globalProgramFileFolder
            </INSTALLDIR>
            <REBOOT>
              ReallySuppress
            </REBOOT>
          </CommandLine>
        </MsiFile>

        <!--Install x86 SMO Install for 2012 Support -->
        <MsiFile Name="SharedManagementObjects.msi" Path="SetupSupport\SharedManagementObjects\x86" SizeInMB="22" ProductGUID="FB364EFE-81B2-4748-9931-1E364C54634A">
          <ConditionTrue>
            <globalSetupType>SequenceEventsRecorder|DbServer|AppServer</globalSetupType>
            <globalIsx64>false</globalIsx64>
            <Custom_APMInstalled>false</Custom_APMInstalled>
          </ConditionTrue>
          <CommandLine>
            <INSTALLDIR>
              @globalProgramFileFolder
            </INSTALLDIR>
            <REBOOT>
              ReallySuppress
            </REBOOT>
          </CommandLine>
        </MsiFile>

        <!--Install x64 SMO Install for 2012 Support -->
        <MsiFile Name="SharedManagementObjects.msi" Path="SetupSupport\SharedManagementObjects\x64" SizeInMB="22" ProductGUID="8B223043-FF85-4481-A8CC-111A0E9F8364">
          <ConditionTrue>
            <globalSetupType>SequenceEventsRecorder|DbServer|AppServer</globalSetupType>
            <globalIsx64>true</globalIsx64>
            <Custom_APMInstalled>false</Custom_APMInstalled>
          </ConditionTrue>
          <CommandLine>
            <INSTALLDIR>
              @globalProgramFileFolder
            </INSTALLDIR>
            <REBOOT>
              ReallySuppress
            </REBOOT>
          </CommandLine>
        </MsiFile>


        <!--Install x86 External Shared Files-->
        <MsiFile Name="SERSharedExternalFilesSetup(x86).msi" Path="Installers" SizeInMB="22" ProductGUID="FD95E1A8-F124-4FA6-83A6-0F0BD75FFD6F">
          <ConditionTrue>
            <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
            <globalIsx64>false</globalIsx64>
          </ConditionTrue>
          <CommandLine>
            <INSTALLDIR>
              @globalProgramFileFolder
            </INSTALLDIR>
            <REBOOT>
              ReallySuppress
            </REBOOT>
          </CommandLine>
        </MsiFile>

        <!--Install x64 External Shared Files-->
        <MsiFile Name="SERSharedExternalFilesSetup(x64).msi" Path="Installers" SizeInMB="22" ProductGUID="FD95E1A8-F124-4FA6-83A6-0F0BD75FFD6F">
          <ConditionTrue>
            <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
            <globalIsx64>true</globalIsx64>
          </ConditionTrue>
          <CommandLine>
            <INSTALLDIR>
              @globalProgramFileFolder
            </INSTALLDIR>
            <REBOOT>
              ReallySuppress
            </REBOOT>
          </CommandLine>
        </MsiFile>

        <!--Install x86 SequenceEventsRecorder-->
        <MsiFile Name="SequenceEventsRecorderSetup(x86).msi" Path="Installers" SizeInMB="22" ProductGUID="04D60FCD-B45D-4148-9335-76FB2FBFDAFE">
          <ConditionTrue>
            <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
            <globalIsx64>false</globalIsx64>
          </ConditionTrue>
          <CommandLine>
            <INSTALLDIR>
              @globalProgramFileFolder
            </INSTALLDIR>
            <REBOOT>
              ReallySuppress
            </REBOOT>
          </CommandLine>
        </MsiFile>

        <!--Install x64 SequenceEventsRecorder-->
        <MsiFile Name="SequenceEventsRecorderSetup(x64).msi" Path="Installers" SizeInMB="22" ProductGUID="04D60FCD-B45D-4148-9335-76FB2FBFDAFE">
          <ConditionTrue>
            <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
            <globalIsx64>true</globalIsx64>
          </ConditionTrue>
          <CommandLine>
            <INSTALLDIR>
              @globalProgramFileFolder
            </INSTALLDIR>
            <REBOOT>
              ReallySuppress
            </REBOOT>
          </CommandLine>
        </MsiFile>

        <!--Install x86 SequenceEventsRecorderDatabaseSetup-->
        <MsiFile Name="SequenceEventsRecorderDatabaseSetup(x86).msi" Path="Installers" SizeInMB="22" ProductGUID="030BD08B-AE2C-4700-AA72-34DB25793AFF">
          <ConditionTrue>
            <globalSetupType>DbServer</globalSetupType>
            <globalIsx64>false</globalIsx64>
          </ConditionTrue>
          <CommandLine>
            <INSTALLDIR>
              @globalProgramFileFolder
            </INSTALLDIR>
            <REBOOT>
              ReallySuppress
            </REBOOT>
          </CommandLine>
        </MsiFile>

        <!--Install x64 SequenceEventsRecorderDatabaseSetup-->
        <MsiFile Name="SequenceEventsRecorderDatabaseSetup(x64).msi" Path="Installers" SizeInMB="22" ProductGUID="030BD08B-AE2C-4700-AA72-34DB25793AFF">
          <ConditionTrue>
            <globalSetupType>DbServer</globalSetupType>
            <globalIsx64>true</globalIsx64>
          </ConditionTrue>
          <CommandLine>
            <INSTALLDIR>
              @globalProgramFileFolder
            </INSTALLDIR>
            <REBOOT>
              ReallySuppress
            </REBOOT>
          </CommandLine>
        </MsiFile>

      </Request>
    </BrokerRequest>

    <BrokerRequest Name="Configuration">

      <!--Backup AE History Before Migration-->
      <Request Name="BackupPrevHistoricalData" EstTime="120000" TimeOut="9000000" UIName="#SER_UpgradeBackupPreviousHistData" ProgressBar="Animation"
               ActionOnFail="Stop" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
          <globalAction>Upgrade</globalAction>
        </ConditionTrue>
        <Method>
          <RunExecutableWithExitCode Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_UpgradeBackupFailed"
                                     ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <cmd>sqlcmd.exe</cmd>
            <args>-b -S @globalEEMDbServer/@ -E -i "@globalProgramFileFolder/@\DBMaintenance\Scripts\UpgradeBackupHistoricalData.sql" -v BackupLocation="@globalDatabaseBackupFolder/@"</args>
            <failExitCodeAbove>0</failExitCodeAbove>
          </RunExecutableWithExitCode>
        </Method>
      </Request>

      <!--Trim AE History Before Migration-->
      <Request Name="TrimPrevV8HistoricalData" EstTime="120000" TimeOut="9000000" UIName="#SER_UpgradeTrimPreviousHistData" ProgressBar="Animation"
               ActionOnFail="Stop" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
          <globalAction>Upgrade</globalAction>
        </ConditionTrue>
        <Method>
          <RunExecutableWithExitCode Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_UpgradeTrimFailed"
                                     ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <cmd>sqlcmd.exe</cmd>
            <args>-b -S @globalEEMDbServer/@ -E -i "@globalProgramFileFolder/@\DBMaintenance\Scripts\UpgradeTrimEventsTable.sql"</args>
            <failExitCodeAbove>0</failExitCodeAbove>
          </RunExecutableWithExitCode>
        </Method>
      </Request>

      <!-- Migration of Previous Historical Data-->
      <Request Name="MigratePreV8HistoricalData" EstTime="120000" TimeOut="9000000" UIName="#SER_UpgradeMigratePreviousHistData" ProgressBar="Animation"
               ActionOnFail="Stop" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
          <globalAction>Upgrade</globalAction>
        </ConditionTrue>
        <Method>
          <RunExecutableWithExitCode Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_UpgradeMigrateFailed"
                                     ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <cmd>sqlcmd.exe</cmd>
            <args>-b -S @globalEEMDbServer/@ -E -i "@globalProgramFileFolder/@\DBMaintenance\Scripts\MigratePreV8HistoricalData.sql"</args>
            <failExitCodeAbove>0</failExitCodeAbove>
          </RunExecutableWithExitCode>
        </Method>
      </Request>


      <!--Install Hotfix included with SER 8.0 which updates Monitoring and Diagnostics if ENM is already installed.-->
      <Request Name="InstallHotfixes" EstTime="500" TimeOut="0" UIName="#SER_InstallingHotfixes" ProgressBar="Animation" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>true</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <RunExecutableWithExitCode Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>"@globalSetupPath/@\Hotfixes\Hotfix 8.0.14071.01.bat"</cmd>
            <args>/q "@globalSetupPath/@\Hotfixes"</args>
            <failExitCodeAbove>0</failExitCodeAbove>
          </RunExecutableWithExitCode>
        </Method>
      </Request>

      <!--VC Redistributable Preregs-->
      <Request Name="InstallVCRedist32bit" EstTime="500" TimeOut="0" UIName="#SER_Installing32bitVCRedist" ProgressBar="Animation" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalIsx64>false</globalIsx64>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>"@globalSetupPath/@\SetupSupport\VCRedistributable\vcredist_x86.exe"</cmd>
            <args>/q</args>
          </RunExecutable>
        </Method>
      </Request>
      <Request Name="InstallVCRedist64bit" EstTime="500" TimeOut="0" UIName="#SER_Installing64bitVCRedist" ProgressBar="Animation" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalIsx64>true</globalIsx64>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>"@globalSetupPath/@\SetupSupport\VCRedistributable\vcredist_x64.exe"</cmd>
            <args>/q</args>
          </RunExecutable>
        </Method>
      </Request>

      <!--Advosol Prereqs-->
      <Request Name="InstallAdvosolOpcCoreComponents" EstTime="500" TimeOut="0" UIName="#SER_InstallingOPCCoreComponents" ProgressBar="Animation" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>"@globalSetupPath/@\SetupSupport\AdvosolOpcCoreComponents\AdvosolOpcCoreComponents.exe"</cmd>
            <args></args>
          </RunExecutable>
        </Method>
      </Request>

      <!--Ensure SQL CLR is enabled-->
      <Request Name="EnableSQLCLR" EstTime="500" TimeOut="120000" UIName="#SER_EnablingSQLCLR" ProgressBar="Animation" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>
          <EnableCLR  Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" />
        </Method>
      </Request>


      <!--Shared Module install-->
      <Request Name="RegisterSERInstallRoot" EstTime="500" TimeOut="100000" UIName="#SER_RegisteringInstallRoot" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <AddStringToRegistry  Library="RegistrySetup" Class="Installer.InstallTools.SetupRegistry">
            <key>@Custom_ESolutionsRegistryLocation</key>
            <name>InstallRoot</name>
            <value>@globalProgramFileFolder</value>
          </AddStringToRegistry >
        </Method>
      </Request>

      <!--Creating NT Permissions For SER groups-->
      <Request Name="CreateSERWindowsGroups" EstTime="500" TimeOut="100000" UIName="#SER_CreatingWindowsGroups" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <CreateWindowsGroup Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <groupName>SERAdmin</groupName>
            <groupDesc>SER Admin Group</groupDesc>
            <userLevel>1</userLevel>
          </CreateWindowsGroup>
          <CreateWindowsGroup Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <groupName>SERUser</groupName>
            <groupDesc>SER User Group</groupDesc>
            <userLevel>1</userLevel>
          </CreateWindowsGroup>

          <!--Adding user to SERAdmin group but only on STANDALONE and AppServer installs-->
          <AddUsertoGroup Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <groupName>SERAdmin</groupName>
            <userName>@globalUserName2</userName>
          </AddUsertoGroup>
        </Method>
      </Request>

      <!--Adds ENS user to database-->
      <Request Name="AddENSUser" EstTime="500" TimeOut="100000" UIName="#SER_AddingENSUser" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>

          <AddENSUser Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" />
        </Method>
      </Request>

      <!--Installs Diagnostics Database Scripts-->
      <Request Name="InstallDiagnosticsDbScripts" EstTime="500" TimeOut="100000" UIName="#SER_InstallingDiagnosticsDBScripts" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>

          <!--PLES_Logging.sql-->
          <ExecuteSQLScriptFile Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorInstallingScript" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <sqlFilePath>@globalProgramFileFolder/@\DatabaseScripts\PLES_Logging.sql</sqlFilePath>
            <assemblyPath>@globalProgramFileFolder/@\Common\</assemblyPath>
          </ExecuteSQLScriptFile>
        </Method>
      </Request>

      <Request Name="SetDiagnosticsDbOwner" EstTime="500" TimeOut="100000" UIName="#SER_SettingDiagnosticsDbOwner" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>
          <ChangeDBOwner Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL">
            <userName>ENS</userName>
            <dbName>PLES_Logging</dbName>
          </ChangeDBOwner>
        </Method>
      </Request>

      <!--OPC Logger Module install-->
      <Request Name="RegisterOPCLogger" EstTime="500" TimeOut="100000" UIName="#SER_RegisteringOPCLogger" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <RegisterModule Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.ModuleRegistrar" UIMessageOnFail="#SER_ErrorRegisteringOPCLogger" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <regPath>@Custom_ESolutionsRegistryLocation/@</regPath>
            <moduleName>OPC Logger</moduleName>
            <productFamily>eSolutionsWeb</productFamily>
            <description>OPC Logger</description>
            <assemblyFile>@globalProgramFileFolder/@\OPC Logger\OPCAELoggerSvc.exe</assemblyFile>
          </RegisterModule>
        </Method>
      </Request>

      <Request Name="InstallOPCLoggerDbScripts" EstTime="500" TimeOut="2000000" UIName="#SER_InstallingOPCLoggerDBScripts" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>

          <!--PLES_AEHistory.sql-->
          <ExecuteSQLScriptFile Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorInstallingScript" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <sqlFilePath>@globalProgramFileFolder/@\DatabaseScripts\PLES_AEHistory.sql</sqlFilePath>
            <assemblyPath>@globalProgramFileFolder/@\Common\</assemblyPath>
          </ExecuteSQLScriptFile>
        </Method>
      </Request>

      <Request Name="SetOPCLoggerDbOwner" EstTime="500" TimeOut="2000000" UIName="#SER_SettingOPCLoggerDbOwner" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>
          <ChangeDBOwner Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL">
            <userName>ENS</userName>
            <dbName>PLES_AEHistory</dbName>
          </ChangeDBOwner>
        </Method>
      </Request>

      <Request Name="SetOPCLoggerConnString" EstTime="500" TimeOut="100000" UIName="#SER_SettingOPCLoggerConnectionStrings" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <SetAllConnectionStringsInConfigFile  Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL">
            <configFile>@globalProgramFileFolder/@\OPC Logger\OPCAELoggerSvc.exe.config</configFile>
            <connectionString>@globalConnectionString</connectionString>
            <exceptionList>LOCALSQLSERVER</exceptionList>
          </SetAllConnectionStringsInConfigFile>
        </Method>
      </Request>

      <Request Name="RegisterOPCLoggerServiceWithOPCLogger" EstTime="500" TimeOut="100000" UIName="#SER_RegisteringOPCLoggerServiceWithOPCLogger" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <RegisterSeviceWithOPCLogger Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.ServiceController" UIMessageOnFail="#SER_ErrorRegisteringService">
            <regPath>@Custom_ESolutionsRegistryLocation/@\OPC Logger</regPath>
            <machine>127.0.0.1</machine>
            <serviceName>PLOpcAELogger</serviceName>
            <url>tcp://127.0.0.1:1210/Logger.tcp</url>
            <isService>true</isService>
            <restartBusinessObjectOnTimeout>false</restartBusinessObjectOnTimeout>
            <restartAppOnTimeOut>false</restartAppOnTimeOut>
          </RegisterSeviceWithOPCLogger>
        </Method>
      </Request>

      <Request Name="RegisterOPCLoggerService" EstTime="500" TimeOut="200000" UIName="#SER_RegisteringOPCLoggerService" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldntRunExe">
            <cmd>%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe</cmd>
            <args>/Account=LocalSystem /ServiceHostInstanceName=PLOpcAELogger /i "@globalProgramFileFolder/@\OPC Logger\OPCAELoggerSvc.exe"</args>
          </RunExecutable>
          <CheckWindowServiceExisting Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_ServiceCouldNotBeRegistered">
            <serviceName>PLOpcAELogger</serviceName>
            <machineName>localhost</machineName>
          </CheckWindowServiceExisting>
          <StartServiceWithTimeout Library="NTServiceUtility" Class="Installer.InstallTools.NTServiceController">
            <displayServiceName>PLOpcAELogger</displayServiceName>
            <timeout>300</timeout>
          </StartServiceWithTimeout>
        </Method>
      </Request>


      <!--Sequence of Events Recorder install-->
      <Request Name="RegisterSER" EstTime="500" TimeOut="100000" UIName="#SER_RegisteringSER" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <RegisterModule Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.ModuleRegistrar" UIMessageOnFail="#SER_ErrorRegisteringSER" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <regPath>@Custom_ESolutionsRegistryLocation/@</regPath>
            <moduleName>SER</moduleName>
            <productFamily>eSolutionsWeb</productFamily>
            <description>Sequence of Events Recorder</description>
            <assemblyFile>@globalProgramFileFolder/@\SER\NSPlugin.dll</assemblyFile>
          </RegisterModule>
        </Method>
      </Request>

      <Request Name="InstallSERDbScripts" EstTime="500" TimeOut="200000" UIName="#SER_InstallingSERDBScripts" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>

          <!--PLES_SER.sql-->
          <ExecuteSQLScriptFile Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorInstallingScript" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <sqlFilePath>@globalProgramFileFolder/@\DatabaseScripts\PLES_SER.sql</sqlFilePath>
            <assemblyPath></assemblyPath>
          </ExecuteSQLScriptFile>
        </Method>
      </Request>

      <Request Name="SetSERDbOwner" EstTime="500" TimeOut="100000" UIName="#SER_SettingSERDbOwner" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <SetConnectionString Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>
          <ChangeDBOwner Library="DatabaseUtilities" Class="Installer.InstallTools.ConfigureSQL">
            <userName>ENS</userName>
            <dbName>PLES_SER</dbName>
          </ChangeDBOwner>
        </Method>
      </Request>

      <!--Migration Utility Configuration File Setup-->
      <Request Name="SetMigrationUtilityConnString" EstTime="500" TimeOut="100000" UIName="#SER_SettingSERMigrationUtilityConnStr" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <SetAllConnectionStringsInConfigFile  Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL">
            <configFile>@globalProgramFileFolder/@\SER\SERUpGrade.exe.config</configFile>
            <connectionString>@globalConnectionString</connectionString>
            <exceptionList>LOCALSQLSERVER</exceptionList>
          </SetAllConnectionStringsInConfigFile>
        </Method>
      </Request>

      <!--DB Maintenance Module install-->
      <Request Name="ScheduleDbMaintenanceTasks" EstTime="500" TimeOut="100000" UIName="#DatabaseMaintenanceJobInstallation" ProgressBar="Progress" ActionOnFail="Continue">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>

          <!-- ExpressMaint stored procedure-->
          <SetConnectionString Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>

          <ExecuteSQLScriptFile Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorInstallingScript">
            <sqlFilePath>@globalProgramFileFolder/@\DatabaseScripts\ExpressMaint.sql</sqlFilePath>
            <assemblyPath>@globalProgramFileFolder/@\Common\</assemblyPath>
          </ExecuteSQLScriptFile>


          <!--Full DB Backup-->
          <CreateDailyTask Library="WindowsScheduledTasks" Class="Installer.InstallTools.ScheduledTask">
            <taskName>Full DB Backup</taskName>
            <commandToRun>sqlcmd.exe -S @globalEEMDbServer/@ -i "@globalProgramFileFolder/@\DBMaintenance\Scripts\FullDatabaseBackup.sql"</commandToRun>
            <timeToRun>22:00:00</timeToRun>
            <endDate></endDate>
            <taskUser>@globalUserName2</taskUser>
            <taskUserPassword>@globalUserPassword2</taskUserPassword>
            <asyncExecution>false</asyncExecution>
          </CreateDailyTask>

          <!--Rebuildindex-->
          <CreateDailyTask Library="WindowsScheduledTasks" Class="Installer.InstallTools.ScheduledTask">
            <taskName>Rebuildindex</taskName>
            <commandToRun>sqlcmd.exe -S @globalEEMDbServer/@ -i "@globalProgramFileFolder/@\DBMaintenance\Scripts\Rebuildindex.sql"</commandToRun>
            <timeToRun>04:30:00</timeToRun>
            <endDate></endDate>
            <taskUser>@globalUserName2</taskUser>
            <taskUserPassword>@globalUserPassword2</taskUserPassword>
            <asyncExecution>false</asyncExecution>
          </CreateDailyTask>

          <!--ReorgIndex-->
          <CreateDailyTask Library="WindowsScheduledTasks" Class="Installer.InstallTools.ScheduledTask">
            <taskName>ReorgIndex</taskName>
            <commandToRun>sqlcmd.exe -S @globalEEMDbServer/@ -i "@globalProgramFileFolder/@\DBMaintenance\Scripts\ReorgIndex.sql"</commandToRun>
            <timeToRun>05:30:00</timeToRun>
            <endDate></endDate>
            <taskUser>@globalUserName2</taskUser>
            <taskUserPassword>@globalUserPassword2</taskUserPassword>
            <asyncExecution>false</asyncExecution>
          </CreateDailyTask>

          <!--TrimDiagnosticLogTable-->
          <CreateDailyTask Library="WindowsScheduledTasks" Class="Installer.InstallTools.ScheduledTask">
            <taskName>TrimDiagnosticLogTable</taskName>
            <commandToRun>sqlcmd.exe -S @globalEEMDbServer/@ -i "@globalProgramFileFolder/@\DBMaintenance\Scripts\TrimDiagnosticLogTable.sql"</commandToRun>
            <timeToRun>02:00:00</timeToRun>
            <endDate></endDate>
            <taskUser>@globalUserName2</taskUser>
            <taskUserPassword>@globalUserPassword2</taskUserPassword>
            <asyncExecution>false</asyncExecution>
          </CreateDailyTask>

          <!--TrimEventsTable-->
          <CreateDailyTask Library="WindowsScheduledTasks" Class="Installer.InstallTools.ScheduledTask">
            <taskName>TrimEventsTable</taskName>
            <commandToRun>sqlcmd.exe -S @globalEEMDbServer/@ -i "@globalProgramFileFolder/@\DBMaintenance\Scripts\TrimEventsTable.sql"</commandToRun>
            <timeToRun>01:00:00</timeToRun>
            <endDate></endDate>
            <taskUser>@globalUserName2</taskUser>
            <taskUserPassword>@globalUserPassword2</taskUserPassword>
            <asyncExecution>false</asyncExecution>
          </CreateDailyTask>
        </Method>
      </Request>

      <Request Name="InstallDBMaintScript" EstTime="500" TimeOut="2000000" UIName="#SER_DBBackupLocationSetup" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#Couldntrunexe">
            <cmd>sqlcmd.exe</cmd>
            <args>-S @globalEEMDbServer/@ -E -i "@globalProgramFileFolder/@\DBMaintenance\Scripts\DatabaseBackupSetup.sql"</args>
          </RunExecutable>
        </Method>
      </Request>

      <Request Name="DatabaseBackupUpdated" EstTime="500" TimeOut="2000000" UIName="#SER_DBBackupLocationUpdated" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#Couldntrunexe">
            <cmd>sqlcmd.exe</cmd>
            <args>-S @globalEEMDbServer/@ -E -i "@globalProgramFileFolder/@\DBMaintenance\Scripts\DatabaseBackupLocation.sql"  -v DatabaseName="PLES_Logging" -v BackupLocation="@globalDatabaseBackupFolder/@"</args>
          </RunExecutable>
        </Method>
      </Request>

      <!-- Needed request for permissions to Databasebackupfolder - otherwise SQL Server wont have permissions to backup databases-->
      <Request Name="DatabaseBackupPermissions" EstTime="500" TimeOut="100000" UIName="#SER_DBBackupLocationPermissions" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <SetServicePermissions Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.DBMaintUtil" UIMessageOnFail="#Couldntrunexe">
            <serviceName>@globalSQLServiceName/@</serviceName>
            <folderLocation>@globalDatabaseBackupFolder/@</folderLocation>
          </SetServicePermissions>
        </Method>
      </Request>

      <!--OPC Server Configuration-->
      <Request Name="SetSEROPCServerConnString32bit" EstTime="500" TimeOut="100000" UIName="#SER_SettingSEROPCServerConnectionString" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalIsx64>false</globalIsx64>
        </ConditionTrue>
        <Method>
          <SetAllConnectionStringsInConfigFile  Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL">
            <configFile>@globalProgramFileFolder/@\SER\DANSrvAE32.exe.config</configFile>
            <connectionString>@globalConnectionString</connectionString>
            <exceptionList>LOCALSQLSERVER</exceptionList>
          </SetAllConnectionStringsInConfigFile>
        </Method>
      </Request>
      <Request Name="SetSEROPCServerConnString64bit" EstTime="500" TimeOut="100000" UIName="#SER_SettingSEROPCServerConnectionString" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalIsx64>true</globalIsx64>
        </ConditionTrue>
        <Method>
          <SetAllConnectionStringsInConfigFile  Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL">
            <configFile>@globalProgramFileFolder/@\SER\DANSrvAE64.exe.config</configFile>
            <connectionString>@globalConnectionString</connectionString>
            <exceptionList>LOCALSQLSERVER</exceptionList>
          </SetAllConnectionStringsInConfigFile>
        </Method>
      </Request>

      <Request Name="RegisterSEROPCServer32bit" EstTime="500" TimeOut="100000" UIName="#SER_RegisteringSEROPCServer" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalIsx64>false</globalIsx64>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldntRunExe" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <cmd>@globalProgramFileFolder/@\SER\DANSrvAE32.exe</cmd>
            <args>/regserver</args>
          </RunExecutable>
        </Method>
      </Request>
      <Request Name="RegisterSEROPCServer64bit" EstTime="500" TimeOut="100000" UIName="#SER_RegisteringSEROPCServer" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalIsx64>true</globalIsx64>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldntRunExe" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <cmd>@globalProgramFileFolder/@\SER\DanSrvAE64.exe</cmd>
            <args>/regserver</args>
          </RunExecutable>
        </Method>
      </Request>

      <!-- Install the Service Manager -->
      <Request Name="RegisterServiceManager" EstTime="500" TimeOut="100000" UIName="#SER_RegisteringServiceManager" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldntRunExe">
            <cmd>@globalProgramFileFolder/@\Services\ServiceManager.exe</cmd>
            <args>install</args>
          </RunExecutable>
          <CheckWindowServiceExisting Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_ServiceCouldNotBeRegistered">
            <serviceName>SEServerManagerHost</serviceName>
            <machineName>localhost</machineName>
          </CheckWindowServiceExisting>
          <StartServiceWithTimeout Library="NTServiceUtility" Class="Installer.InstallTools.NTServiceController">
            <displayServiceName>SE Server Manager Host</displayServiceName>
            <timeout>300</timeout>
          </StartServiceWithTimeout>

        </Method>
      </Request>

      <!-- IIS Pre-Reqs -->
      <Request Name="InstallIISWin8Server2012" EstTime="800" TimeOut="1800000" UIName="#ConfigureWindowsIISRole" ProgressBar="Progress" ActionOnFail="Continue">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalOSType>Windows8|WindowsServer2012</globalOSType>
          <globalIsx64>true</globalIsx64>
        </ConditionTrue>
        <Method>
          <RunExecutableOn64bitOS Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>DISM.exe</cmd>
            <args>/Online /Enable-Feature /FeatureName:IIS-ApplicationDevelopment /FeatureName:IIS-ASP /FeatureName:IIS-ASPNET /FeatureName:IIS-NetFxExtensibility45 /FeatureName:IIS-ASPNET45 /FeatureName:WAS-ConfigurationAPI /FeatureName:WCF-NonHTTP-Activation /FeatureName:WCF-HTTP-Activation /FeatureName:WCF-HTTP-Activation45  /FeatureName:IIS-WebServer /FeatureName:IIS-WebServerRole /FeatureName:WAS-ProcessModel /FeatureName:WAS-WindowsActivationService /FeatureName:WAS-NetFxEnvironment /FeatureName:IIS-RequestFiltering /FeatureName:IIS-Security /FeatureName:IIS-ISAPIFilter /FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-NetFxExtensibility /FeatureName:IIS-DefaultDocument /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-StaticContent /FeatureName:IIS-WindowsAuthentication /NoRestart</args>
          </RunExecutableOn64bitOS>
          <RunExecutableOn64bitOS Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>DISM.exe</cmd>
            <args>/Online /Disable-Feature /FeatureName:WCF-HTTP-Activation45 /NoRestart</args>
          </RunExecutableOn64bitOS>
          <RunExecutableOn64bitOS Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>DISM.exe</cmd>
            <args>/Online /Enable-Feature /all /FeatureName:WCF-HTTP-Activation45 /NoRestart</args>
          </RunExecutableOn64bitOS>
        </Method>
      </Request>
      <Request Name="InstallIISWin8Server2012x86" EstTime="800" TimeOut="1800000" UIName="#ConfigureWindowsIISRole" ProgressBar="Progress" ActionOnFail="Continue">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalOSType>Windows8|WindowsServer2012</globalOSType>
          <globalIsx64>false</globalIsx64>
        </ConditionTrue>
        <Method>
          <RunExecutableWithReturn Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>DISM.exe</cmd>
            <args>/Online /Enable-Feature /FeatureName:IIS-ApplicationDevelopment /FeatureName:IIS-ASP /FeatureName:IIS-ASPNET /FeatureName:IIS-NetFxExtensibility45 /FeatureName:IIS-ASPNET45 /FeatureName:WAS-ConfigurationAPI /FeatureName:WCF-NonHTTP-Activation /FeatureName:WCF-HTTP-Activation /FeatureName:WCF-HTTP-Activation45  /FeatureName:IIS-WebServer /FeatureName:IIS-WebServerRole /FeatureName:WAS-ProcessModel /FeatureName:WAS-WindowsActivationService /FeatureName:WAS-NetFxEnvironment /FeatureName:IIS-RequestFiltering /FeatureName:IIS-Security /FeatureName:IIS-ISAPIFilter /FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-NetFxExtensibility /FeatureName:IIS-DefaultDocument /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-StaticContent /FeatureName:IIS-WindowsAuthentication /NoRestart</args>
          </RunExecutableWithReturn>
          <RunExecutableWithReturn Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>DISM.exe</cmd>
            <args>/Online /Disable-Feature /FeatureName:WCF-HTTP-Activation45 /NoRestart</args>
          </RunExecutableWithReturn>
          <RunExecutableWithReturn Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>DISM.exe</cmd>
            <args>/Online /Enable-Feature /all /FeatureName:WCF-HTTP-Activation45 /NoRestart</args>
          </RunExecutableWithReturn>
        </Method>
      </Request>


      <Request Name="InstallIISWin7Server2008" EstTime="500" TimeOut="1200000" UIName="#ConfigureWindowsIISRole" ProgressBar="Animation" ActionOnFail="Continue">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalOSType>Windows7|WindowsServer2008R2|WindowsServer2008</globalOSType>
          <globalIsx64>true</globalIsx64>
        </ConditionTrue>
        <Method>
          <RunExecutableOn64bitOS Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>pkgmgr</cmd>
            <args>/iu:IIS-ASPNET;IIS-ApplicationDevelopment;IIS-WebServer;IIS-WebServerRole;WAS-ProcessModel;WAS-WindowsActivationService;WAS-NetFxEnvironment;IIS-RequestFiltering;IIS-Security;IIS-ISAPIFilter;IIS-ISAPIExtensions;IIS-NetFxExtensibility;IIS-DefaultDocument;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-WindowsAuthentication </args>
          </RunExecutableOn64bitOS>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe</cmd>
            <args>-iru</args>
          </RunExecutable>
        </Method>
      </Request>
      <Request Name="InstallIISWin7Server2008x86" EstTime="500" TimeOut="1200000" UIName="#ConfigureWindowsIISRole" ProgressBar="Animation" ActionOnFail="Continue">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalOSType>Windows7|WindowsServer2008R2|WindowsServer2008</globalOSType>
          <globalIsx64>false</globalIsx64>
        </ConditionTrue>
        <Method>
          <RunExecutableWithReturn Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>%systemroot%\system32\pkgmgr.exe</cmd>
            <args>/iu:IIS-ASPNET;IIS-ApplicationDevelopment;IIS-WebServer;IIS-WebServerRole;WAS-ProcessModel;WAS-WindowsActivationService;WAS-NetFxEnvironment;IIS-RequestFiltering;IIS-Security;IIS-ISAPIFilter;IIS-ISAPIExtensions;IIS-NetFxExtensibility;IIS-DefaultDocument;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-WindowsAuthentication </args>
          </RunExecutableWithReturn>
          <RunExecutableWithReturn Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe</cmd>
            <args>-iru</args>
          </RunExecutableWithReturn>
        </Method>
      </Request>

      <!--Create SER Website-->
      <Request Name="CreateSERWebsite" EstTime="500" TimeOut="0" UIName="#SER_CreatingSERWebsite" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>

          <CreateWebSite Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.WebSiteManager" UIMessageOnFail="#SER_ErrorCreatingWebsite"  ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <webSiteName>SerConfig</webSiteName>
            <ip></ip>
            <port>86</port>
            <hostHeader></hostHeader>
            <path>@globalProgramFileFolder/@\Websites\SerConfig</path>
            <indexPage></indexPage>
            <appPoolName>ENMSolutionsPool</appPoolName>
            <integratedMode>true</integratedMode>
            <appStartMenuDir>Schneider Electric\StruxureWare Solutions</appStartMenuDir>
            <shortcutName>SER Configuration</shortcutName>
            <iconPath>@globalProgramFileFolder/@\Websites\SerConfig\favicon.ico</iconPath>
            <mimeTypes>.woff;application/x-font-woff</mimeTypes>
            <isBinFolderApp>false</isBinFolderApp>
          </CreateWebSite>

        </Method>
      </Request>

      <!--Create M&D Website-->
      <Request Name="CreateMandDWebsite" EstTime="500" TimeOut="0" UIName="#SER_CreatingMandDWebsite" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>

          <CreateWebSite Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.WebSiteManager" UIMessageOnFail="#SER_ErrorCreatingWebsite"  ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <webSiteName>MonDiagSpa</webSiteName>
            <ip></ip>
            <port>85</port>
            <hostHeader></hostHeader>
            <path>@globalProgramFileFolder/@\Websites\MonDiagSpa</path>
            <indexPage></indexPage>
            <appPoolName>ENMSolutionsPool</appPoolName>
            <integratedMode>true</integratedMode>
            <appStartMenuDir>Schneider Electric\StruxureWare Solutions</appStartMenuDir>
            <shortcutName>Monitoring and Diagnostics</shortcutName>
            <iconPath>@globalProgramFileFolder/@\Websites\MonDiagSpa\Content\images\MandDIcon.ico</iconPath>
            <mimeTypes>.woff;application/x-font-woff</mimeTypes>
            <isBinFolderApp>false</isBinFolderApp>
          </CreateWebSite>

        </Method>
      </Request>

      <Request Name="SetWebConfigConnStr" EstTime="500" TimeOut="100000" UIName="#SER_SettingWebsiteConnectionStrings" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <SetAllConnectionStringsInConfigFile  Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL">
            <configFile>@globalProgramFileFolder/@\Websites\SerConfig\Web.config</configFile>
            <connectionString>@globalConnectionString</connectionString>
            <exceptionList>LOCALSQLSERVER</exceptionList>
          </SetAllConnectionStringsInConfigFile>
          <SetAllConnectionStringsInConfigFile  Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL">
            <configFile>@globalProgramFileFolder/@\Websites\MonDiagSpa\Web.config</configFile>
            <connectionString>@globalConnectionString</connectionString>
            <exceptionList>LOCALSQLSERVER</exceptionList>
          </SetAllConnectionStringsInConfigFile>
        </Method>
      </Request>


      <Request Name="RestartStateService" EstTime="500" TimeOut="0" UIName="#SER_RestartingStateService" ProgressBar="Animation" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <StartServiceWithTimeout Library="NTServiceUtility" Class="Installer.InstallTools.NTServiceController">
            <displayServiceName>aspnet_state</displayServiceName>
            <timeout>300</timeout>
          </StartServiceWithTimeout>
        </Method>
      </Request>

      <Request Name="CreateServiceDependencies" EstTime="500" TimeOut="100000" UIName="Create Service Dependencies" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder</globalSetupType>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldntRunExe">
            <cmd>sc</cmd>
            <args>config "PLOpcAELogger" depend= @globalSQLServiceName/@</args>
          </RunExecutable>
        </Method>
      </Request>

      <Request Name="AllowISAPICGI" EstTime="500" TimeOut="100000" UIName="#ConfigureISAPIandCGIrestrictio" ProgressBar="Progress" ActionOnFail="Prompt">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#CouldnotconfigureISAPICGIPermi">
            <cmd>%systemroot%\system32\inetsrv\AppCmd.exe</cmd>
            <args>set config /section:isapiCgiRestriction /[path='%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll'].allowed:True</args>
          </RunExecutable>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#CouldnotconfigureISAPICGIPermi">
            <cmd>%systemroot%\system32\inetsrv\AppCmd.exe</cmd>
            <args>set config /section:isapiCgiRestriction /[path='%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll'].allowed:True</args>
          </RunExecutable>
        </Method>
      </Request>

      <Request Name="RestartOPCLoggerService" EstTime="500" TimeOut="200000" UIName="#SER_RestartingOPCLoggerService" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <StopServiceWithTimeout Library="NTServiceUtility" Class="Installer.InstallTools.NTServiceController">
            <serviceName>PLOpcAELogger</serviceName>
            <timeout>3000</timeout>
          </StopServiceWithTimeout>
          <StartServiceWithTimeout Library="NTServiceUtility" Class="Installer.InstallTools.NTServiceController">
            <displayServiceName>PLOpcAELogger</displayServiceName>
            <timeout>15000</timeout>
          </StartServiceWithTimeout>
        </Method>
      </Request>

      <!--Modify Uninstall file of SER for an Upgrade Scenario-->
      <Request Name="ModifyUpgradeInstallInfo" EstTime="500" TimeOut="100000" UIName="#SER_ModifyingUpgradeInfo" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalAction>Upgrade</globalAction>
        </ConditionTrue>
        <Method>
          <ModifyAttribute Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.XMLFileHelper" UIMessageOnFail="#SER_ErrorModifyingInstallInfo"
                           ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <filePath>@globalProgramFileFolder/@\Uninst_EventNotificationModule\InstallInfo.xml</filePath>
            <menuGroup>InstallInfo</menuGroup>
            <menuItem>InstallGlobal</menuItem>
            <attributeName>globalAction</attributeName>
            <value>Install</value>
          </ModifyAttribute>
        </Method>
      </Request>

      <!--Update the Schema version in the AE History database-->
      <Request Name="UpdateAEHistorySchemaVersion" EstTime="500" TimeOut="100000" UIName="#SER_UpdateHistorySchemaVersion" ProgressBar="Progress" ActionOnFail="Continue"
               ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <GetRegistryValue Library="RegistrySetup" Class="Installer.InstallTools.SetupRegistry" SetReturnProperty="SER_Version" UIMessageOnFail="#SER_UpdateHistSchemaRetrieveFailed"
                            ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <regPath>SOFTWARE\Schneider-Electric\PowerLogic eSolutions\OPC Logger</regPath>
            <keyValue>Version</keyValue>
          </GetRegistryValue>

          <SetConnectionString Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_ErrorSettingConnectionString"
                               ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <connectionString>@globalConnectionString</connectionString>
          </SetConnectionString>

          <UpdateDBSchemaVersion Library="InstallTools.Extensions" Class="SchneiderElectric.Installer.InstallTools.Extensions.ConfigureSQL" UIMessageOnFail="#SER_UpdateHistSchemaSetFailed"
                                 ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <version>@SER_Version</version>
            <schemaTableName>LG_SCHEMA_VERSION</schemaTableName>
            <dbName>PLES_AEHistory</dbName>
          </UpdateDBSchemaVersion>
        </Method>
      </Request>

      <!--Request to let ENM know that SER has been installed-->
      <Request Name="ModifyENMInstallInfo" EstTime="500" TimeOut="100000" UIName="#SER_ModifyingENMInstallInfo" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>true</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <ModifyAttribute Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.XMLFileHelper" UIMessageOnFail="#SER_ErrorModifyingENMInstallInfo" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <filePath>@globalProgramFileFolder/@\Uninst_EventNotificationModule\InstallInfo.xml</filePath>
            <menuGroup>InstallInfo</menuGroup>
            <menuItem>InstallGlobal</menuItem>
            <attributeName>Custom_Solution_IsSERInstalled|Custom_SERInstalled</attributeName>
            <value>true</value>
          </ModifyAttribute>
        </Method>
      </Request>
    </BrokerRequest>

    <BrokerRequest Name="Uninstall">

      <!--Sequence of Events Recorder uninstall-->
      <Request Name="RemoveSequenceEventsRecorderVirtualDirectory" EstTime="500" TimeOut="100000" UIName="#SER_RemovingSequenceEventsRecorderVirtualDirectory" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <DeleteVirtualDirectory Library="IISManager" Class="Installer.InstallTools.IISManager" UIMessageOnFail="#Oneormorevirtualdirectoriescou">
            <nameDirectory>SWSERSetupWeb</nameDirectory>
          </DeleteVirtualDirectory>
        </Method>
      </Request>

      <Request Name="UnregisterSER" EstTime="500" TimeOut="100000" UIName="#SER_UnregisteringSER" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <UnregisterModule Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.ModuleRegistrar" UIMessageOnFail="#SER_ErrorUnregisteringSER" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <regPath>@Custom_ESolutionsRegistryLocation</regPath>
            <moduleName>SER</moduleName>
          </UnregisterModule>
        </Method>
      </Request>

      <!--OPC Logger Module uninstall-->
      <Request Name="UnregisterOPCLoggerService" EstTime="500" TimeOut="100000" UIName="#SER_UnregisteringOPCLoggerService" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <cmd>%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe</cmd>
            <args>/servicename=PLOpcAELogger /u "@globalProgramFileFolder/@\OPC Logger\OPCAELoggerSvc.exe"</args>
          </RunExecutable>
        </Method>
      </Request>

      <Request Name="UnregisterServicesManager" EstTime="500" TimeOut="100000" UIName="#SER_UnregisteringServiceManager" ProgressBar="Progress" ActionOnFail="Continue"
               ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldntRunExe">
            <cmd>@globalProgramFileFolder/@\Services\ServiceManager.exe</cmd>
            <args>uninstall</args>
          </RunExecutable>
        </Method>
      </Request>

      <Request Name="RemoveExtraOPCLoggerFiles" EstTime="500" TimeOut="1200000" UIName="#SER_RemovingOPCLoggerFiles" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <DeleteFileIfExists Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldNotCleanupFiles" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <fileName>@globalProgramFileFolder/@\OPC Logger\OPCAELoggerSvc.InstallLog</fileName>
          </DeleteFileIfExists>

          <DeleteFileIfExists Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldNotCleanupFiles" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <fileName>@globalProgramFileFolder/@\OPC Logger\Services.xml</fileName>
          </DeleteFileIfExists>
        </Method>
      </Request>

      <Request Name="UnregisterOPCLogger" EstTime="500" TimeOut="100000" UIName="#SER_UnregisteringOPCLogger" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <UnregisterModule Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.ModuleRegistrar" UIMessageOnFail="#SER_ErrorUnregisteringOPCLogger" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <regPath>@Custom_ESolutionsRegistryLocation</regPath>
            <moduleName>OPC Logger</moduleName>
          </UnregisterModule>
        </Method>
      </Request>

      <!--DB Maintenance Module uninstall-->
      <Request Name="RemoveDbMaintenanceTasks" EstTime="500" TimeOut="100000" UIName="#SER_RemovingDBMaintenanceTasks" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|DbServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>

          <!--Full DB Backup-->
          <DeleteScheduledTask Library="WindowsScheduledTasks" Class="Installer.InstallTools.ScheduledTask" UIMessageOnFail="#SER_ErrorRemovingScheduledDatabaseMaintenanceTask">
            <taskName>Full DB Backup</taskName>
          </DeleteScheduledTask>

          <!--Rebuildindex-->
          <DeleteScheduledTask Library="WindowsScheduledTasks" Class="Installer.InstallTools.ScheduledTask" UIMessageOnFail="#SER_ErrorRemovingScheduledDatabaseMaintenanceTask">
            <taskName>Rebuildindex</taskName>
          </DeleteScheduledTask>

          <!--ReorgIndex-->
          <DeleteScheduledTask Library="WindowsScheduledTasks" Class="Installer.InstallTools.ScheduledTask" UIMessageOnFail="#SER_ErrorRemovingScheduledDatabaseMaintenanceTask">
            <taskName>ReorgIndex</taskName>
          </DeleteScheduledTask>

          <!--TrimDiagnosticLogTable-->
          <DeleteScheduledTask Library="WindowsScheduledTasks" Class="Installer.InstallTools.ScheduledTask" UIMessageOnFail="#SER_ErrorRemovingScheduledDatabaseMaintenanceTask">
            <taskName>TrimDiagnosticLogTable</taskName>
          </DeleteScheduledTask>

          <!--TrimEventsTable-->
          <DeleteScheduledTask Library="WindowsScheduledTasks" Class="Installer.InstallTools.ScheduledTask" UIMessageOnFail="#SER_ErrorRemovingScheduledDatabaseMaintenanceTask">
            <taskName>TrimEventsTable</taskName>
          </DeleteScheduledTask>

        </Method>
      </Request>


      <!--Unregister OPC AE Server-->
      <Request Name="UnregisterSEROPCServer32bit" EstTime="500" TimeOut="100000" UIName="#SER_UnregisteringSEROPCServer" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalIsx64>false</globalIsx64>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldntRunExe">
            <cmd>@globalProgramFileFolder/@\SER\DanSrvAE32.exe</cmd>
            <args>/unregserver</args>
          </RunExecutable>
        </Method>
      </Request>
      <Request Name="UnregisterSEROPCServer64bit" EstTime="500" TimeOut="100000" UIName="#SER_UnregisteringSEROPCServer" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <globalIsx64>true</globalIsx64>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldntRunExe">
            <cmd>@globalProgramFileFolder/@\SER\DanSrvAE64.exe</cmd>
            <args>/unregserver</args>
          </RunExecutable>
        </Method>
      </Request>

      <!-- Remove ENM and Alarm Sentry Websites-->
      <Request Name="RemoveSERWebsiteShortcuts" EstTime="500" TimeOut="100000" UIName="#SER_RemovingWebsiteShortcuts" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <DeleteWebsiteShortcuts Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.WebSiteManager">
            <appStartMenuDir>Schneider Electric\StruxureWare Solutions</appStartMenuDir>
            <shortcutName>SER Configuration</shortcutName>
          </DeleteWebsiteShortcuts>
        </Method>
      </Request>

      <Request Name="RemoveSERWebsite" EstTime="500" TimeOut="100000" UIName="#SER_RemovingWebsite" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <RemoveIISWebSite Library="IISManager" Class="Installer.InstallTools.IISManager" UIMessageOnFail="#Oneormorevirtualdirectoriescou">
            <siteName>SerConfig</siteName>
          </RemoveIISWebSite>
        </Method>
      </Request>


      <!--Shared Component Uninstall-->
      <Request Name="RemoveMandDWebsiteShortcuts" EstTime="500" TimeOut="100000" UIName="#SER_RemovingMandDWebsiteShortcuts" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>

          <DeleteWebsiteShortcuts Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.WebSiteManager">
            <appStartMenuDir>Schneider Electric\StruxureWare Solutions</appStartMenuDir>
            <shortcutName>Monitoring and Diagnostics</shortcutName>
          </DeleteWebsiteShortcuts>
        </Method>
      </Request>

      <Request Name="RemoveMandDWebsite" EstTime="500" TimeOut="100000" UIName="#SER_RemovingMandDWebsite" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <RemoveIISWebSite Library="IISManager" Class="Installer.InstallTools.IISManager" UIMessageOnFail="#Oneormorevirtualdirectoriescou">
            <siteName>MonDiagSpa</siteName>
          </RemoveIISWebSite>
        </Method>
      </Request>


      <Request Name="RemoveAppPool" EstTime="500" TimeOut="100000" UIName="#SER_RemovingAppPool" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <RunExecutable Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#CouldnotconfigureISAPICGIPermi">
            <cmd>%systemroot%\system32\inetsrv\AppCmd.exe</cmd>
            <args>delete apppool /apppool.name:ENMSolutionsPool</args>
          </RunExecutable>
        </Method>
      </Request>

      <Request Name="RemoveWindowsGroups" EstTime="500" TimeOut="100000" UIName="#SER_RemovingWindowsGroups" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
        </ConditionTrue>
        <Method>
          <DeleteWindowsGroup Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <groupName>SERAdmin</groupName>
          </DeleteWindowsGroup>
          <DeleteWindowsGroup Library="WinUtilities" Class="Installer.InstallTools.WinUtilities">
            <groupName>SERUser</groupName>
          </DeleteWindowsGroup>
        </Method>
      </Request>

      <Request Name="RemoveSERInstallRoot" EstTime="500" TimeOut="100000" UIName="#SER_RemovingInstallRoot" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <DeleteRegValue Library="RegistrySetup" Class="Installer.InstallTools.SetupRegistry">
            <regPath>@Custom_ESolutionsRegistryLocation</regPath>
            <regValue>InstallRoot</regValue>
          </DeleteRegValue >
        </Method>
      </Request>

      <!--Remove Root Install Folder-->
      <Request Name="RemoveRootInstallFolder" EstTime="500" TimeOut="1200000" UIName="#SER_RemovingRootFolder" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <DeleteFolder Library="WinUtilities" Class="Installer.InstallTools.WinUtilities" UIMessageOnFail="#SER_CouldNotCleanupFolder">
            <destPath>@globalProgramFileFolder</destPath>
          </DeleteFolder>
        </Method>
      </Request>

      <!--Installer Registry Cleanup-->
      <Request Name="CleanRegistry" EstTime="500" TimeOut="100000" UIName="#SER_RemovingRegistryEntries" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <Custom_APMInstalled>false</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <DeleteRegPath Library="RegistrySetup" Class="Installer.InstallTools.SetupRegistry">
            <regPath>SOFTWARE\Schneider Electric\Installer</regPath>
          </DeleteRegPath>
        </Method>
      </Request>

      <!--Request to let ENM know that SER has been uninstalled-->
      <Request Name="ModifyENMInstallInfoUninstall" EstTime="500" TimeOut="100000" UIName="#SER_ModifyingENMInstallInfo" ProgressBar="Progress" ActionOnFail="Continue" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
        <ConditionTrue>
          <globalSetupType>SequenceEventsRecorder|AppServer</globalSetupType>
          <Custom_APMInstalled>true</Custom_APMInstalled>
        </ConditionTrue>
        <Method>
          <ModifyAttribute Library="InstallTools.Extensions.eSolutions" Class="SchneiderElectric.Installer.InstallTools.Extensions.eSolutions.XMLFileHelper" UIMessageOnFail="#SER_ErrorModifyingENMInstallInfo" ResourceFile="SER.Resources.Installer.InstallStrings" ResourceAssembly="SER.Resources.Installer">
            <filePath>@globalProgramFileFolder/@\Uninst_EventNotificationModule\InstallInfo.xml</filePath>
            <menuGroup>InstallInfo</menuGroup>
            <menuItem>InstallGlobal</menuItem>
            <attributeName>Custom_Solution_IsSERInstalled|Custom_SERInstalled</attributeName>
            <value>false</value>
          </ModifyAttribute>
        </Method>
      </Request>

    </BrokerRequest>

  </BrokerRequests>
</InstBroker>
