<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:netfx="http://wixtoolset.org/schemas/v4/wxs/netfx">
  <Package
    Name="First Aid Service Desk (F4SD) Icon Picker"
    Language="1033"
    Version="1.0.1.1"
    Manufacturer="Consulting4IT GmbH, Germany"
    UpgradeCode="9ed68c24-eb27-4d59-a075-c50e6d575831"
    >

    <Icon Id="Setup.ico" SourceFile="Img\IconPickerLogo.ico"/>
    <WixVariable Id="WixUIBannerBmp" Value="Img\Banner.bmp"/>
    <WixVariable Id="WixUIDialogBmp" Value="Img\Dialog.bmp"/>

    <MajorUpgrade
      DowngradeErrorMessage="A newer version of [ProductName] is already installed."
      Schedule="afterInstallInitialize"
      AllowSameVersionUpgrades="yes"/>

    <Media Id="1" Cabinet="Install.cab" EmbedCab="yes" DiskPrompt="Setup.msi" />

    <Property Id='DiskPrompt' Value="F4SD Icon Picker installation source" />

    <Property Id="INSTALLLEVEL" Value="100"/>
    <Property Id="ARPPRODUCTICON" Value="Setup.ico"/>

    <netfx:DotNetCompatibilityCheck Property="dotnet_installed" RuntimeType="desktop" Platform="x64" Version="4.7.2" RollForward="major"/>
    <Launch Message="This application requires .NET Framework 4.7.2. Please install the .NET Framework then run this installer again." Condition="dotnet_installed = 0"/>

    <Feature Id="ProductFeature" Title="F4SD Icon Picker" Level="1"  AllowAdvertise="no" Display="expand" ConfigurableDirectory="INSTALLFOLDER" InstallDefault="local">
      <ComponentRef Id="ProgramMenuDir"/>
      <ComponentRef Id="MainExecutable"/>
      <ComponentRef Id="F4SD_Common"/>
    </Feature>
  </Package>

  <Fragment>
      <StandardDirectory Id="ProgramFiles6432Folder">
        <Directory Id="C4IT" Name="Consulting4IT">
          <Directory Id="INSTALLFOLDER" Name="First Aid Service Desk"/>
        </Directory>
      </StandardDirectory>
    <StandardDirectory Id="ProgramMenuFolder">
        <Directory Id="ProgramMenuDir" Name="First Aid Service Desk">
          <Component Id="ProgramMenuDir" Guid="B791B054-8E8D-4107-9E28-4A1B46F68D29">
            <RemoveFolder Id='ProgramMenuDir' On="uninstall"/>
            <RegistryValue Root="HKMU" Key="Software\Consulting4IT GmbH\First Aid Service Desk\Cockpit" Type="string" Name="ProgramFolder" Value="1" KeyPath="yes" />
          </Component>
        </Directory>
      </StandardDirectory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents">
      <Component Id="MainExecutable" Guid="3C893A85-219D-4137-818B-B51D815F1604" Directory="INSTALLFOLDER">
        <File Id="F4SD_IconPicker.exe" Name="F4SD-IconPicker.exe" DiskId="1" Source="Source\F4SD-IconPicker.exe" KeyPath="yes">
          <Shortcut Id="MainShortcut" Directory="ProgramMenuDir" Name="F4SD Icon Picker" Icon="Icon.exe" Advertise="yes" IconIndex="0">
            <Icon Id="Icon.exe" SourceFile="Source\F4SD-IconPicker.exe"/>
          </Shortcut>
        </File>
        <File Id="F4SD_IconPicker.exe.config" Name="F4SD-IconPicker.exe.config" DiskId="1" Source="Source\F4SD-IconPicker.exe.config" KeyPath="no"/>
        <File Id="F4SD_AdaptableIcon.dll" Name="F4SD-AdaptableIcon.dll" DiskId="1" Source="Source\F4SD-AdaptableIcon.dll" KeyPath="no"/>
      </Component>
      <Component Id="F4SD_Common" Guid="313E5AFD-D487-4029-BBAE-17EA697D133C" Directory="INSTALLFOLDER">
        <File Id="F4SD_Logging.dll" Name="F4SD-Logging.dll" DiskId="1" Source="Source\F4SD-Logging.dll" KeyPath="no"/>
        <File Id="MaterialIcons.dll" Name="MaterialIcons.dll" DiskId="1" Source="Source\MaterialIcons.dll" KeyPath="no"/>
        <File Id="WpfAnimatedGif.dll" Name="WpfAnimatedGif.dll" DiskId="1" Source="Source\WpfAnimatedGif.dll" KeyPath="no"/>
      </Component>
    </ComponentGroup>
  </Fragment>

</Wix>
