summaryrefslogtreecommitdiffstats
path: root/packaging/wix/Prerequisites.wxi
blob: aa03a45fc569d1c2212c2203803bb838cae47552 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?xml version="1.0" encoding="utf-8"?>
<Include xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">

  <!-- Check for required dependencies here -->
  <!--
    You can debug the logic below (and lots of other things) by running
      msiexec /i packaging\wix\Wireshark-xxx.msi /l*v msilog.txt
  -->
  <Fragment>

    <!-- Do not remove: The contents of this "fragment" will not be included in the project,
         unless we reference at least one item defined within it.
         This "IncludePrerequisites" property is referenced in the "Product" element,
         to ensure the entire fragment is included. -->
    <Property Id="IncludePrerequisites">1</Property>

    <!-- This should match the following:
         - The NTDDI_VERSION and _WIN32_WINNT parts of cmakeconfig.h.in
         - The <compatibility><application> section in image\wireshark.exe.manifest.in
         - The WinVer parts of packaging\nsis\wireshark.nsi
    -->
    <Condition Message="Windows 2000 is no longer supported. Please install $(var.WiresharkName) 1.2 or 1.0 instead.">
      <![CDATA[Installed OR (VersionNT < 500) OR (VersionNT > 500)]]>
    </Condition>

    <Condition Message="WindowsXP is no longer supported. Please install $(var.WiresharkName) 1.12 or 1.10 instead.">
      <![CDATA[Installed OR (VersionNT < 501) OR (VersionNT > 501)]]>
    </Condition>

    <Condition Message="Windows Server 2003 is no longer supported. Please install $(var.WiresharkName) 1.12 or 1.10 instead.">
      <![CDATA[Installed OR (VersionNT < 502) OR (VersionNT > 502)]]>
    </Condition>

    <Condition Message="Windows Vista and Server 2008 are no longer supported. Please install $(var.WiresharkName) 2.2 instead.">
      <![CDATA[Installed OR (VersionNT < 600) OR (VersionNT > 600)]]>
    </Condition>

    <Condition Message="Windows 7, 8, 8.1, Server 2008R2, and Server 2012 are no longer supported. Please install $(var.WiresharkName) 4.0 instead.">
      <![CDATA[Installed OR (VersionNT < 601) OR (VersionNT > 602)]]>
    </Condition>

    <Condition Message="$(var.WiresharkName)$(var.WiresharkVersion) is only supported on Windows 10, Windows Server 2016, or higher.">
      <![CDATA[Installed OR (VersionNT >= 603)]]>
    </Condition>

<!--
  NSIS package uninstallation. The NSIS installer writes a bunch of keys to
  'HKEY_LOCAL_MACHINE\SOFTWARE\{Wow6432Node\,}Microsoft\Windows\CurrentVersion\Uninstall\Wireshark'.
  See the 'WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}"' statements
  starting at around line 780 in nsis\wireshark.nsi for a complete list.

  For now look for 'InstallLocation' and cancel the installation if
  it's defined and exists. Next steps:
  - look for 'QuietUninstallString' and offer to run it.
  - Show properties in condition messages as described below.
-->

    <Property Id="NSIS_INSTALL_LOCATION_32" Secure="yes">
      <RegistrySearch Id='NsisInstallRegistrySearch32'
          Type='raw'
          Root='HKLM'
          Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark'
          Name='InstallLocation'
          Win64='no'>
        <DirectorySearch Id='NsisInstallDirectorySearch32' AssignToProperty='yes'/>
      </RegistrySearch>
    </Property>

    <Property Id="NSIS_DISPLAY_NAME_32" Value="Wireshark" Secure="yes">
      <RegistrySearch Id='NsisDisplayNameRegistrySearch32'
          Type='raw'
          Root='HKLM'
          Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark'
          Name='DisplayName'
          Win64='no'/>
    </Property>

    <Condition Message="[NSIS_DISPLAY_NAME_32] was installed in [NSIS_INSTALL_LOCATION_32] using the .exe installer. Please uninstall it using Programs and Features.">
      <![CDATA[Installed OR NOT NSIS_INSTALL_LOCATION_32]]>
    </Condition>

    <Property Id="NSIS_INSTALL_LOCATION_64" Secure="yes">
      <RegistrySearch Id='NsisInstallRegistrySearch64'
          Type='raw'
          Root='HKLM'
          Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark'
          Name='InstallLocation'
          Win64='yes'>
        <DirectorySearch Id='NsisInstallDirectorySearch64' AssignToProperty='yes'/>
      </RegistrySearch>
    </Property>

    <Property Id="NSIS_DISPLAY_NAME_64" Value="Wireshark" Secure="yes">
      <RegistrySearch Id='NsisDisplayNameRegistrySearch64'
          Type='raw'
          Root='HKLM'
          Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark'
          Name='DisplayName'
          Win64='yes'/>
    </Property>

    <Condition Message="[NSIS_DISPLAY_NAME_64] was installed in [NSIS_INSTALL_LOCATION_64] using the .exe installer. Please uninstall it using Programs and Features.">
      <![CDATA[Installed OR NOT NSIS_INSTALL_LOCATION_64]]>
    </Condition>

  </Fragment>
</Include>