]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10034 [WIX] Fix WIX to respect Win32/x64 binary output folders.
authorAndrey Volk <andywolk@gmail.com>
Sat, 11 Feb 2017 19:53:12 +0000 (22:53 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sun, 12 Feb 2017 12:55:41 +0000 (15:55 +0300)
w32/Setup/FullVersion.cmd [new file with mode: 0644]
w32/Setup/Product.2015.wxs
w32/Setup/Setup.2015.wixproj

diff --git a/w32/Setup/FullVersion.cmd b/w32/Setup/FullVersion.cmd
new file mode 100644 (file)
index 0000000..5cbec6a
--- /dev/null
@@ -0,0 +1,9 @@
+REM This script reads the configure.ac 
+REM and outputs a version parsing the AC_INIT line
+
+FOR /f "delims=" %%i in ('FIND /N "AC_INIT" ..\..\configure.ac') DO SET version_contained_string=%%i
+FOR /f "tokens=2 delims=," %%a in ("%version_contained_string%") DO SET dirty_version=%%a
+SET almost_clean_version=%dirty_version:[=%
+SET version_with_spaces=%almost_clean_version:]=%
+SET full_version=%version_with_spaces: =%
+echo %full_version%
\ No newline at end of file
index 5c126c35b5e7779d227d38af3c698935d7482ac0..8cefee42105f610cd52e2522083a756a90eb1a53 100644 (file)
@@ -27,7 +27,7 @@
 <?endif ?>\r
 \r
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">\r
-       <Product Id="b004a325-1272-47e5-a415-a74e9fc99865" Name="$(var.ProductName)" Language="1033" Version="1.0.0.0" Manufacturer="FreeSWITCH" UpgradeCode="3af7020b-1348-45e8-a0cf-80909d4eb421">\r
+       <Product Id="b004a325-1272-47e5-a415-a74e9fc99865" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="FreeSWITCH" UpgradeCode="3af7020b-1348-45e8-a0cf-80909d4eb421">\r
                <Package InstallerVersion="405" Compressed="yes" />\r
 \r
                <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />\r
index a2f76824fe5de6e53cb9c0800f3e3749a7283687..4c2dc0c9c257377a25e296d0dbe55ece8c536650 100644 (file)
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="LoadDynamicVariables" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
-    <ProductVersion>3.5</ProductVersion>\r
     <ProjectGuid>{47213370-b933-487d-9f45-bca26d7e2b6f}</ProjectGuid>\r
     <SchemaVersion>2.0</SchemaVersion>\r
     <OutputName>FreeSWITCH</OutputName>\r
@@ -10,7 +9,7 @@
     <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">\r
-    <OutputPath>bin\Win32\Debug\</OutputPath>\r
+    <OutputPath>bin\x86\Debug\</OutputPath>\r
     <IntermediateOutputPath>obj\X86\$(Configuration)\</IntermediateOutputPath>\r
     <DefineConstants>Debug;FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\Win32\debug\sounds;FreeSWITCHBaseDir=$(SolutionDir)Win32\$(Configuration);PlatformDir=Win32;</DefineConstants>\r
     <WixVariables>\r
     <Content Include="filter.xslt" />\r
   </ItemGroup>\r
   <Import Project="$(WixTargetsPath)" />\r
-  <PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Platform)' == 'x86' ">\r
+    <PreBuildEvent>"$(WixToolPath)\heat.exe" dir "$(ProjectDir)..\..\conf\vanilla" -cg FreeSWITCHConfFiles -gg -scom -sreg -sfrag -srd -dr CONFLOCATION -var var.FreeSWITCHConfFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHConfFiles.wxs"\r
+"$(WixToolPath)\heat.exe" dir "$(SolutionDir)Win32\$(Configuration)\sounds" -cg FreeSWITCHSoundFiles8 -gg -scom -sreg -sfrag -srd -dr SOUNDLOCATION -var var.FreeSWITCHSoundFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHSoundFiles8.wxs"\r
+"$(WixToolPath)\heat.exe" dir "$(SolutionDir)Win32\$(Configuration)" -t $(ProjectDir)filter.xslt -cg FreeSWITCHBaseFiles -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var var.FreeSWITCHBaseDir -out "$(ProjectDir)Fragments\FreeSWITCHBaseFiles.wxs"</PreBuildEvent>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Platform)' == 'x64' ">\r
     <PreBuildEvent>"$(WixToolPath)\heat.exe" dir "$(ProjectDir)..\..\conf\vanilla" -cg FreeSWITCHConfFiles -gg -scom -sreg -sfrag -srd -dr CONFLOCATION -var var.FreeSWITCHConfFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHConfFiles.wxs"\r
 "$(WixToolPath)\heat.exe" dir "$(SolutionDir)x64\$(Configuration)\sounds" -cg FreeSWITCHSoundFiles8 -gg -scom -sreg -sfrag -srd -dr SOUNDLOCATION -var var.FreeSWITCHSoundFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHSoundFiles8.wxs"\r
 "$(WixToolPath)\heat.exe" dir "$(SolutionDir)x64\$(Configuration)" -t $(ProjectDir)filter.xslt -cg FreeSWITCHBaseFiles -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var var.FreeSWITCHBaseDir -out "$(ProjectDir)Fragments\FreeSWITCHBaseFiles.wxs"</PreBuildEvent>\r
   </PropertyGroup>\r
+      <Target Name="LoadDynamicVariables">\r
+          <Exec Command="$(SolutionDir)w32\Setup\FullVersion.cmd" ConsoleToMSBuild="true">\r
+            <Output TaskParameter="ConsoleOutput" PropertyName="FullVersion" />\r
+          </Exec>\r
+          <CreateProperty Condition="$(FullVersion) != ''" Value="ProductVersion=$(FullVersion);$(DefineConstants)">\r
+            <Output TaskParameter="Value" PropertyName="DefineConstants" />\r
+          </CreateProperty>\r
+          <CreateProperty Condition="'$(Platform)'=='x86'" Value="win32">\r
+            <Output TaskParameter="Value" PropertyName="UserFriendlyPlatform" />\r
+          </CreateProperty>\r
+          <CreateProperty Condition="'$(Platform)'=='x64'" Value="x64">\r
+            <Output TaskParameter="Value" PropertyName="UserFriendlyPlatform" />\r
+          </CreateProperty>\r
+          <CreateProperty Condition="$(FullVersion) != ''" Value="$(SolutionDir)$(UserFriendlyPlatform)\$(OutputName)-$(FullVersion)-$(UserFriendlyPlatform)-$(Configuration).msi">\r
+            <Output TaskParameter="Value" PropertyName="DestinationFileName" />\r
+          </CreateProperty>\r
+      </Target>\r
+\r
   <!--\r
-       To modify your build process, add your task inside one of the targets below and uncomment it.\r
-       Other similar extension points exist, see Wix.targets.\r
-       <Target Name="BeforeBuild">\r
-       </Target>\r
-       <Target Name="AfterBuild">\r
-       </Target>\r
-       -->\r
+      To modify your build process, add your task inside one of the targets below.\r
+      Other similar extension points exist, see Wix.targets.\r
+  -->\r
+      <Target Name="BeforeBuild">\r
+          <Message Importance="High" Text="Deleting previously created MSI files."/>\r
+          <Delete Files="$(OutputPath)$(OutputName).msi" />  \r
+          <Delete Files="$(DestinationFileName)" />  \r
+      </Target>\r
+\r
+      <Target Name="AfterBuild">\r
+          <Copy SourceFiles="$(OutputPath)$(OutputName).msi" DestinationFiles="$(DestinationFileName)" />\r
+          <Message Importance="High" Condition="Exists('$(DestinationFileName)')" Text="Success. An output MSI has been copied to $(DestinationFileName)"/>\r
+      </Target>\r
 </Project>
\ No newline at end of file