<?xml version="1.0" encoding="UTF-8"?>

<!--,^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^.-->
<!--|                                                            |-->
<!--| Swirc.wxs                                                  |-->
<!--|                                                            |-->
<!--| Copyright (C) 2018-2025 Markus Uhlin. All rights reserved. |-->
<!--|                                                            |-->
<!--`____________________________________________________________'-->

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package
    InstallerVersion="400"
    Language="1033"
    Manufacturer="Swirc Development Team"
    Name="Swirc 3.5.9"
    Version="3.5.9.0"
    ProductCode="A3532170-8CC9-47BF-A0F6-5CB3F3341F12"
    UpgradeCode="4899E3ED-B314-4402-8E66-A2AB1B4632DE">
	<Icon Id="swirc_ico" SourceFile="swirc-royal.ico" />
	<Property Id="ARPPRODUCTICON" Value="swirc_ico" />

	<Media Cabinet="swirc.cab" EmbedCab="yes" Id="1" />
	<ui:WixUI Id="WixUI_Minimal" />
	<!-- WixVariable Id="WixUIBannerBmp" Value="SwircUIBanner1.bmp" /-->
	<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />

	<DirectoryRef Id="de_lc_msgs">
		<Component Id="de_lc_msgs_compo" Bitness="always64">
			<File
			    Id="de_lc_msgs_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\de\LC_MESSAGES\swirc.mo" />
		</Component>
	</DirectoryRef>
	<DirectoryRef Id="fi_lc_msgs">
		<Component Id="fi_lc_msgs_compo" Bitness="always64">
			<File
			    Id="fi_lc_msgs_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\fi\LC_MESSAGES\swirc.mo" />
		</Component>
	</DirectoryRef>
	<DirectoryRef Id="fr_lc_msgs">
		<Component Id="fr_lc_msgs_compo" Bitness="always64">
			<File
			    Id="fr_lc_msgs_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\fr\LC_MESSAGES\swirc.mo" />
		</Component>
	</DirectoryRef>
	<DirectoryRef Id="sv_lc_msgs">
		<Component Id="sv_lc_msgs_compo" Bitness="always64">
			<File
			    Id="sv_lc_msgs_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\sv\LC_MESSAGES\swirc.mo" />
		</Component>
	</DirectoryRef>

	<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
		<Component Id="en_US_aff" Bitness="always64">
			<File
			    Id="en_US_aff_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\en_US.aff" />
		</Component>
		<Component Id="en_US_dic" Bitness="always64">
			<File
			    Id="en_US_dic_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\en_US.dic" />
		</Component>

		<!-- BEGIN LibreSSL -->
		<Component Id="crypto_dll" Bitness="always64">
			<File
			    Id="crypto_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\crypto-57.dll" />
		</Component>
		<Component Id="ssl_dll" Bitness="always64">
			<File
			    Id="ssl_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\ssl-60.dll" />
		</Component>
		<!-- END LibreSSL -->

		<!-- BEGIN MINGW -->
		<Component Id="libgcc_dll" Bitness="always64">
			<File
			    Id="libgcc_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\libgcc_s_seh-1.dll" />
		</Component>
		<Component Id="libstdcpp_dll" Bitness="always64">
			<File
			    Id="libstdcpp_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\libstdc++-6.dll" />
		</Component>
		<Component Id="libwinpthread_dll" Bitness="always64">
			<File
			    Id="libwinpthread_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\libwinpthread-1.dll" />
		</Component>
		<!-- END MINGW -->

		<Component Id="libcharset_dll" Bitness="always64">
			<File
			    Id="libcharset_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\libcharset-1.dll" />
		</Component>
		<Component Id="libcurl_dll" Bitness="always64">
			<File
			    Id="libcurl_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\libcurl.dll" />
		</Component>
		<Component Id="libhunspell_dll" Bitness="always64">
			<File
			    Id="libhunspell_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\libhunspell-1.7-0.dll" />
		</Component>
		<Component Id="libiconv_dll" Bitness="always64">
			<File
			    Id="libiconv_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\libiconv-2.dll" />
		</Component>
		<Component Id="libidn_dll" Bitness="always64">
			<File
			    Id="libidn_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\libidn-12.dll" />
		</Component>
		<Component Id="libintl_dll" Bitness="always64">
			<File
			    Id="libintl_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\libintl-8.dll" />
		</Component>
		<Component Id="pdcurses_dll" Bitness="always64">
			<File
			    Id="pdcurses_dll_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\pdcurses.dll" />
		</Component>
		<Component Id="swirc_chm" Bitness="always64">
			<File
			    Id="swirc_chm_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\swirc.chm" />
		</Component>
		<Component Id="swirc_exe" Bitness="always64">
			<File
			    Checksum="yes"
			    DefaultLanguage="0"
			    Id="swirc_exe_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\swirc.exe" />
		</Component>
		<Component Id="trusted_roots_pem" Bitness="always64">
			<File
			    Id="trusted_roots_pem_file"
			    KeyPath="yes"
			    Source="c:\out\swirc-x64\trusted_roots.pem" />
		</Component>
	</DirectoryRef>

	<!-- ========================================= -->
	<!-- Add the shortcut to our installer package -->
	<!-- ========================================= -->

	<DirectoryRef Id="ApplicationProgramsFolder">
		<Component Guid="*" Id="swirc_exe_shortcut">
			<Shortcut
			    Description="Curses IRC client"
			    Id="swirc_exe_shortcut_element"
			    Name="Swirc"
			    Target="[#swirc_exe_file]"
			    WorkingDirectory="APPLICATIONROOTDIRECTORY">
				<!-- ===== -->
				<!-- AUMID -->
				<!-- ===== -->

				<ShortcutProperty
				    Key="System.AppUserModel.ID"
				    Value="SwircDevelopmentTeam.Swirc" />
				<!-- ========= -->
				<!-- COM CLSID -->
				<!-- ========= -->

				<ShortcutProperty
				    Key="System.AppUserModel.ToastActivatorCLSID"
				    Value="{62337340-CB78-4AE9-A524-685424C52DC7}" />
			</Shortcut>
			<Shortcut Id="UninstallProduct"
			    Name="Uninstall Swirc"
			    Description="Uninstalls Swirc IRC client"
			    Target="[System64Folder]msiexec.exe"
			    Arguments="/x [ProductCode]" />
			<RemoveFolder
			    Id="ApplicationProgramsFolder"
			    On="uninstall" />
			<RegistryValue
			    Key="Software\Microsoft\Swirc"
			    KeyPath="yes"
			    Name="installed"
			    Root="HKCU"
			    Type="integer"
			    Value="1" />
		</Component>

		<Component
		    Guid="C8A05C9E-A23E-453A-A620-0A62332C0158"
		    Id="swirc_chm_shortcut">
			<Shortcut
			    Description="Swirc Help"
			    Id="swirc_chm_shortcut_element"
			    Name="Swirc Help"
			    Target="[#swirc_chm_file]"
			    WorkingDirectory="APPLICATIONROOTDIRECTORY">
			</Shortcut>
		</Component>
	</DirectoryRef>

	<Feature Id="MainApplication" Title="Main Application" Level="1">
		<ComponentRef Id="de_lc_msgs_compo" />
		<ComponentRef Id="fi_lc_msgs_compo" />
		<ComponentRef Id="fr_lc_msgs_compo" />
		<ComponentRef Id="sv_lc_msgs_compo" />

		<ComponentRef Id="en_US_aff" />
		<ComponentRef Id="en_US_dic" />

		<ComponentRef Id="crypto_dll" />
		<ComponentRef Id="ssl_dll" />

		<ComponentRef Id="libgcc_dll" />
		<ComponentRef Id="libstdcpp_dll" />
		<ComponentRef Id="libwinpthread_dll" />

		<ComponentRef Id="libcharset_dll" />
		<ComponentRef Id="libcurl_dll" />
		<ComponentRef Id="libhunspell_dll" />
		<ComponentRef Id="libiconv_dll" />
		<ComponentRef Id="libidn_dll" />
		<ComponentRef Id="libintl_dll" />
		<ComponentRef Id="pdcurses_dll" />
		<ComponentRef Id="swirc_chm" />
		<ComponentRef Id="swirc_exe" />
		<ComponentRef Id="trusted_roots_pem" />

		<ComponentRef Id="swirc_exe_shortcut" />
		<ComponentRef Id="swirc_chm_shortcut" />
	</Feature>

	<CustomAction
	    Id="SetInstallLocation"
	    Property="ARPINSTALLLOCATION"
	    Value="[ProgramFiles64Folder]Swirc" />

	<CustomAction Id="SetNoModify" Property="ARPNOMODIFY" Value="1" />
	<CustomAction Id="SetNoRepair" Property="ARPNOREPAIR" Value="1" />

	<InstallExecuteSequence>
		<Custom Action="SetInstallLocation" After="CostFinalize">
		</Custom>

		<Custom Action="SetNoModify" After="InstallValidate">
		</Custom>
		<Custom Action="SetNoRepair" After="InstallValidate">
		</Custom>
	</InstallExecuteSequence>

	<InstallUISequence>
	</InstallUISequence>

	<StandardDirectory Id="ProgramFiles64Folder">
		<Directory Id="APPLICATIONROOTDIRECTORY" Name="Swirc">
			<Directory Id="de_lang" Name="de">
				<Directory Id="de_lc_msgs" Name="LC_MESSAGES" />
			</Directory>
			<Directory Id="fi_lang" Name="fi">
				<Directory Id="fi_lc_msgs" Name="LC_MESSAGES" />
			</Directory>
			<Directory Id="fr_lang" Name="fr">
				<Directory Id="fr_lc_msgs" Name="LC_MESSAGES" />
			</Directory>
			<Directory Id="sv_lang" Name="sv">
				<Directory Id="sv_lc_msgs" Name="LC_MESSAGES" />
			</Directory>
		</Directory>
	</StandardDirectory>

	<!-- ============================== -->
	<!-- Define the directory structure -->
	<!-- ============================== -->

	<StandardDirectory Id="ProgramMenuFolder">
		<Directory Id="ApplicationProgramsFolder" Name="Swirc" />
	</StandardDirectory>

	<!-- StandardDirectory Id="TARGETDIR">
		<Merge
		    DiskId="1"
		    Id="VCRedist"
		    Language="0"
		    SourceFile="C:\MergeModules\Microsoft_VC143_CRT_x64.msm" />
	</StandardDirectory -->

	<!-- Feature
	    AllowAdvertise="no"
	    Display="hidden"
	    Id="VCRedist"
	    Level="1"
	    Title="Visual C++ Runtime">
		<MergeRef Id="VCRedist" />
	</Feature -->
</Package>
</Wix>
