Skip to content

Commit fbb63df

Browse files
committed
Updated WiX installer:
- Use FeatureTree GUI - users can select which parts should be installed. - Configured for MSVC10 builds - Use WiX 3.6
1 parent 01f929a commit fbb63df

5 files changed

Lines changed: 74 additions & 39 deletions

File tree

win_installer/config.wxi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<?define Platform = "x86" ?>
55
<?endif ?>
66

7-
<?define CliBuildDir = "..\cli\release" ?>
8-
<?define GuiBuildDir = "..\Build\gui" ?>
7+
<?define CliBuildDir = "..\bin" ?>
8+
<?define GuiBuildDir = "..\bin" ?>
99
<?define TranslationsDir = "..\gui" ?>
1010
<?define HelpDir = "..\gui\help" ?>
11-
<?define QtDllDir = "..\..\runtimes" ?>
12-
<?define CrtMergeModule = "$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC90_CRT_x86.msm" ?>
11+
<?define QtDllDir = "..\bin" ?>
12+
<?define CrtMergeModule = "$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC100_CRT_x86.msm" ?>
1313
</Include>

win_installer/cppcheck.wixproj

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
1-
<Project DefaultTargets="All" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="All" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
23
<PropertyGroup>
34
<DefineSolutionProperties>false</DefineSolutionProperties>
4-
5-
<WixToolPath Condition="'$(WixToolPath)' == ''">$(PROGRAMFILES)\Windows Installer XML v3.5\bin\</WixToolPath>
5+
<WixToolPath Condition="'$(WixToolPath)' == ''">$(PROGRAMFILES)\WiX Toolset v3.6\bin\</WixToolPath>
66
<WixTargetsPath Condition="'$(WixTargetsPath)' == ''">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
77

88
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
99
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
1010

11-
<OutputName Condition=" '$(ProductVersion)' != '' ">cppcheck-$(ProductVersion)-$(Platform)-Setup</OutputName>
12-
<OutputPath>..\Build\</OutputPath>
13-
<IntermediateOutputPath>..\BuildTmp\Wix\$(Platform)\</IntermediateOutputPath>
11+
<OutputName>cppcheck-$(ProductVersion)-$(Platform)-Setup</OutputName>
12+
<OutputPath>Build\</OutputPath>
13+
<IntermediateOutputPath>BuildTmp\Wix\$(Platform)\</IntermediateOutputPath>
1414
<OutputType>package</OutputType>
15+
16+
<ProjectGuid>{3b772885-4980-4a76-8407-4dabf8f7757c}</ProjectGuid>
1517
</PropertyGroup>
1618

1719
<ItemGroup>
18-
<WixExtension Include="$(WixToolPath)WixUIExtension.dll" />
19-
<Compile Include="cppcheck.wxs"/>
20+
<WixExtension Include="WixUIExtension">
21+
<HintPath>C:\Programme\WiX Toolset v3.6\bin\WixUIExtension.dll</HintPath>
22+
<Name>WixUIExtension</Name>
23+
</WixExtension>
24+
<Compile Include="cppcheck.wxs" />
2025
</ItemGroup>
21-
22-
<Import Project="$(WixTargetsPath)"/>
23-
24-
<Target Name="All" DependsOnTargets="Clean;Validate;Build"/>
25-
26+
<ItemGroup>
27+
<Content Include="config.wxi" />
28+
<Content Include="productInfo.wxi" />
29+
<Content Include="readme.txt" />
30+
</ItemGroup>
31+
<Import Project="$(WixTargetsPath)" />
32+
<Target Name="All" DependsOnTargets="Clean;Validate;Build" />
2633
<Target Name="Clean">
27-
<RemoveDir Directories="..\buildtmp\wix" />
34+
<RemoveDir Directories="BuildTmp\Wix" />
2835
</Target>
2936

3037
<Target Name="Validate">
31-
<Exec Command="..\cli\release\cppcheck --rule=. --version"/>
38+
<Exec Command="..\bin\cppcheck --rule=. --version" />
3239
</Target>
3340
</Project>

win_installer/cppcheck.wxs

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@
22
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
33
<?include productInfo.wxi ?>
44
<?include config.wxi ?>
5+
56
<Product Name='$(var.ProductName)' Id='*' UpgradeCode='$(var.ProductUpgradeCode)'
67
Language='1033' Codepage='1252' Version='$(var.ProductVersion)' Manufacturer='$(var.ProductManufacturer)'>
78

89
<Package Id='*' Keywords='Installer' Description="$(var.ProductName) Setup"
910
Comments='$(var.ProductDescription)' Manufacturer='$(var.ProductManufacturer)'
10-
InstallerVersion='300' Languages='1033' Compressed='yes' SummaryCodepage='1252'/>
11+
InstallerVersion='300' Languages='1033' Compressed='yes' SummaryCodepage='1252' InstallScope='perMachine'/>
1112

1213
<Media Id='1' Cabinet='Cppcheck.cab' EmbedCab='yes' CompressionLevel='high' DiskPrompt='CD-ROM 1' />
1314
<Property Id='DiskPrompt' Value='Cppcheck installation [1]' />
1415

1516
<Directory Id='TARGETDIR' Name='SourceDir'>
17+
<Directory Id='SystemFolder' FileSource='SystemFolder' />
1618
<Directory Id='ProgramFilesFolder' Name='PFiles'>
1719
<Directory Id='INSTALLDIR' Name='$(var.ProductNameShort)'>
20+
<Component Id='cppcheckcore.dll' Guid='$(var.cppcheckcoreGUID)'>
21+
<File Id='cppcheckcore.dll' Name='cppcheck-core.dll' DiskId='1' Source='$(var.CliBuildDir)\cppcheck-core.dll' KeyPath='yes' />
22+
</Component>
1823
<Component Id='cppcheck.exe' Guid='$(var.cppcheckGUID)'>
1924
<File Id='cppcheck.exe' Name='cppcheck.exe' DiskId='1' Source='$(var.CliBuildDir)\cppcheck.exe' KeyPath='yes' />
2025
</Component>
@@ -29,18 +34,15 @@
2934
<Shortcut Id='startmenuGui' Directory="ProgramMenuDir" Name='$(var.ProductNameShort)'
3035
WorkingDirectory='INSTALLDIR' Icon="cppcheckgui.exe" IconIndex="0" Advertise="yes" />
3136
</File>
32-
<File Id='libgcc_s_dw2_1_dll' Name='libgcc_s_dw2-1.dll' Source='libgcc_s_dw2-1.dll' />
33-
<File Id='mingwm10dll' Name='mingwm10.dll' Source='mingwm10.dll' />
34-
<File Id='libpcre0dll' Name='libpcre-0.dll' Source='libpcre-0.dll' />
3537
<File Id='qtcore4dll' Name='qtcore4.dll' Source='$(var.QtDllDir)\qtcore4.dll' />
3638
<File Id='qtgui4dll' Name='qtgui4.dll' Source='$(var.QtDllDir)\qtgui4.dll' />
37-
<File Id='qtxml4dll' Name='qtxml4.dll' Source='$(var.QtDllDir)\qtxml4.dll' />
3839
</Component>
3940
<Component Id='GuiTranslations' Guid='$(var.guiTranslationsGUID)'>
4041
<File Id='cppcheck_de.qm' Name='cppcheck_de.qm' Source='$(var.TranslationsDir)\cppcheck_de.qm' />
4142
<File Id='cppcheck_es.qm' Name='cppcheck_es.qm' Source='$(var.TranslationsDir)\cppcheck_es.qm' />
4243
<File Id='cppcheck_fi.qm' Name='cppcheck_fi.qm' Source='$(var.TranslationsDir)\cppcheck_fi.qm' />
4344
<File Id='cppcheck_fr.qm' Name='cppcheck_fr.qm' Source='$(var.TranslationsDir)\cppcheck_fr.qm' />
45+
<File Id='cppcheck_it.qm' Name='cppcheck_it.qm' Source='$(var.TranslationsDir)\cppcheck_it.qm' />
4446
<File Id='cppcheck_ja.qm' Name='cppcheck_ja.qm' Source='$(var.TranslationsDir)\cppcheck_ja.qm' />
4547
<File Id='cppcheck_ko.qm' Name='cppcheck_ko.qm' Source='$(var.TranslationsDir)\cppcheck_ko.qm' />
4648
<File Id='cppcheck_nl.qm' Name='cppcheck_nl.qm' Source='$(var.TranslationsDir)\cppcheck_nl.qm' />
@@ -64,17 +66,22 @@
6466
<RemoveFile Id="msvcp90.dll" On="install" Name="msvcp90.dll" />
6567
<RemoveFile Id="msvcr90.dll" On="install" Name="msvcr90.dll" />
6668
<RemoveFile Id="Microsoft.VC90.CRT.manifest" On="install" Name="Microsoft.VC90.CRT.manifest" />
69+
<RemoveFile Id='libgcc_s_dw2_1_dll' On='install' Name='libgcc_s_dw2-1.dll' />
70+
<RemoveFile Id='mingwm10dll' On='install' Name='mingwm10.dll' />
71+
<RemoveFile Id='libpcre0dll' On='install' Name='libpcre-0.dll' />
6772
<RemoveFile Id="gui.exe" On="install" Name="gui.exe" />
6873
<RemoveFile Id="cppcheck_se.qm" On="install" Name="cppcheck_se.qm" />
6974
<RemoveFile Id="cppcheck_en.qm" On="install" Name="cppcheck_en.qm" />
75+
<RemoveFile Id="cppcheck_pl.qm" On="install" Name="cppcheck_pl.qm" />
7076
<RemoveFile Id="onlinehelp.qhc" On="install" Name="onlinehelp.qhc" />
7177
<RemoveFile Id="qtclucene4dll" On="install" Name="qtclucene4.dll" />
7278
<RemoveFile Id="qthelp4dll" On="install" Name="qthelp4.dll" />
7379
<RemoveFile Id="qtnetwork4dll" On="install" Name="qtnetwork4.dll" />
7480
<RemoveFile Id="qtsql4dll" On="install" Name="qtsql4.dll" />
81+
<RemoveFile Id='qtxml4dll' On='install' Name='qtxml4.dll' />
7582
</Component>
7683
</Directory>
77-
<!-- <Merge Id="CRT" Language="0" SourceFile="$(var.CrtMergeModule)" DiskId="1" /> -->
84+
<Merge Id="CRT" Language="0" SourceFile="$(var.CrtMergeModule)" DiskId="1" />
7885
</Directory>
7986

8087
<Directory Id='ProgramMenuFolder' Name='Programs' >
@@ -88,27 +95,47 @@
8895
</Directory>
8996

9097
<Feature Id='Complete' Title='$(var.ProductName)' Description='The complete package.'
91-
Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR' >
92-
<Feature Id='MainProgram' Title='Command line interface' Description='Command line tool' Level='1'>
98+
Display='expand' Level='1' AllowAdvertise='no' ConfigurableDirectory='INSTALLDIR' >
99+
<Feature Id='CppcheckCore' Display='hidden' AllowAdvertise='no' Title='Cppcheck-Core' Description='Cppcheck core components' Level='1'>
100+
<ComponentRef Id='cppcheckcore.dll' />
101+
<ComponentRef Id='RegistryEntries' />
102+
<ComponentRef Id='BaseDocs' />
103+
<ComponentRef Id='InnoSetupCleanup' />
104+
</Feature>
105+
<Feature Id='CLI' Title='Command line interface' AllowAdvertise='no' Description='Command line tool' Level='1'>
93106
<ComponentRef Id='cppcheck.exe' />
107+
</Feature>
108+
<Feature Id='GUI' Title='Graphical interface' AllowAdvertise='no' Description='GUI for cppcheck' Level='1'>
94109
<ComponentRef Id='RegistryEntries' />
95110
<ComponentRef Id='GuiExecutable' />
96-
<ComponentRef Id='GuiTranslations' />
111+
<Feature Id='Translations' Title='GUI Translations' AllowAdvertise='no' Description='Translations for cppcheck GUI' Level='1'>
112+
<ComponentRef Id='GuiTranslations' />
113+
</Feature>
97114
<ComponentRef Id='BaseDocs' />
98115
<ComponentRef Id='ProgramMenuDir' />
99-
<ComponentRef Id='InnoSetupCleanup' />
100116
</Feature>
101-
<!--
102-
<Feature Id="CRT" AllowAdvertise="no" Display="hidden" Level="1" Title="Microsoft Visual C++ 2008 Runtime Components ">
117+
<Feature Id="CRT" AllowAdvertise="no" Display="hidden" Level="1" Title="Microsoft Visual C++ 2010 Runtime Components ">
103118
<MergeRef Id="CRT"/>
104119
</Feature>
105-
-->
106120
</Feature>
107121

108122
<MajorUpgrade DowngradeErrorMessage='Downgrade is not allowed'/>
123+
<!--Remove pre 1.57 versions which can't be upgraded with MajorUpgrade-->
124+
<InstallExecuteSequence>
125+
<Custom Action='UninstallOld152' After='InstallFinalize'>NOT Installed</Custom>
126+
<Custom Action='UninstallOld153' After='InstallFinalize'>NOT Installed</Custom>
127+
<Custom Action='UninstallOld154' After='InstallFinalize'>NOT Installed</Custom>
128+
<Custom Action='UninstallOld155' After='InstallFinalize'>NOT Installed</Custom>
129+
<Custom Action='UninstallOld156' After='InstallFinalize'>NOT Installed</Custom>
130+
</InstallExecuteSequence>
131+
<CustomAction Id='UninstallOld152' Directory='SystemFolder' ExeCommand="msiexec.exe /X {836AF028-6EE2-457C-B242-19D61701BAA3} /qn" Execute="immediate" Return="asyncNoWait"/>
132+
<CustomAction Id='UninstallOld153' Directory='SystemFolder' ExeCommand="msiexec.exe /X {42850B7E-CD5F-449A-B6DA-C423156D2ACF} /qn" Execute="immediate" Return="asyncNoWait"/>
133+
<CustomAction Id='UninstallOld154' Directory='SystemFolder' ExeCommand="msiexec.exe /X {7722557B-4B10-4E8F-918A-78FBAEFB09B1} /qn" Execute="immediate" Return="asyncNoWait"/>
134+
<CustomAction Id='UninstallOld155' Directory='SystemFolder' ExeCommand="msiexec.exe /X {211B2B89-3FE0-4F49-88CC-27E283BEC010} /qn" Execute="immediate" Return="asyncNoWait"/>
135+
<CustomAction Id='UninstallOld156' Directory='SystemFolder' ExeCommand="msiexec.exe /X {1CC8C271-A877-4DF0-B1DE-C1B7D83521BC} /qn" Execute="immediate" Return="asyncNoWait"/>
109136

110137
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
111-
<UIRef Id="WixUI_InstallDir"/>
138+
<UIRef Id="WixUI_FeatureTree"/>
112139

113140
<Icon Id='cppcheckgui.exe' SourceFile='$(var.GuiBuildDir)\cppcheck-gui.exe' />
114141

win_installer/productInfo.wxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<Include>
33
<?define ProductName = "Cppcheck 1.57.dev" ?>
44
<?define ProductNameShort = "Cppcheck" ?>
5-
<?define ProductVersion = "1.57.dev" ?>
5+
<?define ProductVersion = "1.56.99" ?>
66

77
<?define ProductManufacturer = "The Cppcheck team" ?>
88
<?define ProductDescription = "Cppcheck is a tool for static analysis of C/C++ code" ?>
99

10-
<?define ProductGUID = "7214EC4C-8F10-4E56-8E99-0B9908E68774" ?>
1110
<?define ProductUpgradeCode = "7E94124C-1CD1-433F-9423-4614E52300DD" ?>
1211
<?define cppcheckGUID = "1c31dd76-07fa-4420-b9b5-5463742d6a48" ?>
12+
<?define cppcheckcoreGUID = "1c31dd76-07fa-4420-b9b5-5463742d6a49" ?>
1313
<?define guiGUID = "D7D3FF8E-1D82-4215-B59B-4715A748C540" ?>
1414
<?define guiTranslationsGUID = "24738151-890D-4fcc-824C-DA7FF63E0D7F" ?>
1515
<?define basedocsGUID = "9F62B23C-CD2B-4826-A567-6AB6F75A2AEA" ?>

win_installer/readme.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ http://wix.sourceforge.net/
66

77
You'll need:
88
- latest Wix (3.6)
9-
- MSBuild (coming with Visual Studio, also with VS 2008 express)
10-
- VS 2008 CRT merge module
9+
- MSBuild (coming with Visual Studio (also with Express edition))
10+
- VS 2010 CRT merge module
1111

1212
Configuring
1313
-----------
@@ -24,14 +24,15 @@ Building installer
2424
------------------
2525

2626
Before building the installer make sure all the components are build:
27+
- LIB dynamic link library (cppcheck-core.dll)
2728
- CLI executable (cppcheck.exe)
2829
- GUI executable (cppcheck-gui.exe)
2930
- GUI translations (*.qm) - generated by the Qt's lrelease -tool
3031

3132
And that runtime files are available:
3233
- Qt runtimes:
33-
QtCore4.dll, QtGui4.dll and QtXml4.dll
34-
- MS CRT merge module (Microsoft_VC90_CRT_x86.msm)
34+
QtCore4.dll and QtGui4.dll
35+
- MS CRT merge module (Microsoft_VC100_CRT_x86.msm)
3536

3637
Build installer by giving this command line in VS command prompt (or run
3738
vcvars32.bat in DOS prompt first to setup environment):

0 commit comments

Comments
 (0)