<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Include>
<%marker(top)%>
<%if(wix_extended)%>
<%foreach(platforms)%>
<%foreach(configurations)%>
<%if(!exclude)%>
<%comment("Only put one component in a fragment. If, say, both the debug and release components are in the")%>
<%comment("same fragment, and just the debug component is used in an installer, the release component will")%>
<%comment("be identified as unused, and an error generated.  That is, it seems that referencing any component")%>
<%comment("in a fragment causes the entire fragment to be pulled in, and any unused component in the fragment will be flagged as an error")%>
  <Fragment Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%project_name%>">
    <ComponentGroup Id="ComponentGroup.<%normalize(configuration)%>_<%normalize(platform)%>_<%project_name%>">
<%if(!no_binary)%>
      <ComponentRef Id="<%normalize(configuration)%>_<%normalize(platform)%><%foreach(name, install_location)%>_<%name%><%endfor%>.<%if(type_is_dynamic)%><%normalize(libname_prefix)%><%normalize(sharedname)%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%normalize(exename)%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>" />
<%endif%>
<%if(gme_install || gme_decorator)%>
      <ComponentRef Id="gme.component.<%gme_progid%>" />
<%endif%>
<%if(gme_paradigm)%>
      <ComponentRef Id="gme.paradigm.<%paradigm_name%>" />
<%endif%>
<%if(install_resources)%>
<%foreach(resource_files)%>
      <ComponentRef Id="<%project_name%><%foreach(name, install_location)%>.<%name%><%endfor%>.<%normalize(resource_file)%>" />
<%endfor%>
<%endif%>
<%foreach(components)%>
      <ComponentRef Id="<%component%>" />
<%endfor%>
    </ComponentGroup>

    <DirectoryRef Id="INSTALLDIR">
<%marker(component_top)%>
<%if(!no_binary)%>
<%foreach(name, install_location)%>
      <Directory Id="<%project_name%>.binary.<%forcount%>.<%name%>" Name="<%name%>">
<%endfor%>
        <Component Id="<%normalize(configuration)%>_<%normalize(platform)%>.<%if(type_is_dynamic)%><%normalize(libname_prefix)%><%normalize(sharedname)%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%normalize(exename)%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>" Guid="*">
          <File Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%if(type_is_dynamic)%><%normalize(libname_prefix)%><%normalize(sharedname)%>_dll<%else%><%normalize(exename)%>_exe<%endif%>"
                Name="<%if(type_is_dynamic)%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>"
                Source="<%if(type_is_dynamic)%><%if(dllout)%><%full_path(dllout)%>/<%else%><%full_path(libout)%>/<%endif%><%else%><%if(type_is_static)%><%full_path(libout)%>/<%else%><%if(exeout)%><%full_path(exeout)%>/<%if(windows_style)%><%output_dir("Debug")%>/<%endif%><%else%><%if(windows_style)%><%output_dir("Debug")%>/<%else%><%output_dir(".")%>/<%endif%><%endif%><%endif%><%endif%><%if(type_is_dynamic)%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>"
                DiskId="<%diskid(1)%>"
<%if(com_register)%>
                SelfRegCost="1"
<%endif%>
           />
        </Component>
<%foreach(name, install_location)%>
      </Directory>
<%endfor%>
<%endif%>

<%if(gme_install || gme_decorator)%>
      <Component Id="gme.component.<%gme_progid%>" Guid="<%gme_uuid%>">
<%if(gme_install)%>
        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\GME\Components\<%gme_progid%>" Action="createAndRemoveOnUninstall">
          <RegistryValue Name="Description" Type="string" Value="<%gme_description%>" Action="write" />
<%if(gme_has_icon)%>
          <RegistryValue Name="Icon" Type="string" Value="<%gme_icon(,IDI_COMPICON)%>" Action="write" />
<%endif%>
          <RegistryValue Name="Paradigm" Type="string" Value="<%foreach(gme_paradigms)%><%gme_paradigm%><%fornotlast(",")%><%endfor%>" Action="write" />
          <RegistryValue Name="Tooltip" Type="string" Value="<%gme_tooltip%>" Action="write" />
          <RegistryValue Name="Type" Type="integer" Value="<%gme_component_type(1)%>" Action="write" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\GME\Components\<%gme_progid%>\Associated" Action="create">
<%foreach(gme_paradigms)%>
          <RegistryValue Name="<%gme_paradigm%>" Type="string" Action="write" Value="" />
<%endfor%>
        </RegistryKey>
<%endif%>
        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\Classes\<%gme_progid%>" Action="createAndRemoveOnUninstall">
          <RegistryValue Type="string" Value="<%gme_description%>" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\Classes\<%gme_progid%>\CLSID" Action="create">
          <RegistryValue Type="string" Value="{<%gme_uuid%>}" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\Classes\CLSID\{<%gme_uuid%>}" Action="createAndRemoveOnUninstall">
          <RegistryValue Type="string" Value="<%if(gme_description)%><%gme_description%><%else%><%gme_progid%><%endif%>" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\Classes\CLSID\{<%gme_uuid%>}\InProcServer32" Action="create">
          <RegistryValue Type="string" Value="[INSTALLDIR]<%foreach(name, install_location)%><%name%>\<%endfor%><%sharedname%>.dll" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\Classes\CLSID\{<%gme_uuid%>}\ProgID" Action="create">
          <RegistryValue Type="string" Value="<%gme_progid%>" />
        </RegistryKey>
      </Component>
<%endif%>
<%if(gme_paradigm)%>
<%foreach(name, install_location)%>
      <Directory Id="<%project_name%>.<%paradigm_name%>.<%forcount%>.<%name%>" Name="<%name%>">
<%endfor%>
      <Component Id="gme.paradigm.<%paradigm_name%>" Guid="<%paradigm_guid%>">
        <File Name="<%paradigm_file%>"
              Source="<%full_path(paradigm_file)%>"
              DiskId="<%diskid(1)%>" />

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\GME\Paradigms\<%paradigm_name%>" Action="createAndRemoveOnUninstall">
          <RegistryValue Name="CurrentVersion" Type="string" Value="{<%paradigm_guid%>}" Action="write" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\GME\Paradigms\<%paradigm_name%>\{<%paradigm_guid%>}" Action="createAndRemoveOnUninstall">
          <RegistryValue Name="ConnStr" Type="string" Value="MGA=[INSTALLDIR]<%foreach(name, install_location)%><%name%>\<%endfor%><%paradigm_file%>" />
        </RegistryKey>
     </Component>
<%foreach(name, install_location)%>
      </Directory>
<%endfor%>
<%endif%>
<%marker(component_bottom)%>
    </DirectoryRef>
   </Fragment>
<%endif%>
<%endfor%>
<%endfor%>
<%else%>
  <Fragment Id="<%project_name%>">
    <ComponentGroup Id="ComponentGroup.<%project_name%>">
<%if(!custom_only)%>
<%if(!no_binary)%>
      <ComponentRef Id="<%project_name%><%foreach(name, install_location)%>.<%name%><%endfor%>.<%if(type_is_dynamic)%><%normalize(sharedname)%>.dll<%else%><%normalize(exename)%>.exe<%endif%>" />
<%endif%>
<%if(gme_install || gme_decorator)%>
      <ComponentRef Id="gme.component.<%gme_progid%>" />
<%endif%>
<%if(gme_paradigm)%>
      <ComponentRef Id="gme.paradigm.<%paradigm_name%>" />
<%endif%>
<%if(install_resources)%>
<%foreach(resource_files)%>
      <ComponentRef Id="<%project_name%><%foreach(name, install_location)%>.<%name%><%endfor%>.<%normalize(resource_file)%>" />
<%endfor%>
<%endif%>
<%foreach(components)%>
      <ComponentRef Id="<%component%>" />
<%endfor%>
<%endif%>
    </ComponentGroup>

<%if(!custom_only)%>
    <DirectoryRef Id="INSTALLDIR">
<%marker(component_top)%>
<%if(!no_binary)%>
<%foreach(name, install_location)%>
      <Directory Id="<%project_name%>.binary.<%forcount%>.<%name%>" Name="<%name%>">
<%endfor%>
        <Component Id="<%project_name%><%foreach(name, install_location)%>.<%name%><%endfor%>.<%if(type_is_dynamic)%><%normalize(sharedname)%>.dll<%else%><%normalize(exename)%>.exe<%endif%>" Guid="*">
          <File Id="<%project_name%>_<%if(type_is_dynamic)%><%normalize(sharedname)%>_dll<%else%><%normalize(exename)%>_exe<%endif%>"
                Name="<%if(type_is_dynamic)%><%sharedname%>.dll<%else%><%exename%>.exe<%endif%>"
                Source="<%source_directory%>/<%if(type_is_dynamic)%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%>.dll<%else%><%exename%>.exe<%endif%>"
                DiskId="<%diskid(1)%>" />
        </Component>
<%foreach(name, install_location)%>
      </Directory>
<%endfor%>
<%endif%>
<%if(install_resources)%>
<%foreach(resource_files)%>
<%foreach(name, install_location)%>
      <Directory Id="<%project_name%>.<%normalize(resource_file)%>.<%forcount%>.<%name%>" Name="<%name%>">
<%endfor%>
        <Component Id="<%project_name%><%foreach(name, install_location)%>.<%name%><%endfor%>.<%normalize(resource_file)%>" Guid="*">
          <File Id="<%project_name%>_<%normalize(resource_file)%>"
                Name="<%basename(resource_file)%>"
                Source="<%full_path(resource_file)%>"
                DiskId="<%diskid(1)%>" />
        </Component>
<%foreach(name, install_location)%>
      </Directory>
<%endfor%>
<%endfor%>
<%endif%>
<%if(gme_install || gme_decorator)%>
      <Component Id="gme.component.<%gme_progid%>" Guid="<%gme_uuid%>">
<%if(gme_install)%>
        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\GME\Components\<%gme_progid%>" Action="createAndRemoveOnUninstall">
          <RegistryValue Name="Description" Type="string" Value="<%gme_description%>" Action="write" />
<%if(gme_has_icon)%>
          <RegistryValue Name="Icon" Type="string" Value="<%gme_icon(,IDI_COMPICON)%>" Action="write" />
<%endif%>
          <RegistryValue Name="Paradigm" Type="string" Value="<%foreach(gme_paradigms)%><%gme_paradigm%><%fornotlast(",")%><%endfor%>" Action="write" />
          <RegistryValue Name="Tooltip" Type="string" Value="<%gme_tooltip%>" Action="write" />
          <RegistryValue Name="Type" Type="integer" Value="<%gme_component_type(1)%>" Action="write" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\GME\Components\<%gme_progid%>\Associated" Action="create">
<%foreach(gme_paradigms)%>
          <RegistryValue Name="<%gme_paradigm%>" Type="string" Action="write" Value="" />
<%endfor%>
        </RegistryKey>
<%endif%>
        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\Classes\<%gme_progid%>" Action="createAndRemoveOnUninstall">
          <RegistryValue Type="string" Value="<%gme_description%>" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\Classes\<%gme_progid%>\CLSID" Action="create">
          <RegistryValue Type="string" Value="{<%gme_uuid%>}" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\Classes\CLSID\{<%gme_uuid%>}" Action="createAndRemoveOnUninstall">
          <RegistryValue Type="string" Value="<%if(gme_description)%><%gme_description%><%else%><%gme_progid%><%endif%>" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\Classes\CLSID\{<%gme_uuid%>}\InProcServer32" Action="create">
          <RegistryValue Type="string" Value="[INSTALLDIR]<%foreach(name, install_location)%><%name%>\<%endfor%><%sharedname%>.dll" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\Classes\CLSID\{<%gme_uuid%>}\ProgID" Action="create">
          <RegistryValue Type="string" Value="<%gme_progid%>" />
        </RegistryKey>
      </Component>
<%endif%>
<%if(gme_paradigm)%>
<%foreach(name, install_location)%>
      <Directory Id="<%project_name%>.<%paradigm_name%>.<%forcount%>.<%name%>" Name="<%name%>">
<%endfor%>
      <Component Id="gme.paradigm.<%paradigm_name%>" Guid="<%paradigm_guid%>">
        <File Name="<%paradigm_file%>"
              Source="<%full_path(paradigm_file)%>"
              DiskId="<%diskid(1)%>" />

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\GME\Paradigms\<%paradigm_name%>" Action="createAndRemoveOnUninstall">
          <RegistryValue Name="CurrentVersion" Type="string" Value="{<%paradigm_guid%>}" Action="write" />
        </RegistryKey>

        <RegistryKey Root="<%gme_register(HKLM)%>" Key="SOFTWARE\GME\Paradigms\<%paradigm_name%>\{<%paradigm_guid%>}" Action="createAndRemoveOnUninstall">
          <RegistryValue Name="ConnStr" Type="string" Value="MGA=[INSTALLDIR]<%foreach(name, install_location)%><%name%>\<%endfor%><%paradigm_file%>" />
        </RegistryKey>
     </Component>
<%foreach(name, install_location)%>
      </Directory>
<%endfor%>
<%endif%>
<%marker(component_bottom)%>
    </DirectoryRef>
<%endif%>
  </Fragment>
<%endif%>
<%marker(bottom)%>
</Include>
