The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<!-- Merge module generated by [% dist.pdw_class %] using Perl::Dist::WiX [% dist.pdw_version %] -->
  <Module Id='Perl_MM'
    Language='1033'
    Version='[% dist.msi_perl_version %]' >

    [% IF dist.msi_debug %]
    <Package Description='Perl for Win32 operating systems.' Languages='1033'
      Comments='Debug Build.' 
      Platform='[% dist.msi_platform_string %]' InstallerVersion='200' InstallPrivileges='elevated'
      Id='[% dist.msm_package_id %]' Manufacturer='[% dist.app_publisher %]' />
    <Property Id='MsiLogging'>voIcewarmupx!</Property>
    [% ELSE %]
    <Package Description='Perl for Win32 operating systems.' Languages='1033'
      Platform='[% dist.msi_platform_string %]' InstallerVersion='200' InstallPrivileges='elevated'
      Id='[% dist.msm_package_id %]' Manufacturer='[% dist.app_publisher %]' />
    [% END %]

[% directory_tree %]

[% dist.feature_tree_object.as_string_msm %]

    <CustomAction Id='CA_ClearFolder' BinaryKey='B_ClearFolder' DllEntry='ClearFolderFast' />
    <InstallExecuteSequence>
      <Custom Action='CA_ClearFolder' Before='InstallInitialize'>REMOVE="ALL" AND NOT VersionNT64</Custom>
    </InstallExecuteSequence>

[% IF dist.msi_debug %]
  [% IF 64 == dist.bits %]
    <Binary Id='B_ClearFolder' SourceFile='[% dist.wix_dist_dir %]\debug_dll\x64\ClearFolderCA.dll' />
  [% ELSE %]
    <Binary Id='B_ClearFolder' SourceFile='[% dist.wix_dist_dir %]\debug_dll\ClearFolderCA.dll' />
  [% END %]
[% ELSE %]
  [% IF 64 == dist.bits %]
    <Binary Id='B_ClearFolder' SourceFile='[% dist.wix_dist_dir %]\x64\ClearFolderCA.dll' />
  [% ELSE %]
    <Binary Id='B_ClearFolder' SourceFile='[% dist.wix_dist_dir %]\ClearFolderCA.dll' />
  [% END %]
[% END %]
    <UI>
   	  <ProgressText Action="CA_ClearFolder">Scanning for added files to delete... (please wait a while)</ProgressText>
    </UI>

[% IF dist.relocatable %]
	[% IF dist.use_dll_relocation %]
	<CustomAction Id="CA_FileList_msm" Property="CA_Relocate_msm"
				  Value="MM;[INSTALLDIR];[% dist.assert.msm_relocation_idlist %]" Return="check" />
	<CustomAction Id="CA_Relocate_msm" BinaryKey="B_ClearFolder" 
				  DllEntry="RelocateMM" Execute="deferred" Return="check" />

	<InstallExecuteSequence>
		<Custom Action="CA_FileList_msm" After="InstallFiles" />
		<Custom Action="CA_Relocate_msm" After="CA_FileList_msm">
			<![CDATA[NOT (NO_RELOCATE OR Installed)]]>
		</Custom>
	</InstallExecuteSequence>
	[% ELSE %]
	<CustomAction Id="CA_Rlm_1" Property="P_Rlm_1"
				  Value="&quot;[% fileid_perl_h %]&quot;" Execute="immediate"/>
	<CustomAction Id="CA_Rlm_2" Property="P_Rlm_2"
				  Value="[% fileid_relocation_pl_h %]" Execute="immediate"/>
	<CustomAction Id="CA_Rlm_3" Property="P_Rlm_3"
				  Value="[P_Rlm_1] [P_Rlm_2]" Execute="immediate"/>
	<CustomAction Id="CA_Rlm_4" Property="P_Rlm_4"
				  Value="--location [INSTALLDIR] --quiet" Execute="immediate"/>
	<CustomAction Id="CA_Rlm_5" Property="P_Rlm_5"
				  Value="[P_Rlm_3] [P_Rlm_4]" Execute="immediate"/>
	<CustomAction Id="CA_Rlm_6" Property="P_Rlm_6"
				  Value="[% msm_relocation_commandline %]" Execute="immediate"/>
	<CustomAction Id="CA_Relocate_msm_Cmd" Property="CA_Relocate_msm"
				  Value="[P_Rlm_5][P_Rlm_6]" Execute="immediate"/>
	<CustomAction Id="CA_Relocate_msm" BinaryKey="WixCA" DllEntry="[% dist.msi_relocation_ca %]"
				  Execute="deferred" Return="check" Impersonate="no"/>
 	<InstallExecuteSequence>
		<Custom Action="CA_Rlm_1" After="CostFinalize"/>
		<Custom Action="CA_Rlm_2" After="CA_Rlm_1"/>
		<Custom Action="CA_Rlm_3" After="CA_Rlm_2"/>
		<Custom Action="CA_Rlm_4" After="CA_Rlm_3"/>
		<Custom Action="CA_Rlm_5" After="CA_Rlm_4"/>
		<Custom Action="CA_Rlm_6" After="CA_Rlm_5"/>
		<Custom Action="CA_Relocate_msm_Cmd" After="CA_Rlm_6"/>
 		<Custom Action="CA_Relocate_msm" After="PublishProduct">
 			<![CDATA[NOT (NO_RELOCATE OR Installed)]]>
 		</Custom>
 	</InstallExecuteSequence>
	[% END %]
	
    <UI>
   	  <ProgressText Action="CA_Relocate_msm">Relocating [% dist.app_name %]...</ProgressText>
    </UI>
[% END %]

  </Module>
</Wix>