freeswitch/w32/Setup/Sounds/Setup.Sounds.2017.wixproj

118 lines
6.6 KiB
Plaintext
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="LoadDynamicVariables" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="../../basedir.props" Condition=" '$(BaseDirImported)' == ''" />
<Import Project="../../downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
</ImportGroup>
<PropertyGroup>
<SoundPrimaryName Condition=" '$(SoundPrimaryName)' == '' ">en-us-callie</SoundPrimaryName>
<SoundQuality Condition=" '$(SoundQuality)' == '' ">8000</SoundQuality>
</PropertyGroup>
<PropertyGroup>
<SoundVersionFile Condition=" '$(SoundPrimaryName)' == 'music' ">moh_version.txt</SoundVersionFile>
<SoundVersionFile Condition=" '$(SoundPrimaryName)' != 'music' ">sounds_version.txt</SoundVersionFile>
<OutputName>Freeswitch-Sounds-$(SoundPrimaryName)-$(SoundQuality)Hz</OutputName>
<SoundSuffix>$(SoundPrimaryName.Replace("-","_"))$(SoundQuality)</SoundSuffix>
<CodeIndex Condition=" $(SoundQuality) == '8000' ">1</CodeIndex>
<CodeIndex Condition=" $(SoundQuality) == '16000' ">2</CodeIndex>
<CodeIndex Condition=" $(SoundQuality) == '32000' ">3</CodeIndex>
<CodeIndex Condition=" $(SoundQuality) == '48000' ">4</CodeIndex>
</PropertyGroup>
<PropertyGroup>
<ProjectGuid>4b082d46-c1b0-4dbb-8d8d-ac0d0fdcdbda</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
</PropertyGroup>
<PropertyGroup Condition=" $(Platform) == 'x64' ">
<OutputPath>bin\x64\release\</OutputPath>
<IntermediateOutputPath>obj\X64\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="Fragments\FreeSWITCHSoundFiles$(SoundSuffix).wxs" />
<Compile Include="Product.wxs" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUIExtension">
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<Folder Include="Fragments" />
</ItemGroup>
<ItemGroup>
<Content Include="../filter.xslt">
<Link>filter.xslt</Link>
</Content>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<PropertyGroup>
<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>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DefineConstants>SoundPrimaryName=music;SoundQuality=8000</DefineConstants>
</PropertyGroup>
<Target Name="LoadDynamicVariables">
<ReadLinesFromFile File="$(BaseDir)build/$(SoundVersionFile)">
<Output TaskParameter="Lines" ItemName="LinesFromFile" />
</ReadLinesFromFile>
<CreateProperty Value="$([System.String]::Copy('%(LinesFromFile.Identity)').Split(' ')[1])" Condition=" $([System.String]::Copy('%(LinesFromFile.Identity)').Split(' ')[0]) == '$(SoundPrimaryName)'">
<Output TaskParameter="Value" PropertyName="SoundVersion" />
</CreateProperty>
<CreateProperty Value="%(LinesFromFile.Identity)" Condition=" $(SoundPrimaryName) == 'music' ">
<Output TaskParameter="Value" PropertyName="SoundVersion" />
</CreateProperty>
<Message Importance="High" Text="SoundVersion is $(SoundVersion)" />
<ReadLinesFromFile File="$(BaseDir)build/sounds_upgradecode.txt">
<Output TaskParameter="Lines" ItemName="LinesFromCodeFile" />
</ReadLinesFromFile>
<CreateProperty Value="$([System.String]::Copy('%(LinesFromCodeFile.Identity)').Split(' ')[$(CodeIndex)])" Condition=" $([System.String]::Copy('%(LinesFromCodeFile.Identity)').Split(' ')[0]) == '$(SoundPrimaryName)'">
<Output TaskParameter="Value" PropertyName="SoundUpgradeCode" />
</CreateProperty>
<Message Importance="High" Text="SoundUpgradeCode is $(SoundUpgradeCode)" />
<Message Importance="High" Text="SoundSuffix is '$(SoundSuffix)'" />
<PropertyGroup>
<SoundFileName>freeswitch-sounds-$(SoundPrimaryName)-$(SoundQuality)-$(SoundVersion).tar.gz</SoundFileName>
<DefineConstants>BaseDir=$(BaseDir);SoundUpgradeCode=$(SoundUpgradeCode);SoundVersion=$(SoundVersion);SoundSuffix=$(SoundSuffix);SoundPrimaryName=$(SoundPrimaryName);SoundQuality=$(SoundQuality);FreeSWITCHSoundFilesDir=$(BaseDir)libs\sounds\$(SoundSuffix);</DefineConstants>
</PropertyGroup>
<CreateProperty Condition="'$(Platform)'=='x64'" Value="x64">
<Output TaskParameter="Value" PropertyName="UserFriendlyPlatform" />
</CreateProperty>
<CreateProperty Value="$(BaseDir)$(UserFriendlyPlatform)\FreeSWITCH-Sounds-$(SoundPrimaryName)-$(SoundVersion)-$(SoundQuality)Hz.msi">
<Output TaskParameter="Value" PropertyName="DestinationFileName" />
</CreateProperty>
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
-->
<Target Name="BeforeBuild" DependsOnTargets="7za">
<!--
Download Target.
Name must be unique.
By design, targets are executed only once per project.
Usage:
package: URI
expectfileordirectory: Skips the download and extraction if exists
outputfolder: Folder to store a downloaded file.
By default "$(BaseDir)libs", if empty
outputfilename: If not empty, overrides filename from URI.
.exe files don't get extracted
extractto: Folder to extract an archive to
-->
<DownloadPackageTask package="http://files.freeswitch.org/releases/sounds/$(SoundFileName)" expectfileordirectory="$(BaseDir)libs\download-always" outputfolder="" outputfilename="" extractto="$(BaseDir)libs\sounds\$(SoundSuffix)\" />
</Target>
<Target Name="AfterBuild">
<Copy SourceFiles="$(OutputPath)$(OutputName).msi" DestinationFiles="$(DestinationFileName)" />
<Message Importance="High" Condition="Exists('$(DestinationFileName)')" Text="Success. An output MSI has been copied to $(DestinationFileName)" />
</Target>
</Project>