Revision: 7606
http://sourceforge.net/p/winmerge/code/7606
Author: christianlist
Date: 2013-03-10 14:31:00 +0000 (Sun, 10 Mar 2013)
Log Message:
-----------
[patches:#3026] Improved WiX installer
This patch has quite a few changes in it:
There are lots of whitespace changes. I think these are from Visual Studio, when I edit the xml files it reformats them for me. These changes can of course be ignored.
Upgraded WiX from 3.5 to 3.6.
WiX 3.7 was released recently, so I may go ahead and update to 3.7 before long.
Used Visual Studio 2010 as the compiler. WiX itself isn't dependent on the Visual Studio version, so we might as well use the version that's most convenient.
Changed a few paths in Config.wxi, they now point to where WinMergeX64.sln actually puts them.
Split the ShellExtension feature out into it's own ShellExtension.wxs file. The ShellExtension is most likely the component that will give us the most headache for this installer, so having it in it's own file is good.
Used the UtilExentension to add support for the RestartManager. This let's the installer prompt the user to have a choice between closing Windows Explorer or restarting the computer after installation.
Changed the shortcut registry entries to be unique. They have to be unique, otherwise there will be uninstall problems.
Add detection for InnoSetup installers present on the machine already, and quitly unistalling those prior to installing the WiX installer.
This may only be needed in the 32 bit version. But I left it in there for both version for now.
Fixed the Windows version detection, so it now actually works.
Added some additional properties to the Add/Remove Programs entry, to give users a little more information.
Created the first inital version of a build script for the WiX setup BuildWiXInstaller.bat. It's very rudimentary right now, but at least it's there.
Modified Paths:
--------------
trunk/Docs/Users/ChangeLog.txt
trunk/Installer/WiX/Config.wxi
trunk/Installer/WiX/Fragments/Core.wxs
trunk/Installer/WiX/Fragments/Features.wxs
trunk/Installer/WiX/WinMerge.wixproj
trunk/Installer/WiX/WinMerge.wxs
Added Paths:
-----------
trunk/Installer/WiX/Fragments/ShellExtension.wxs
trunk/Tools/Scripts/BuildWiXInstaller.bat
Modified: trunk/Docs/Users/ChangeLog.txt
===================================================================
--- trunk/Docs/Users/ChangeLog.txt 2013-03-10 13:07:51 UTC (rev 7605)
+++ trunk/Docs/Users/ChangeLog.txt 2013-03-10 14:31:00 UTC (rev 7606)
@@ -10,6 +10,7 @@
Installer: Remove Uninstall shortcut from start menu folder (#3076909)
Installer: Don't install quick launch icon for Windows 7 (#3079966)
Installer: Add support for TortoiseGit (patches:#3016)
+ Installer: Improved WiX installer (patches:#3026)
Bugfix: No menu icons was shown on Windows x64 (#3070151)
Bugfix: Crash when pasting from clipboard (#3109525)
Bugfix: Keeps verifing path even turned off in options (#3111581)
Modified: trunk/Installer/WiX/Config.wxi
===================================================================
--- trunk/Installer/WiX/Config.wxi 2013-03-10 13:07:51 UTC (rev 7605)
+++ trunk/Installer/WiX/Config.wxi 2013-03-10 14:31:00 UTC (rev 7606)
@@ -19,9 +19,9 @@
<?define UpgradeGuid = "79F16C51-8485-426E-BF23-F4D3D0D431D7" ?>
<?define ProgramFilesFolder = "ProgramFiles64Folder" ?>
- <?define MergeBuildDir = "..\..\Build\x64\MergeRelease" ?>
+ <?define MergeBuildDir = "..\..\Build\x64\MergeUnicodeRelease" ?>
<?define ExpatBuildDir = "..\..\Build\expat\lib\x64\Release" ?>
- <?define PcreBuildDir = "..\..\Build\pcre\lib\x64\Release" ?>
+ <?define PcreBuildDir = "..\..\Build\pcre\x64\Release" ?>
<?define ShellExtBuildDir = "..\..\Build\ShellExtension\x64 release" ?>
<?define StartMenuShortcutsGuid = "CDC49AA0-DC37-439d-8358-68E2EA9EF909" ?>
Modified: trunk/Installer/WiX/Fragments/Core.wxs
===================================================================
--- trunk/Installer/WiX/Fragments/Core.wxs 2013-03-10 13:07:51 UTC (rev 7605)
+++ trunk/Installer/WiX/Fragments/Core.wxs 2013-03-10 14:31:00 UTC (rev 7606)
@@ -1,100 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include ..\Config.wxi ?>
<Fragment>
<DirectoryRef Id="INSTALLDIR">
<Component Id="WinMergeU" Guid="*" Win64="$(var.Win64)">
- <File Id="WinMergeUEXE"
- Name="WinMergeU.exe"
- Source="$(var.MergeBuildDir)\WinMergeU.exe"
+ <File Id="WinMergeUEXE"
+ Name="WinMergeU.exe"
+ Source="$(var.MergeBuildDir)\WinMergeU.exe"
Vital="yes" />
</Component>
-
+
<Component Id="libexpat" Guid="*" Win64="$(var.Win64)">
- <File Id="libexpatDLL"
- Name="libexpat.dll"
- Source="$(var.ExpatBuildDir)\libexpat.dll"
+ <File Id="libexpatDLL"
+ Name="libexpat.dll"
+ Source="$(var.ExpatBuildDir)\libexpat.dll"
Vital="yes" />
</Component>
-
+
<Component Id="pcre" Guid="*" Win64="$(var.Win64)">
- <File Id="pcreDLL"
- Name="pcre.dll"
- Source="$(var.PcreBuildDir)\pcre.dll"
+ <File Id="pcreDLL"
+ Name="pcre.dll"
+ Source="$(var.PcreBuildDir)\pcre.dll"
Vital="yes" />
</Component>
-
+
<Component Id="MergeLang" Guid="*" Win64="$(var.Win64)">
- <File Id="MergeLangDLL"
- Name="MergeLang.dll"
- Source="$(var.MergeBuildDir)\MergeLang.dll"
+ <File Id="MergeLangDLL"
+ Name="MergeLang.dll"
+ Source="$(var.MergeBuildDir)\MergeLang.dll"
Vital="yes" />
</Component>
-
+
<Component Id="Files" Guid="*" Win64="$(var.Win64)">
- <File Id="FilesTXT"
- Name="Files.txt"
- Source="..\..\Docs\Users\Files.txt"
+ <File Id="FilesTXT"
+ Name="Files.txt"
+ Source="..\..\Docs\Users\Files.txt"
Vital="no" />
</Component>
-
+
<Component Id="Contributors" Guid="*" Win64="$(var.Win64)">
- <File Id="ContributorsTXT"
- Name="Contributors.txt"
- Source="..\..\Docs\Users\Contributors.txt"
+ <File Id="ContributorsTXT"
+ Name="Contributors.txt"
+ Source="..\..\Docs\Users\Contributors.txt"
Vital="no" />
</Component>
+
</DirectoryRef>
-
- <!-- Shell Extension -->
- <DirectoryRef Id="INSTALLDIR">
- <Component Id="ShellExtension" Guid="*" Win64="$(var.Win64)">
- <?if $(var.Platform) = "x64" ?>
- <File Id="ShellExtensionX64DLL"
- Name="ShellExtensionX64.dll"
- SelfRegCost="1"
- Source="$(var.ShellExtBuildDir)\ShellExtensionX64.dll"
- Vital="yes" />
- <?else ?>
- <File Id="ShellExtensionUDLL"
- Name="ShellExtensionU.dll"
- SelfRegCost="1"
- Source="$(var.ShellExtBuildDir)\ShellExtensionU.dll"
- Vital="yes" />
- <?endif ?>
- </Component>
- </DirectoryRef>
-
+
<!-- Startmenu shortcuts -->
<DirectoryRef Id="WinMergeMenuFolder">
<Component Id="StartMenuShortcuts" Guid="$(var.StartMenuShortcutsGuid)" Win64="$(var.Win64)">
<Condition>TASK_STARTMENUSHORTCUTS</Condition>
- <Shortcut Id="WinMergeStartMenuShortcut"
- Name="WinMerge"
+ <Shortcut Id="WinMergeStartMenuShortcut"
+ Name="WinMerge"
Target="[INSTALLDIR]WinMergeU.exe"
WorkingDirectory="INSTALLDIR" />
- <Shortcut Id="ReadMeStartMenuShortcut"
- Name="Read Me"
+ <Shortcut Id="ReadMeStartMenuShortcut"
+ Name="Read Me"
Target="[INSTALLDIR]Docs\ReadMe.txt"
WorkingDirectory="INSTALLDIR" />
- <Shortcut Id="HelpStartMenuShortcut"
- Name="WinMerge Help"
+ <Shortcut Id="HelpStartMenuShortcut"
+ Name="WinMerge Help"
Target="[INSTALLDIR]Docs\WinMerge.chm"
WorkingDirectory="INSTALLDIR" />
<RemoveFolder Id="WinMergeMenuFolder" On="uninstall" />
- <RegistryValue Root="HKCU" Key="Software\Thingamahoochie\WinMerge" Name="Installed" Type="integer" Value="1" KeyPath="yes" />
+ <RegistryValue Root="HKCU" Key="Software\Thingamahoochie\WinMerge\Installation" Name="StartMenuShortcuts" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
-
+
<!-- Desktop shortcut -->
<DirectoryRef Id="DesktopFolder">
<Component Id="DesktopShortcut" Guid="$(var.DesktopShortcutGuid)" Win64="$(var.Win64)">
<Condition>TASK_DESKTOPSHORTCUT</Condition>
- <Shortcut Id="WinMergeDesktopShortcut"
- Name="WinMerge"
+ <Shortcut Id="WinMergeDesktopShortcut"
+ Name="WinMerge"
Target="[INSTALLDIR]WinMergeU.exe"
WorkingDirectory="INSTALLDIR" />
- <RegistryValue Root="HKCU" Key="Software\Thingamahoochie\WinMerge" Name="Installed" Type="integer" Value="1" KeyPath="yes" />
+ <RegistryValue Root="HKCU" Key="Software\Thingamahoochie\WinMerge\Installation" Name="DesktopShortcut" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>
Modified: trunk/Installer/WiX/Fragments/Features.wxs
===================================================================
--- trunk/Installer/WiX/Fragments/Features.wxs 2013-03-10 13:07:51 UTC (rev 7605)
+++ trunk/Installer/WiX/Fragments/Features.wxs 2013-03-10 14:31:00 UTC (rev 7606)
@@ -19,13 +19,8 @@
<ComponentRef Id="MergeLang" />
<ComponentRef Id="StartMenuShortcuts" />
<ComponentRef Id="DesktopShortcut" />
- <Feature Id="ShellExtension"
- AllowAdvertise="no"
- Description="Explorer context menu integration"
- Level="1"
- Title="Shell Extension">
- <ComponentRef Id="ShellExtension" />
- </Feature>
+ <FeatureRef Id="ShellExtension" />
+
<Feature Id="Documentation" Absent="disallow" AllowAdvertise="no" Display="hidden" Level="1" Title="Documentation">
<ComponentRef Id="Files" />
<ComponentRef Id="Contributors" />
Added: trunk/Installer/WiX/Fragments/ShellExtension.wxs
===================================================================
--- trunk/Installer/WiX/Fragments/ShellExtension.wxs (rev 0)
+++ trunk/Installer/WiX/Fragments/ShellExtension.wxs 2013-03-10 14:31:00 UTC (rev 7606)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
+ <?include ..\Config.wxi ?>
+ <Fragment>
+ <Feature Id="ShellExtension" AllowAdvertise="no" Description="Explorer context menu integration"
+ Level="1" Title="Shell Extension">
+ <Component Id="ShellExtension" Directory="INSTALLDIR" Guid="*" Win64="$(var.Win64)">
+ <?if $(var.Platform) = "x64" ?>
+ <File Id="ShellExtensionX64DLL"
+ Name="ShellExtensionX64.dll"
+ SelfRegCost="1"
+ Source="$(var.ShellExtBuildDir)\ShellExtensionX64.dll"
+ Vital="yes" />
+ <!--Do not include the 32 bit file in 64 bit package-->
+ <?else ?>
+
+ <File Id="ShellExtensionUDLL"
+ Name="ShellExtensionU.dll"
+ SelfRegCost="1"
+ Source="$(var.ShellExtBuildDir)\ShellExtensionU.dll"
+ Vital="yes" />
+ <?endif ?>
+ <util:RestartResource ProcessName="explorer.exe" />
+ </Component>
+ </Feature>
+ </Fragment>
+</Wix>
\ No newline at end of file
Modified: trunk/Installer/WiX/WinMerge.wixproj
===================================================================
--- trunk/Installer/WiX/WinMerge.wixproj 2013-03-10 13:07:51 UTC (rev 7605)
+++ trunk/Installer/WiX/WinMerge.wixproj 2013-03-10 14:31:00 UTC (rev 7606)
@@ -1,31 +1,47 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<DefineSolutionProperties>false</DefineSolutionProperties>
-
- <WixToolPath Condition="'$(WixToolPath)' == ''">$(PROGRAMFILES)\Windows Installer XML v3.5\bin\</WixToolPath>
+ <WixToolPath Condition="'$(WixToolPath)' == ''">$(PROGRAMFILES)\WiX Toolset v3.6\bin\</WixToolPath>
<WixTargetsPath Condition="'$(WixTargetsPath)' == ''">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
-
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
-
+ <ProductVersion>1.2.3</ProductVersion>
<OutputName Condition=" '$(ProductVersion)' != '' ">WinMerge-$(ProductVersion)-$(Platform)-Setup</OutputName>
<OutputName Condition=" '$(ProductVersion)' == '' ">WinMerge-$(Platform)-Setup</OutputName>
<OutputPath>..\..\Build\WiX\$(Configuration)\$(Platform)\</OutputPath>
<IntermediateOutputPath>..\..\BuildTmp\WiX\$(Configuration)\$(Platform)\</IntermediateOutputPath>
<OutputType>package</OutputType>
+ <ProjectGuid>{cec830a7-1d3b-4558-be94-48a390ef894b}</ProjectGuid>
</PropertyGroup>
-
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <DefineConstants>
+ </DefineConstants>
+ </PropertyGroup>
<ItemGroup>
- <WixExtension Include="$(WixToolPath)WixUIExtension.dll" />
- <Compile Include="WinMerge.wxs"/>
- <Compile Include="Fragments\Core.wxs"/>
- <Compile Include="Fragments\Docs.wxs"/>
- <Compile Include="Fragments\Filters.wxs"/>
- <Compile Include="Fragments\Languages.wxs"/>
- <Compile Include="Fragments\Features.wxs"/>
- <Compile Include="Fragments\WixUI_WinMerge.wxs"/>
- <Compile Include="Fragments\WixUI_AdditionalTasksDlg.wxs"/>
+ <WixExtension Include="WixUIExtension">
+ <HintPath>C:\Program Files (x86)\WiX Toolset v3.6\bin\WixUIExtension.dll</HintPath>
+ <Name>WixUIExtension</Name>
+ </WixExtension>
+ <WixExtension Include="WixUtilExtension">
+ <HintPath>C:\Program Files (x86)\WiX Toolset v3.6\bin\WixUtilExtension.dll</HintPath>
+ <Name>WixUtilExtension</Name>
+ </WixExtension>
+ <Compile Include="Fragments\ShellExtension.wxs" />
+ <Compile Include="WinMerge.wxs" />
+ <Compile Include="Fragments\Core.wxs" />
+ <Compile Include="Fragments\Docs.wxs" />
+ <Compile Include="Fragments\Filters.wxs" />
+ <Compile Include="Fragments\Languages.wxs" />
+ <Compile Include="Fragments\Features.wxs" />
+ <Compile Include="Fragments\WixUI_WinMerge.wxs" />
+ <Compile Include="Fragments\WixUI_AdditionalTasksDlg.wxs" />
</ItemGroup>
-
- <Import Project="$(WixTargetsPath)"/>
-</Project>
+ <ItemGroup>
+ <Folder Include="Fragments\" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Config.wxi" />
+ </ItemGroup>
+ <Import Project="$(WixTargetsPath)" />
+</Project>
\ No newline at end of file
Modified: trunk/Installer/WiX/WinMerge.wxs
===================================================================
--- trunk/Installer/WiX/WinMerge.wxs 2013-03-10 13:07:51 UTC (rev 7605)
+++ trunk/Installer/WiX/WinMerge.wxs 2013-03-10 14:31:00 UTC (rev 7606)
@@ -3,7 +3,7 @@
candleArgs: "WinMerge.wxs" "Fragments\Core.wxs" "Fragments\Docs.wxs" "Fragments\Filters.wxs" "Fragments\Languages.wxs" "Fragments\Features.wxs" "Fragments\WixUI_WinMerge.wxs" "Fragments\WixUI_AdditionalTasksDlg.wxs" <extensions>
lightArgs: "WinMerge.wixobj" "Core.wixobj" "Docs.wixobj" "Filters.wixobj" "Languages.wixobj" "Features.wixobj" "WixUI_WinMerge.wixobj" "WixUI_AdditionalTasksDlg.wixobj" -ext WixUIExtension -out "<projectname>.msi" <extensions>
-->
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include Config.wxi ?>
<!--
TODO:
@@ -12,6 +12,7 @@
* Quick Launch
* Integrate to...
* TortoiseCVS
+ * TortoiseGit
* TortoiseSVN
* ClearCase
* Modify Path
@@ -37,7 +38,8 @@
Languages="1033"
Manufacturer="$(var.PackageDescription)"
Platform="$(var.PackagePlatform)"
- SummaryCodepage="1252" />
+ SummaryCodepage="1252"
+ InstallScope="perMachine" />
<Media Id="1"
Cabinet="winmerge.cab"
@@ -63,23 +65,44 @@
<Property Id="TASK_STARTMENUSHORTCUTS">1</Property>
<Property Id="TASK_DESKTOPSHORTCUT">1</Property>
+ <!--Search the registry for WinMerge version 2.14 or older.
+ These versions where installed using InnoSetup and requires a special executable to be executed to uninstall-->
+ <Property Id="UNINSTALLINNOSETUP">
+ <RegistrySearch Id="UninstallInnoSetup" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinMerge_is1" Name="QuietUninstallString" Type="raw"/>
+ </Property>
+
+ <!--Set the command line to be executed in a CustomAction-->
+ <SetProperty Id="QtExecCmdLine" Value="[UNINSTALLINNOSETUP]" After="AppSearch"/>
+ <CustomAction Id="UninstallInnoSetupCA" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
+
+ <InstallExecuteSequence>
+ <!--Execute the CustomAction to uninstall the old InnoSetup based installer-->
+ <Custom Action="UninstallInnoSetupCA" After="InstallInitialize" >
+ <![CDATA[(NOT Installed) OR UNINSTALLINNOSETUP]]>
+ </Custom>
+ </InstallExecuteSequence>
+
+
<FeatureRef Id="WinMerge" />
- <!-- TODO: Works this really? -->
- <Condition Message="WinMerge requires Windows 2000/XP/2003/Vista/2008 or later to install.">
- <![CDATA[( VersionNT <= 500 ) OR ( Version9x <> 0 )]]>
+ <Condition Message="WinMerge requires Windows 2000/XP/2003/Vista/2008/7/8/2012 or later to install.">
+ <![CDATA[Installed OR (VersionNT >= 500)]]>
</Condition>
<WixVariable Id="WixUILicenseRtf" Value="..\..\Docs\users\GPL.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="Bitmaps\banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="Bitmaps\dialog.bmp" />
+ <!--Some properties to set on Add/Remove Programs (ARP)-->
<Icon Id="Merge.ico" SourceFile="..\..\Src\res\Merge.ico"/>
<Property Id="ARPPRODUCTICON" Value="Merge.ico" />
+ <SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
+ <Property Id="ARPURLINFOABOUT" Value="http://WinMerge.org" />
+ <Property Id="ARPHELPLINK" Value="http://WinMerge.org" />
+ <Property Id="ARPURLUPDATEINFO" Value="http://WinMerge.org/" />
+ <SetProperty Id="ARPREADME" Value="[DOCSDIR]ReadMe.txt" After="CostFinalize"/>
<UIRef Id="WixUI_WinMerge" />
- <UI />
-
</Product>
</Wix>
Added: trunk/Tools/Scripts/BuildWiXInstaller.bat
===================================================================
--- trunk/Tools/Scripts/BuildWiXInstaller.bat (rev 0)
+++ trunk/Tools/Scripts/BuildWiXInstaller.bat 2013-03-10 14:31:00 UTC (rev 7606)
@@ -0,0 +1,4 @@
+call "%VS100COMNTOOLS%vsvars32.bat"
+
+msbuild.exe ../../Installer/WiX/WinMerge.wixproj /p:Platform=x86
+msbuild.exe ../../Installer/WiX/WinMerge.wixproj /p:Platform=x64
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|