<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
  
  <!-- Paket-Definition (ersetzt Product in v4) -->
  <Package 
    Name="DocuMentor" 
    Version="1.2.7"
    Manufacturer="Vitali Graf / Software- und Datenbankentwicklung" 
    UpgradeCode="F498B66C-726D-44AA-95F4-CB4FBDCEF26E"
    Language="1031"
    Compressed="yes"
    InstallerVersion="500">
    
    <MajorUpgrade 
      DowngradeErrorMessage="Eine neuere Version ist bereits installiert." 
      AllowSameVersionUpgrades="yes" />
    
    <!-- Media Template -->
    <MediaTemplate EmbedCab="yes" />
    
    <!-- Feature-Definition -->
    <Feature Id="ProductFeature" Title="DocuMentor" Level="1">
      <ComponentGroupRef Id="ProductComponents" />
      <ComponentRef Id="ApplicationShortcut" />
      <ComponentRef Id="DesktopShortcut" />
    </Feature>
    
    <!-- Minimal UI (Standard Windows Installer Dialog) -->
    
    <!-- Icon -->
    <Icon Id="icon.ico" SourceFile="resources\icon.ico"/>
    <Property Id="ARPPRODUCTICON" Value="icon.ico" />
    <Property Id="ARPHELPLINK" Value="https://github.com/IhrRepo/DocuMentor" />
  </Package>

  <!-- Fragment: Verzeichnisstruktur -->
  <Fragment>
    <StandardDirectory Id="ProgramFilesFolder">
      <Directory Id="INSTALLFOLDER" Name="DocuMentor" />
    </StandardDirectory>
    
    <StandardDirectory Id="ProgramMenuFolder">
      <Directory Id="ApplicationProgramsFolder" Name="DocuMentor"/>
    </StandardDirectory>
    
    <StandardDirectory Id="DesktopFolder" />
  </Fragment>

  <!-- Fragment: Shortcuts -->
  <Fragment>
    <Component Id="ApplicationShortcut" Directory="ApplicationProgramsFolder" Guid="A498B66C-726D-44AA-95F4-CB4FBDCEF26E">
      <Shortcut 
        Id="ApplicationStartMenuShortcut" 
        Name="DocuMentor" 
        Description="XSL-Transformations-Verwaltung" 
        Target="[INSTALLFOLDER]DocuMentor.exe" 
        WorkingDirectory="INSTALLFOLDER" 
        Icon="icon.ico" />
      <RemoveFolder Id="CleanUpShortCut" On="uninstall"/>
      <RegistryValue 
        Root="HKCU" 
        Key="Software\DocuMentor" 
        Name="installed" 
        Type="integer" 
        Value="1" 
        KeyPath="yes"/>
    </Component>

    <Component Id="DesktopShortcut" Directory="DesktopFolder" Guid="B498B66C-726D-44AA-95F4-CB4FBDCEF26E">
      <Shortcut 
        Id="DesktopShortcutId" 
        Name="DocuMentor" 
        Target="[INSTALLFOLDER]DocuMentor.exe" 
        WorkingDirectory="INSTALLFOLDER" 
        Icon="icon.ico" />
      <RegistryValue 
        Root="HKCU" 
        Key="Software\DocuMentor" 
        Name="desktopShortcut" 
        Type="integer" 
        Value="1" 
        KeyPath="yes"/>
    </Component>
  </Fragment>
  
</Wix>
