<commit_before><?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

 <!-- Variables -->
<?define ProductName="Aspia Host"?>
<?define Manufacturer="<NAME>"?>
<?define Version="2.2.0"?>
<?define InstallLocation="Aspia Host"?>
<?define SourceFiles="..\..\build\Release"?>
<?define ServiceName="aspia-host-service"?>
<?define ServiceDisplayName="Aspia Host Service"?>
<?define ServiceDescription="Accepts incoming remote desktop connections to this computer."?>

<!-- Product description -->
<Product Id="*" Name="!(loc.ProductName)" Language="1033" Version="$(var.Version)" Manufacturer="$(var.Manufacturer)" UpgradeCode="{B460F717-1546-4FFC-9EDE-B21FD07E07CB}">
    <Package Id="*" InstallerVersion="405" Compressed="yes" Manufacturer="$(var.Manufacturer)" InstallPrivileges="elevated" InstallScope="perMachine" />

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

    <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" Schedule="afterInstallInitialize" AllowDowngrades="no" AllowSameVersionUpgrades="no" Disallow="no" />

    <!-- Windows version checking -->
    <Condition Message="This application is only supported on Windows 7, Windows Server 2008 R2, or higher.">
        <![CDATA[Installed OR (VersionNT >= 601)]]>
    </Condition>

    <Icon Id="aspia.ico" SourceFile="resources/aspia.ico" />
    <Property Id="ARPPRODUCTICON" Value="aspia.ico" />

    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="VendorProgramFilesFolder" Name="Aspia">
                <Directory Id="INSTALLLOCATION" Name="Host" />
            </Directory>
        </Directory>
        <Directory Id="ProgramMenuFolder">
            <Directory Id="ApplicationMenuFolder" Name="Aspia" />
        </Directory>
        <Directory Id="DesktopFolder" />
    </Directory>

    <!-- Program Menu Shortcut -->
    <DirectoryRef Id="ApplicationMenuFolder">
        <Component Id="ProgramMenuShortcut" Guid="{C0DBE098-F1FD-49F6-8BD9-D18BDF9C80DA}">
            <Condition>STARTMENU_SHORTCUT</Condition>
            <Shortcut Id="ConfigProgramMenuShortcut" Name="!(loc.ProductName)" WorkingDirectory="INSTALLLOCATION" Target="[INSTALLLOCATION]aspia_host.exe"/>
            <RemoveFolder Id="ApplicationMenuFolder" On="uninstall" />
            <RegistryValue Root="HKCU" Key="SOFTWARE\$(var.ProductName)" Type="string" Value="" KeyPath="yes" />
        </Component>
    </DirectoryRef>

    <!-- Desktop Shortcut -->
    <DirectoryRef Id="DesktopFolder">
        <Component Id="DesktopShortcut" Guid="{6463EBB6-56AC-4FA7-9262-37BBC43435D5}">
            <Condition>DESKTOP_SHORTCUT</Condition>
            <Shortcut Id="ConfigDesktopShortcut" Name="!(loc.ProductName)" WorkingDirectory="INSTALLLOCATION" Target="[INSTALLLOCATION]aspia_host.exe"/>
            <RegistryValue Root="HKCU" Key="SOFTWARE\$(var.ProductName)" Type="string" Value="" KeyPath="yes" />
        </Component>
    </DirectoryRef>

    <!-- Host applications and service -->
    <DirectoryRef Id="INSTALLLOCATION" FileSource="$(var.SourceFiles)">
        <Component Id ="Applications" DiskId="1" Guid="{A0E3C629-4A61-4ED0-BD9D-FE12C71D7E36}">
            <File Id="aspia_desktop_agent.exe" Name="aspia_desktop_agent.exe" />
            <File Id="aspia_host_service.exe" Name="aspia_host_service.exe" KeyPath="yes" />
            <File Id="aspia_host.exe" Name="aspia_host.exe" />
            <File Id="aspia_host_core.dll" Name="aspia_host_core.dll" />
            <ServiceInstall Id="ServiceInstaller" Type="ownProcess" Vital="yes" Name="$(var.ServiceName)" DisplayName="$(var.ServiceDisplayName)" Description="$(var.ServiceDescription)" Start="auto" Account="LocalSystem" ErrorControl="ignore" Interactive="no">
                <ServiceDependency Id="RpcSs"/>
                <ServiceDependency Id="Tcpip"/>
                <ServiceDependency Id="NDIS"/>
                <ServiceDependency Id="AFD"/>
                <util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" RestartServiceDelayInSeconds="60"/>
            </ServiceInstall>
            <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="$(var.ServiceName)" Wait="yes" />
        </Component>
    </DirectoryRef>

    <!-- Product features -->
    <Feature Id="FeatureProduct" Title="$(var.ProductName)" InstallDefault="local" ConfigurableDirectory="INSTALLLOCATION" Level="1">
        <ComponentRef Id="Applications" />
        <ComponentRef Id="ProgramMenuShortcut" />
        <ComponentRef Id="DesktopShortcut" />
    </Feature>
    <Property Id="INSTALLLEVEL" Value="1" />

    <!-- Resource customization -->
    <WixVariable Id="WixUIBannerBmp" Value="resources/banner.bmp" />
    <WixVariable Id="WixUIDialogBmp" Value="resources/dialog.bmp" />
    <WixVariable Id="WixUIExclamationIco" Value="resources/exclamation.ico" />
    <WixVariable Id="WixUIInfoIco" Value="resources/info.ico" />
    <WixVariable Id="WixUINewIco" Value="resources/new.ico" />
    <WixVariable Id="WixUIUpIco" Value="resources/up.ico" />
    <WixVariable Id="WixUILicenseRtf" Value="resources/license.rtf" />

    <CustomAction Id="ImportSettings" Execute="deferred" Impersonate="no" Return="asyncWait" FileKey="aspia_host.exe" ExeCommand="--import=[SourceDir]aspia-host-config.json --silent" />
    <InstallExecuteSequence>
        <Custom Action="ImportSettings" After="InstallFiles">1</Custom>
    </InstallExecuteSequence>

    <!-- UI description -->
    <UI Id="InstallerUI">
        <Dialog Id="ShortcutsDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
            <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
            <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="2" />
            <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="2" />
            <Control Id="Title" Type="Text" X="15" Y="6" Width="210" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" />
            <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgDescription)" />

            <Control Id="DesktopShortcutCheckBox" Type="CheckBox" Height="18" Width="295" X="26" Y="58" Text="!(loc.CreateDesktopShortcut)" Property="DESKTOP_SHORTCUT" CheckBoxValue="1" />
            <Control Id="ProgramMenuShortcutCheckBox" Type="CheckBox" Height="18" Width="295" X="26" Y="79" Text="!(loc.CreateProgramMenuShortcut)" Property="STARTMENU_SHORTCUT" CheckBoxValue="1" />

            <Control Id="Next" Type="PushButton" X="248" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
                <Publish Event="NewDialog" Value="VerifyReadyDlg" Order="10" />
            </Control><commit_msg>Fixed import of configuration if path contains spaces.<commit_after><?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

 <!-- Variables -->
<?define ProductName="Aspia Host"?>
<?define Manufacturer="<NAME>"?>
<?define Version="2.2.0"?>
<?define InstallLocation="Aspia Host"?>
<?define SourceFiles="..\..\build\Release"?>
<?define ServiceName="aspia-host-service"?>
<?define ServiceDisplayName="Aspia Host Service"?>
<?define ServiceDescription="Accepts incoming remote desktop connections to this computer."?>

<!-- Product description -->
<Product Id="*" Name="!(loc.ProductName)" Language="1033" Version="$(var.Version)" Manufacturer="$(var.Manufacturer)" UpgradeCode="{B460F717-1546-4FFC-9EDE-B21FD07E07CB}">
    <Package Id="*" InstallerVersion="405" Compressed="yes" Manufacturer="$(var.Manufacturer)" InstallPrivileges="elevated" InstallScope="perMachine" />

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

    <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" Schedule="afterInstallInitialize" AllowDowngrades="no" AllowSameVersionUpgrades="no" Disallow="no" />

    <!-- Windows version checking -->
    <Condition Message="This application is only supported on Windows 7, Windows Server 2008 R2, or higher.">
        <![CDATA[Installed OR (VersionNT >= 601)]]>
    </Condition>

    <Icon Id="aspia.ico" SourceFile="resources/aspia.ico" />
    <Property Id="ARPPRODUCTICON" Value="aspia.ico" />

    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="VendorProgramFilesFolder" Name="Aspia">
                <Directory Id="INSTALLLOCATION" Name="Host" />
            </Directory>
        </Directory>
        <Directory Id="ProgramMenuFolder">
            <Directory Id="ApplicationMenuFolder" Name="Aspia" />
        </Directory>
        <Directory Id="DesktopFolder" />
    </Directory>

    <!-- Program Menu Shortcut -->
    <DirectoryRef Id="ApplicationMenuFolder">
        <Component Id="ProgramMenuShortcut" Guid="{C0DBE098-F1FD-49F6-8BD9-D18BDF9C80DA}">
            <Condition>STARTMENU_SHORTCUT</Condition>
            <Shortcut Id="ConfigProgramMenuShortcut" Name="!(loc.ProductName)" WorkingDirectory="INSTALLLOCATION" Target="[INSTALLLOCATION]aspia_host.exe"/>
            <RemoveFolder Id="ApplicationMenuFolder" On="uninstall" />
            <RegistryValue Root="HKCU" Key="SOFTWARE\$(var.ProductName)" Type="string" Value="" KeyPath="yes" />
        </Component>
    </DirectoryRef>

    <!-- Desktop Shortcut -->
    <DirectoryRef Id="DesktopFolder">
        <Component Id="DesktopShortcut" Guid="{6463EBB6-56AC-4FA7-9262-37BBC43435D5}">
            <Condition>DESKTOP_SHORTCUT</Condition>
            <Shortcut Id="ConfigDesktopShortcut" Name="!(loc.ProductName)" WorkingDirectory="INSTALLLOCATION" Target="[INSTALLLOCATION]aspia_host.exe"/>
            <RegistryValue Root="HKCU" Key="SOFTWARE\$(var.ProductName)" Type="string" Value="" KeyPath="yes" />
        </Component>
    </DirectoryRef>

    <!-- Host applications and service -->
    <DirectoryRef Id="INSTALLLOCATION" FileSource="$(var.SourceFiles)">
        <Component Id ="Applications" DiskId="1" Guid="{A0E3C629-4A61-4ED0-BD9D-FE12C71D7E36}">
            <File Id="aspia_desktop_agent.exe" Name="aspia_desktop_agent.exe" />
            <File Id="aspia_host_service.exe" Name="aspia_host_service.exe" KeyPath="yes" />
            <File Id="aspia_host.exe" Name="aspia_host.exe" />
            <File Id="aspia_host_core.dll" Name="aspia_host_core.dll" />
            <ServiceInstall Id="ServiceInstaller" Type="ownProcess" Vital="yes" Name="$(var.ServiceName)" DisplayName="$(var.ServiceDisplayName)" Description="$(var.ServiceDescription)" Start="auto" Account="LocalSystem" ErrorControl="ignore" Interactive="no">
                <ServiceDependency Id="RpcSs"/>
                <ServiceDependency Id="Tcpip"/>
                <ServiceDependency Id="NDIS"/>
                <ServiceDependency Id="AFD"/>
                <util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" RestartServiceDelayInSeconds="60"/>
            </ServiceInstall>
            <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="$(var.ServiceName)" Wait="yes" />
        </Component>
    </DirectoryRef>

    <!-- Product features -->
    <Feature Id="FeatureProduct" Title="$(var.ProductName)" InstallDefault="local" ConfigurableDirectory="INSTALLLOCATION" Level="1">
        <ComponentRef Id="Applications" />
        <ComponentRef Id="ProgramMenuShortcut" />
        <ComponentRef Id="DesktopShortcut" />
    </Feature>
    <Property Id="INSTALLLEVEL" Value="1" />

    <!-- Resource customization -->
    <WixVariable Id="WixUIBannerBmp" Value="resources/banner.bmp" />
    <WixVariable Id="WixUIDialogBmp" Value="resources/dialog.bmp" />
    <WixVariable Id="WixUIExclamationIco" Value="resources/exclamation.ico" />
    <WixVariable Id="WixUIInfoIco" Value="resources/info.ico" />
    <WixVariable Id="WixUINewIco" Value="resources/new.ico" />
    <WixVariable Id="WixUIUpIco" Value="resources/up.ico" />
    <WixVariable Id="WixUILicenseRtf" Value="resources/license.rtf" />

    <CustomAction Id="ImportSettings" Execute="deferred" Impersonate="no" Return="asyncWait" FileKey="aspia_host.exe" ExeCommand="--import=&quot;[SourceDir]aspia-host-config.json&quot; --silent" />
    <InstallExecuteSequence>
        <Custom Action="ImportSettings" After="InstallFiles">1</Custom>
    </InstallExecuteSequence>

    <!-- UI description -->
    <UI Id="InstallerUI">
        <Dialog Id="ShortcutsDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
            <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
            <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="2" />
            <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="2" />
            <Control Id="Title" Type="Text" X="15" Y="6" Width="210" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" />
            <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgDescription)" />

            <Control Id="DesktopShortcutCheckBox" Type="CheckBox" Height="18" Width="295" X="26" Y="58" Text="!(loc.CreateDesktopShortcut)" Property="DESKTOP_SHORTCUT" CheckBoxValue="1" />
            <Control Id="ProgramMenuShortcutCheckBox" Type="CheckBox" Height="18" Width="295" X="26" Y="79" Text="!(loc.CreateProgramMenuShortcut)" Property="STARTMENU_SHORTCUT" CheckBoxValue="1" />

            <Control Id="Next" Type="PushButton" X="248" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
                <Publish Event="NewDialog" Value="VerifyReadyDlg" Order="10" />
            </Control>
{'fraction_non_alphanumeric': 0.16830980920632668, 'fraction_numerical': 0.02595928789275835, 'mean_word_length': 4.271028037383178, 'pattern_counts': {'":': 0, '<': 209, '<?xml version=': 2, '>': 211, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2084457', 'n_tokens_mistral': 4572, 'n_tokens_neox': 4204, 'n_words': 718}