<?xml version="1.0" encoding="utf-8"?>
<Include>
  <?define ProductName = "Mumble" ?>
  <?define ProductManufacturer = "The Mumble Developers" ?>
  <?define ProductVersion = "1.3.0" ?>

  <?if $(sys.BUILDARCH) = "x86" ?>
    <?define ProductUpgradeCode = "B0EEFCC7-8A9c-4471-AB10-CBD35BE3161D" ?>
    <?define ArchSpecificProgramFilesFolderId = "ProgramFilesFolder" ?>
  <?elseif $(sys.BUILDARCH) = "x64" ?>
    <?define ProductUpgradeCode = "E028BDFC-3FE2-4BEE-A33B-EB9C80611555" ?>
    <?define ArchSpecificProgramFilesFolderId = "ProgramFiles64Folder" ?>
  <?else?>
    <?error Unsupported build architecture: $(sys.BUILDARCH) ?>
  <?endif?>

  <?define MumbleExeGuid = "A08F7909-1116-4AC8-9422-051FA1A1BE19" ?>
  <?define MumbleDesktopShortcutGuid = "4448BE21-1AA1-41B8-887E-B3E07B28EFAE" ?>
  <?define MurmurDesktopShortcutGuid = "02936CED-6588-4B7E-880F-241A4CF5E7D3" ?>
  <?define UninstallerComponentGuid = "CB81DC70-063E-48DD-94C3-593BBBAB20F4" ?>
  <?define LicenseTextGuid = "87C7967B-5E4B-41DD-83F5-A9E9E8AD3B39" ?>
  <?define ReadMeTextGuid = "15878902-B819-4E77-8C1D-0A915D79660B" ?>
  <?define ApplicationProgramsFolderRemovalComponentGuid = "0AE1745D-FF86-4D61-BAF3-44248D21D263" ?>
  <?define NSISUninstallComponentGuid = "3116B7EF-CBA3-4E0B-A2C5-0F0608038905" ?>

  <!-- Defaults for values that aren't given by environment variables -->
  <?ifndef env.MumbleSourceDir ?>
    <?define SourceDir = "\dev\mumble" ?>
  <?else ?>
    <?define SourceDir = "$(env.MumbleSourceDir)" ?>
  <?endif ?>
  
  <?ifndef env.MumbleQtDir ?>
    <?define QtDir = "\dev\QtMumble" ?>
  <?else ?>
    <?define QtDir = "$(env.MumbleQtDir)" ?>
  <?endif ?>
  
  <?ifndef env.MumbleSndFileDir ?>
    <?ifndef env.MumbleNoSndFile ?>
      <?define SndFileDir = "\Program Files (x86)\Mega-Nerd\libsndfile\bin" ?>
    <?endif ?>
  <?else ?>
    <?define SndFileDir = "$(env.MumbleSndFileDir)" ?>
  <?endif ?>
  
  <?ifndef env.MumbleMySQLDir ?>
    <?ifndef env.MumbleNoMySQL ?>
      <?define MySQLDir = "\dev\MySQL" ?>
    <?endif ?>
  <?else ?>
    <?define MySQLDir = "$(env.MumbleMySQLDir)" ?>
  <?endif ?>
  
  <?ifndef env.MumbleIceDir ?>
    <?ifndef env.MumbleNoIce ?>
      <?define IceDir = "\Program Files (x86)\ZeroC\Ice-3.4.2\bin\vc100" ?>
    <?endif ?>
  <?else ?>
    <?define IceDir = "$(env.MumbleIceDir)" ?>
  <?endif ?>
  
  <?ifndef env.MumbleBzip2Dir ?>
    <?ifdef IceDir ?>
      <?define Bzip2Dir = "$(var.IceDir)" ?>
    <?endif ?>
  <?else ?>
    <?define Bzip2Dir = "$(env.MumbleBzip2Dir)" ?>
  <?endif ?>

  <?ifndef env.MumbleOpenSslDir ?>
    <?define OpenSslDir = "\dev\openssl" ?>
  <?else ?>
    <?define OpenSslDir = "$(env.MumbleOpenSslDir)" ?>
  <?endif ?>

  <?ifndef env.MumbleZlibDir ?>
    <?define ZlibDir = "\dev\zlib" ?>
  <?else ?>
    <?define ZlibDir = "$(env.MumbleZlibDir)" ?>
  <?endif ?>
  
  <!-- Don't embed VCRedist files if MumbleNoEmbedVCRedist env var is set. -->
  <?ifndef env.MumbleNoEmbedVCRedist ?>
     <!-- VC CRT -->
     <?ifndef env.MumbleRedistDirVC14 ?>
       <?if $(sys.BUILDARCH) = "x86" ?>
         <?define RedistDirVC14 = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT" ?>
       <?elseif $(sys.BUILDARCH) = "x64" ?>
         <?define RedistDirVC14 = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT" ?>
       <?endif ?>
     <?else ?>
       <?define RedistDirVC14 = "$(env.MumbleRedistDirVC14)" ?>
     <?endif ?>

     <!-- Universal CRT -->
     <?ifndef env.MumbleRedistDirUCRT ?>
       <?if $(sys.BUILDARCH) = "x86" ?>
         <?define RedistDirUCRT = "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86" ?>
       <?elseif $(sys.BUILDARCH) = "x64" ?>
         <?define RedistDirUCRT = "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x64" ?>
       <?endif ?>
     <?else ?>
       <?define RedistDirUCRT = "$(env.MumbleRedistDirUCRT)" ?>
     <?endif ?>
  <?endif ?>

  <!--
    System32x86Dir is the system's System32 directory
    that contains x86 binaries.
    For 32-bit Windows, it's System32.
    For 64-bit Windows, it's SysWOW64.
  -->
  <?ifdef env.ProgramFiles(x86) ?>
    <?define System32x86Dir = "$(env.SystemRoot)\SysWOW64" ?>
  <?else ?>
    <?define System32x86Dir = "$(env.SystemRoot)\System32" ?>
  <?endif ?>

  <!-- Environment flags to disable features. Value doesn't matter -->
  <?ifdef env.MumbleSSE ?>
    <?define SSE = true ?>
  <?endif ?>
  
  <?ifndef env.MumbleNoSSE2 ?>
    <?define SSE2 = true ?>
  <?endif ?>
  
  <?ifndef env.MumbleNoG15 ?>
    <?define G15 = true ?> 
  <?endif ?>
  
  <?ifndef env.MumbleNoRNNoise ?>
    <?define RNN = true ?>
  <?endif ?>

  <?ifdef env.MumbleVersionSubDir ?>
    <?define VersionSubDir = "$(env.MumbleVersionSubDir)" ?>
  <?endif ?>

</Include>
