Setup.Sounds.2017.wixproj 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="LoadDynamicVariables" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3. <ImportGroup Label="PropertySheets">
  4. <Import Project="../../basedir.props" Condition=" '$(BaseDirImported)' == ''" />
  5. <Import Project="../../downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
  6. </ImportGroup>
  7. <PropertyGroup>
  8. <SoundPrimaryName Condition=" '$(SoundPrimaryName)' == '' ">en-us-callie</SoundPrimaryName>
  9. <SoundQuality Condition=" '$(SoundQuality)' == '' ">8000</SoundQuality>
  10. </PropertyGroup>
  11. <PropertyGroup>
  12. <SoundVersionFile Condition=" '$(SoundPrimaryName)' == 'music' ">moh_version.txt</SoundVersionFile>
  13. <SoundVersionFile Condition=" '$(SoundPrimaryName)' != 'music' ">sounds_version.txt</SoundVersionFile>
  14. <OutputName>Freeswitch-Sounds-$(SoundPrimaryName)-$(SoundQuality)Hz</OutputName>
  15. <SoundSuffix>$(SoundPrimaryName.Replace("-","_"))$(SoundQuality)</SoundSuffix>
  16. <CodeIndex Condition=" $(SoundQuality) == '8000' ">1</CodeIndex>
  17. <CodeIndex Condition=" $(SoundQuality) == '16000' ">2</CodeIndex>
  18. <CodeIndex Condition=" $(SoundQuality) == '32000' ">3</CodeIndex>
  19. <CodeIndex Condition=" $(SoundQuality) == '48000' ">4</CodeIndex>
  20. </PropertyGroup>
  21. <PropertyGroup>
  22. <ProjectGuid>4b082d46-c1b0-4dbb-8d8d-ac0d0fdcdbda</ProjectGuid>
  23. <SchemaVersion>2.0</SchemaVersion>
  24. <OutputType>Package</OutputType>
  25. <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
  26. <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
  27. </PropertyGroup>
  28. <PropertyGroup Condition=" $(Platform) == 'x64' ">
  29. <OutputPath>bin\x64\release\</OutputPath>
  30. <IntermediateOutputPath>obj\X64\$(Configuration)\</IntermediateOutputPath>
  31. </PropertyGroup>
  32. <ItemGroup>
  33. <Compile Include="Fragments\FreeSWITCHSoundFiles$(SoundSuffix).wxs" />
  34. <Compile Include="Product.wxs" />
  35. </ItemGroup>
  36. <ItemGroup>
  37. <WixExtension Include="WixUIExtension">
  38. <HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
  39. <Name>WixUIExtension</Name>
  40. </WixExtension>
  41. </ItemGroup>
  42. <ItemGroup>
  43. <Folder Include="Fragments" />
  44. </ItemGroup>
  45. <ItemGroup>
  46. <Content Include="../filter.xslt">
  47. <Link>filter.xslt</Link>
  48. </Content>
  49. </ItemGroup>
  50. <Import Project="$(WixTargetsPath)" />
  51. <PropertyGroup>
  52. <PreBuildEvent>"$(WixToolPath)\heat.exe" dir "$(BaseDir)libs\sounds\$(SoundSuffix)" -cg FreeSWITCHSoundFiles$(SoundSuffix) -gg -scom -sreg -sfrag -srd -dr SOUNDLOCATION -var var.FreeSWITCHSoundFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHSoundFiles$(SoundSuffix).wxs"</PreBuildEvent>
  53. </PropertyGroup>
  54. <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
  55. <DefineConstants>SoundPrimaryName=music;SoundQuality=8000</DefineConstants>
  56. </PropertyGroup>
  57. <Target Name="LoadDynamicVariables">
  58. <ReadLinesFromFile File="$(BaseDir)build/$(SoundVersionFile)">
  59. <Output TaskParameter="Lines" ItemName="LinesFromFile" />
  60. </ReadLinesFromFile>
  61. <CreateProperty Value="$([System.String]::Copy('%(LinesFromFile.Identity)').Split(' ')[1])" Condition=" $([System.String]::Copy('%(LinesFromFile.Identity)').Split(' ')[0]) == '$(SoundPrimaryName)'">
  62. <Output TaskParameter="Value" PropertyName="SoundVersion" />
  63. </CreateProperty>
  64. <CreateProperty Value="%(LinesFromFile.Identity)" Condition=" $(SoundPrimaryName) == 'music' ">
  65. <Output TaskParameter="Value" PropertyName="SoundVersion" />
  66. </CreateProperty>
  67. <Message Importance="High" Text="SoundVersion is $(SoundVersion)" />
  68. <ReadLinesFromFile File="$(BaseDir)build/sounds_upgradecode.txt">
  69. <Output TaskParameter="Lines" ItemName="LinesFromCodeFile" />
  70. </ReadLinesFromFile>
  71. <CreateProperty Value="$([System.String]::Copy('%(LinesFromCodeFile.Identity)').Split(' ')[$(CodeIndex)])" Condition=" $([System.String]::Copy('%(LinesFromCodeFile.Identity)').Split(' ')[0]) == '$(SoundPrimaryName)'">
  72. <Output TaskParameter="Value" PropertyName="SoundUpgradeCode" />
  73. </CreateProperty>
  74. <Message Importance="High" Text="SoundUpgradeCode is $(SoundUpgradeCode)" />
  75. <Message Importance="High" Text="SoundSuffix is '$(SoundSuffix)'" />
  76. <PropertyGroup>
  77. <SoundFileName>freeswitch-sounds-$(SoundPrimaryName)-$(SoundQuality)-$(SoundVersion).tar.gz</SoundFileName>
  78. <DefineConstants>BaseDir=$(BaseDir);SoundUpgradeCode=$(SoundUpgradeCode);SoundVersion=$(SoundVersion);SoundSuffix=$(SoundSuffix);SoundPrimaryName=$(SoundPrimaryName);SoundQuality=$(SoundQuality);FreeSWITCHSoundFilesDir=$(BaseDir)libs\sounds\$(SoundSuffix);</DefineConstants>
  79. </PropertyGroup>
  80. <CreateProperty Condition="'$(Platform)'=='x64'" Value="x64">
  81. <Output TaskParameter="Value" PropertyName="UserFriendlyPlatform" />
  82. </CreateProperty>
  83. <CreateProperty Value="$(BaseDir)$(UserFriendlyPlatform)\FreeSWITCH-Sounds-$(SoundPrimaryName)-$(SoundVersion)-$(SoundQuality)Hz.msi">
  84. <Output TaskParameter="Value" PropertyName="DestinationFileName" />
  85. </CreateProperty>
  86. </Target>
  87. <!--
  88. To modify your build process, add your task inside one of the targets below and uncomment it.
  89. Other similar extension points exist, see Wix.targets.
  90. -->
  91. <Target Name="BeforeBuild" DependsOnTargets="7za">
  92. <!--
  93. Download Target.
  94. Name must be unique.
  95. By design, targets are executed only once per project.
  96. Usage:
  97. package: URI
  98. expectfileordirectory: Skips the download and extraction if exists
  99. outputfolder: Folder to store a downloaded file.
  100. By default "$(BaseDir)libs", if empty
  101. outputfilename: If not empty, overrides filename from URI.
  102. .exe files don't get extracted
  103. extractto: Folder to extract an archive to
  104. -->
  105. <DownloadPackageTask package="http://files.freeswitch.org/releases/sounds/$(SoundFileName)" expectfileordirectory="$(BaseDir)libs\download-always" outputfolder="" outputfilename="" extractto="$(BaseDir)libs\sounds\$(SoundSuffix)\" />
  106. </Target>
  107. <Target Name="AfterBuild">
  108. <Copy SourceFiles="$(OutputPath)$(OutputName).msi" DestinationFiles="$(DestinationFileName)" />
  109. <Message Importance="High" Condition="Exists('$(DestinationFileName)')" Text="Success. An output MSI has been copied to $(DestinationFileName)" />
  110. </Target>
  111. </Project>