<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Product Name="Record Organizer" Id="*" UpgradeCode="{6387325E-F6D7-46BE-BBA8-D0E37BEEF800}" Version="$(var.ProductVersion)" Manufacturer="Digital Data" Language="1031" Codepage="1252">
    <Package Id="*" Keywords="Installer" Description="Digital Data Record Organizer Setup" Comments="Record Organizer is a registered Trademark of Digital Data" Manufacturer="Digital Data" InstallerVersion="100" Languages="1031" Compressed="yes" SummaryCodepage="1252"/>
    
    <!-- Nicht entfernen! -->
    <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1' />
    <Property Id='DiskPrompt' Value="Record Organizer Install" />

    <!-- UPGRADE -->
    <!-- 
      Bei neuer Version muss die Versionsnummer unter 
      My Project >> Anwendung >> Assemblyinformationen und unter Product/@Version geändert werden.
      Hier die Assemblyversion UND Dateiversion ändern.
      
      NICHT den UpdateCode ändern!
      Darf sich NIE MEHR ändern!
    -->
    <MajorUpgrade
      AllowDowngrades="no"
      AllowSameVersionUpgrades="no"
      DowngradeErrorMessage="Eine neuere Version von [ProductName] ist bereits installiert. Das Setup wird beendet."
    />
  
    <Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
    <Upgrade Id="{6387325E-F6D7-46BE-BBA8-D0E37BEEF800}">
      <UpgradeVersion
        Minimum="1.0.0.0" Maximum="99.0.0.0"
        Property="PREVIOUSVERSIONSINSTALLED"
        IncludeMinimum="yes" IncludeMaximum="no" />
    </Upgrade>
    <!-- UPGRADE END -->

    <!-- Legt das Icon fest -->
    <Icon Id="DDRecordOrganiser.exe" SourceFile="DD-Record-Organiser.exe" />
    
    <!-- Zeige Icon in Systemsteuerung > Programme entfernen -->
    <Property Id="ARPPRODUCTICON" Value="DDRecordOrganiser.exe" />

    <!-- Liest den Installationsort über die Registry aus -->
    <Property Id="APPLICATIONFOLDER">
      <RegistrySearch Key="Software\[Manufacturer]\[ProductName]" Root="HKCU" Type="raw" Id="APPLICATIONFOLDER_REGSEARCH" Name="Path" />
    </Property>

    <!-- Legt die Ordner Struktur fest -->
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder" Name="Pfiles">
        <Directory Id="DD" Name="Digital Data">
          
          <!-- Speichert den Installationsort in der Registry -->
          <Component Id="RegistryEntries" Guid="57CCE36E-F152-4D17-81A0-CCAAEFA777A3">
            <RegistryKey Root="HKCU" Key="Software\[Manufacturer]\[ProductName]">
              <RegistryValue Type="string" Name="Path" Value="[DD]" KeyPath="yes" />
            </RegistryKey>
          </Component>
          
          <!-- Das Installationsverzeichnis -->
          <Directory Id="INSTALLDIR" Name="Record Organizer 1.0">          
            
            <!-- Die DD-Record-Organiser.exe und Shortcuts für Desktop und Startmenü -->
            <Component Id="MainExecutable" Guid="9CC5D446-F056-4A09-995D-9DF53A7F0E38">
              <File Id="PMOEXE" Name="DD-Record-Organiser.exe" Source="DD-Record-Organiser.exe" KeyPath="yes">
                <Shortcut Id="StartMenuShortcut" Directory="ProgramMenuDir" Name="Digitale Produktionsakte" WorkingDirectory="INSTALLDIR" Icon="DDRecordOrganiser.exe" IconIndex="0" Advertise="yes" />
                <Shortcut Id="DesktopShortcut" Directory="DesktopFolder" Name="Digitale Produktionsakte" WorkingDirectory="INSTALLDIR" Icon="DDRecordOrganiser.exe" IconIndex="0" Advertise="yes" />
              </File>
              <!-- Programmordner bei Deinstallation entfernen-->
              <util:RemoveFolderEx Id="RemoveApplicationFolder" On="uninstall" Property="APPLICATIONFOLDER" />
            </Component>
            
            <!-- WINDREAM Bibliotheken -->
            <Component Id="WindreamLibs" Guid="4D11FC99-50D9-4E54-B18A-8885C9112646">
              <File Id="INDEXLibDLL" Name="AxInterop.INDEXLib.dll" Source="AxInterop.INDEXLib.dll" KeyPath="yes" />
              <File Id="AxOBJECTLISTCONTROLLibDLL" Name="AxInterop.OBJECTLISTCONTROLLib.dll" Source="AxInterop.OBJECTLISTCONTROLLib.dll" KeyPath="no" />
              <File Id="OBJECTLISTCONTROLLibDDL" Name="Interop.OBJECTLISTCONTROLLib.dll" Source="Interop.OBJECTLISTCONTROLLib.dll" KeyPath="no" />
              <File Id="WINDREAMLibDLL" Name="Interop.WINDREAMLib.dll" Source="Interop.WINDREAMLib.dll" KeyPath="no" />
              <File Id="WMOTOOLLib" Name="Interop.WMOTOOLLib.dll" Source="Interop.WMOTOOLLib.dll" KeyPath="no" />
              <File Id="WMOBRWSLib" Name="Interop.WMOBRWSLib.dll" Source="Interop.WMOBRWSLib.dll" KeyPath="no" />
              <File Id="WMOSRCHLib" Name="Interop.WMOSRCHLib.dll" Source="Interop.WMOSRCHLib.dll" KeyPath="no" />
            </Component>
             <!-- Oracle-Bibliothek -->
            <Component Id="Oracle" Guid="CF76DB5D-3263-450F-96C6-F02F5447A0A1">
              <File Id="Oracle.ManagedDataAccess" Name="Oracle.ManagedDataAccess.dll" Source="D:\Programme\DB\Oracle\ora12.1\Client\ODP.NET\managed\common\Oracle.ManagedDataAccess.dll" KeyPath="yes" />
            </Component>
            
            <Component Id="Commandline" Guid="53F9734C-F020-4885-96DC-D8CD880E8446">
              <File Id="Commandline" Name="Commandline.dll" Source="Commandline.dll" KeyPath="yes" />
            </Component>
                      
            <!-- DD Bibliotheken -->
            <Component Id="DDLibs" Guid="BA2979E3-3778-48B8-B0D8-4B77825B9293">
              <File Id="SnapPanelLib" Name="SnapPanelControl.dll" Source="SnapPanelControl.dll" KeyPath="yes" />
              <File Id="DLLLicenseManager" Name="DLLLicenseManager.dll" Source="DLLLicenseManager.dll" KeyPath="no" />
            </Component>
            
            <!-- MAIL.NET Bibliothek -->
            <Component Id="IndependentsoftLibs" Guid="C3B3BB48-DB41-4419-A4B8-0E4DC5E8856B">
              <File Id="MSGLib" Name="Independentsoft.Msg.dll" Source="Independentsoft.Msg.dll" KeyPath="yes" />
            </Component>
            
            <!-- DEVEXPRESS Bibliotheken -->
            <Component Id="DevExpressLibs" Guid="CB40DAAE-348E-4BD3-B275-9A526EB8F191">
              <File Id="DevExpress.Data.v15.1" Name="DevExpress.Data.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.Data.v15.1.dll" KeyPath="yes" />
              <File Id="DevExpress.Office.v15.1.Core" Name="DevExpress.Office.v15.1.Core.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.Office.v15.1.Core.dll" />
              <File Id="DevExpress.Printing.v15.1.Core" Name="DevExpress.Printing.v15.1.Core.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.Printing.v15.1.Core.dll" />
              <File Id="DevExpress.RichEdit.v15.1.Core" Name="DevExpress.RichEdit.v15.1.Core.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.RichEdit.v15.1.Core.dll" />
              <File Id="DevExpress.Utils.v15.1" Name="DevExpress.Utils.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.Utils.v15.1.dll" />
              <File Id="DevExpress.XtraBars.v15.1" Name="DevExpress.XtraBars.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraBars.v15.1.dll" />
              <File Id="DevExpress.XtraEditors.v15.1" Name="DevExpress.XtraEditors.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraEditors.v15.1.dll" />
              <File Id="DevExpress.XtraGrid.v15.1" Name="DevExpress.XtraGrid.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraGrid.v15.1.dll" />
              <File Id="DevExpress.XtraLayout.v15.1" Name="DevExpress.XtraLayout.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraLayout.v15.1.dll" />
              <File Id="DevExpress.XtraNavBar.v15.1" Name="DevExpress.XtraNavBar.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraNavBar.v15.1.dll" />
              <File Id="DevExpress.XtraPrinting.v15.1" Name="DevExpress.XtraPrinting.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraPrinting.v15.1.dll" />
              <File Id="DevExpress.XtraRichEdit.v15.1" Name="DevExpress.XtraRichEdit.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraRichEdit.v15.1.dll" />
              <File Id="DevExpress.XtraScheduler.v15.1" Name="DevExpress.XtraScheduler.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraScheduler.v15.1.dll" />
              <File Id="DevExpress.XtraScheduler.v15.1.Core" Name="DevExpress.XtraScheduler.v15.1.Core.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraScheduler.v15.1.Core.dll" />
              <File Id="DevExpress.XtraScheduler.v15.1.Extensions" Name="DevExpress.XtraScheduler.v15.1.Extensions.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraScheduler.v15.1.Extensions.dll" />
              <File Id="DevExpress.XtraTreeList.v15.1" Name="DevExpress.XtraTreeList.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraTreeList.v15.1.dll" />
              <File Id="DevExpress.XtraVerticalGrid.v15.1" Name="DevExpress.XtraVerticalGrid.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraVerticalGrid.v15.1.dll" />
              <File Id="DevExpress.XtraWizard.v15.1" Name="DevExpress.XtraWizard.v15.1.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\DevExpress.XtraWizard.v15.1.dll" />
            </Component>

            <!-- Lokalisierung für DEVEXPRESS Bibliotheken-->
            <Directory Id="LOCALE_DE" Name="de">
              <Component Id="Scheduler.Locales" Guid="84335DB2-F5D2-496B-9318-2BD1B1ACA391">
                <File Id="DevExpress.XtraScheduler.v15.1.Core.resources" Name="DevExpress.XtraScheduler.v15.1.Core.resources.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\de\DevExpress.XtraScheduler.v15.1.Core.resources.dll"></File>
                <File Id="DevExpress.XtraScheduler.v15.1.Extensions.resources" Name="DevExpress.XtraScheduler.v15.1.Extensions.resources.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\de\DevExpress.XtraScheduler.v15.1.Extensions.resources.dll"></File>
                <File Id="DevExpress.XtraScheduler.v15.1.resources" Name="DevExpress.XtraScheduler.v15.1.resources.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\de\DevExpress.XtraScheduler.v15.1.resources.dll"></File>
                <File Id="DevExpress.XtraScheduler.v15.1.Reporting.resources" Name="DevExpress.XtraScheduler.v15.1.Reporting.resources.dll" Source="D:\Programme\Sprachen\DevExpress 15.1\Components\Bin\Framework\de\DevExpress.XtraScheduler.v15.1.Reporting.resources.dll"></File>
              </Component>
            </Directory>
          </Directory>
        </Directory>
      </Directory>

      <!-- Startmenü Ordner -->
      <Directory Id="ProgramMenuFolder" Name="Programs">
        <Directory Id="ProgramMenuDir" Name="Record Organizer">
          <Component Id="ProgramMenuDir" Guid="5200DF59-FED6-4C5A-8393-90B8ED526432">
            <RemoveFolder Id="ProgramMenuDir" On="uninstall" />
            
            <!-- Wird bei Deinstallation gelöscht -->
            <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="[DD]" Name="Path" />
            <RegistryValue Root="HKCU" Key="Software\Classes\pmo" Type="string" Name="URL Protocol" Value="" />
            <RegistryValue Root="HKCU" Key="Software\Classes\pmo\DefaultIcon" Type="string" Value="&quot;[INSTALLDIR]DD-Record-Organiser.exe,0&quot;" />
            <RegistryValue Root="HKCU" Key="Software\Classes\pmo\shell\open\command" Type="string" Value="&quot;[INSTALLDIR]DD-Record-Organiser.exe&quot; --data %1" />
          </Component>
        </Directory>
      </Directory>
 
      <!-- Desktop Ordner -->
      <Directory Id="DesktopFolder" Name="Desktop" />
    </Directory>

    <!-- Installierte Features -->
    <Feature Id="Complete" Level="1">
      <ComponentRef Id="MainExecutable" />
      <ComponentRef Id="WindreamLibs" />
      <ComponentRef Id="DDLibs" />
      <ComponentRef Id="IndependentsoftLibs" />
      <ComponentRef Id="Scheduler.Locales" />
      <ComponentRef Id="DevExpressLibs" />
      <ComponentRef Id="ProgramMenuDir"/>
      <ComponentRef Id="RegistryEntries"/>
      <ComponentRef Id="Oracle" />
      <ComponentRef Id="Commandline" />
    </Feature>

    <!-- Legt das Standard-Installationsverzeichnis fest-->
    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
    
    <!-- OBERFLÄCHE -->
    <UI>
      <UIRef Id="WixUI_InstallDir" />
      <UIRef Id="WixUI_ErrorProgressText" />
      <Publish Dialog="WelcomeDlg"
            Control="Next"
            Event="NewDialog"
            Value="InstallDirDlg"
            Order="2">1</Publish>
      <Publish Dialog="InstallDirDlg"
                Control="Back"
                Event="NewDialog"
                Value="WelcomeDlg"
                Order="2">1</Publish>
    </UI>
    <!-- OBERFLÄCHE END -->
  </Product>
</Wix>
