<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
  <Package
    Name="XWorkmate"
    Manufacturer="plus.svc"
    Version="$(var.ProductVersion)"
    UpgradeCode="B5BDB376-78C8-4988-B1F2-D3F7B4E0A4D7"
    Language="1033">
    <MediaTemplate EmbedCab="yes" />
    <MajorUpgrade DowngradeErrorMessage="A newer version of XWorkmate is already installed." />
    <StandardDirectory Id="ProgramFiles64Folder">
      <Directory Id="INSTALLFOLDER" Name="XWorkmate" />
    </StandardDirectory>

    <Feature Id="MainFeature" Title="XWorkmate" Level="1">
      <ComponentGroupRef Id="ApplicationFiles" />
    </Feature>

    <Icon Id="AppIcon.ico" SourceFile="$(var.SourceDir)\resources\app_icon.ico" />
    <Property Id="ARPPRODUCTICON" Value="AppIcon.ico" />
  </Package>

  <Fragment>
    <StandardDirectory Id="ProgramMenuFolder">
      <Directory Id="ProgramMenuDir" Name="XWorkmate" />
    </StandardDirectory>
    <StandardDirectory Id="DesktopFolder" />
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ApplicationFiles" Directory="INSTALLFOLDER">
      <Files Include="$(var.SourceDir)\**" />
      <Component Id="AppShortcutComponent" Guid="D7AA0C43-123D-4749-A160-5169FA62CB44">
        <Shortcut
          Id="StartMenuShortcut"
          Directory="ProgramMenuDir"
          Name="XWorkmate"
          Target="[INSTALLFOLDER]xworkmate.exe"
          WorkingDirectory="INSTALLFOLDER" />
        <Shortcut
          Id="DesktopShortcut"
          Directory="DesktopFolder"
          Name="XWorkmate"
          Target="[INSTALLFOLDER]xworkmate.exe"
          WorkingDirectory="INSTALLFOLDER" />
        <RemoveFolder Id="RemoveProgramMenuDir" Directory="ProgramMenuDir" On="uninstall" />
        <RegistryValue Root="HKCU" Key="Software\plus.svc\XWorkmate" Name="installed" Type="integer" Value="1" KeyPath="yes" />
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>
