﻿<?define ProductVersion = "1.10.6"?>
<?define ExeSourceFile = "Viscosity Installer.exe"?>
<?define UpgradeCode = "UPGRADECODE"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
    <Package Name="Viscosity"
        Version="$(var.ProductVersion)"
		UpgradeCode="$(var.UpgradeCode)"
        Manufacturer="SparkLabs Pty Ltd"
        Language="1033"
        InstallerVersion="200">
			
        <SummaryInformation Description="Viscosity $(var.ProductVersion)" />
        <Media Id="1" Cabinet="setup.cab" EmbedCab="yes" />
                
        <Property Id="ARPSYSTEMCOMPONENT" Value="1" />
        <Feature Id="InstallFeature" Title="Install Feature" Level="1">
            <ComponentRef Id="MyComponent" />
        </Feature>

        <!-- Run Action -->
        <CustomAction Id="RunWrapExe" Return="ignore" Execute="deferred" ExeCommand="$(var.ExeSourceFile) /SP- /verysilent /NORUN" HideTarget="no" Impersonate="no" FileRef="File0" />
        <InstallExecuteSequence>
            <Custom Action="RunWrapExe" After="InstallFiles" Condition="NOT REMOVE~=&quot;ALL&quot;" />
            <RemoveExistingProducts After="InstallFinalize" />
        </InstallExecuteSequence>
        
        <StandardDirectory Id="TempFolder">
            <Directory Id="INSTALLLOCATION" Name="~_tmpdir">
                <Component Id="MyComponent" DiskId="1" Guid="5012E016-B7CA-41FE-BCB3-86FD55E3708C">
                    <File Id="File0" Name="$(var.ExeSourceFile)" Source="$(var.ExeSourceFile)" />
                </Component>
            </Directory>
        </StandardDirectory>
    </Package>
</Wix>
