<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
	<Product Id="*" Name="SilentDragonLite vRELEASE_VERSION" Language="1033" Version="RELEASE_VERSION" Manufacturer="silentdragonlite-org" UpgradeCode="fb9bf166-b55f-46b5-a990-9189bdf64533">
		<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

		<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
		<MediaTemplate EmbedCab="yes"/>

        <Icon Id="SilentDragonLite.exe" SourceFile="res/icon.ico"/>
        <Property Id="ARPPRODUCTICON" Value="SilentDragonLite.exe" />

		<Feature Id="ProductFeature" Title="silentdragonlite" Level="1">
			<ComponentGroupRef Id="ProductComponents" /> 
            <ComponentRef Id="ProgramMenuDir"/>
		</Feature>

        <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
        
        <WixVariable Id="WixUIBannerBmp" Value="res/wxsbanner.bmp" />
        <WixVariable Id="WixUIDialogBmp" Value="res/wxsdialog.bmp" />

        <UI>
            <UIRef Id="WixUI_InstallDir" />
            <Publish Dialog="WelcomeDlg"
                  Control="Next"
                  Event="NewDialog"
                  Value="InstallDirDlg"
                  Order="2">1</Publish>
            <Publish Dialog="InstallDirDlg"
                  Control="Back"
                  Event="NewDialog"
                  Value="WelcomeDlg"
                  Order="2">1</Publish>
        </UI>        
	</Product>

	<Fragment>
		<Directory Id="TARGETDIR" Name="SourceDir">
			<Directory Id="ProgramFilesFolder">
				<Directory Id="INSTALLFOLDER" Name="silentdragonlite" />
			</Directory>
            <Directory Id="ProgramMenuFolder" Name="Programs">
                <Directory Id="ApplicationProgramsFolder" Name="silentdragonlite">
                    <Component Id="ProgramMenuDir" Guid="0D560F5A-53E0-4E7E-ADDA-15A26995505E">
                        <RemoveFolder Id="ProgramMenuDir" On="uninstall"/>
                        <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\silentdragonlite\WixSetup"
                                       Type="integer" Value="1" Name="installed" KeyPath="yes" />
                    </Component>
                </Directory>
            </Directory>
		</Directory>
	</Fragment>

    
	<Fragment>
		<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
			<Component Id="ProductComponent" Guid="0D210F5A-53E0-4E7E-CAAD-15A26995505E">
                <File Source="SilentDragonLite.exe" KeyPath="yes">
                    <Shortcut Id="startMenuShotcut" Advertise="yes" Directory="ApplicationProgramsFolder"
                        Name="SilentDragonLite" WorkingDirectory="INSTALLFOLDER" Icon="SilentDragonLite.exe" >
                    </Shortcut>
                </File>
                <File Source="LICENSE" />

                <RegistryKey Root="HKCR" Key="hush">
                    <RegistryValue Type="string" Name="URL Protocol" Value=""/>
                    <RegistryValue Type="string" Value="URL:hush URI protocol"/>
                    <RegistryKey Key="DefaultIcon">
                    <RegistryValue Type="string" Value="SilentDragonLite.exe" />
                    </RegistryKey>
                    <RegistryKey Key="shell\open\command">
                    <RegistryValue Type="string" Value="&quot;[INSTALLFOLDER]SilentDragonLite.exe&quot; &quot;%1&quot;" />
                    </RegistryKey>
                </RegistryKey>
			</Component>
		</ComponentGroup>
	</Fragment>
</Wix>
