WiX: Fix condition logic.
authorGerald Combs <gerald@wireshark.org>
Thu, 22 Sep 2016 00:25:32 +0000 (17:25 -0700)
committerGerald Combs <gerald@wireshark.org>
Thu, 22 Sep 2016 00:50:16 +0000 (00:50 +0000)
The condition expressions in g630b646 were incorrect. Fix them. This
also lets us make the error messages more verbose, so do so. Add a hint
about debugging.

Change-Id: I74d4b9cfb1bc9afb23be4d61ac190f90e7048745
Reviewed-on: https://code.wireshark.org/review/17849
Reviewed-by: Gerald Combs <gerald@wireshark.org>
packaging/wix/Prerequisites.wxi

index 49de0c53f3f17ee8cda3a36a374700e096d1c7ab..c50b59afb81cb3bb425eca4d885e186a5c92d26c 100644 (file)
@@ -2,6 +2,10 @@
 <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,
@@ -49,7 +53,6 @@
       </RegistrySearch>
     </Property>
 
-    <!-- XXX It looks like messages are compiled before properties are evaluated.
     <Property Id="NSIS_DISPLAY_NAME_32" Value="Wireshark" Secure="yes">
       <RegistrySearch Id='NsisDisplayNameRegistrySearch32'
           Type='raw'
           Win64='no'/>
     </Property>
 
-    <Condition Message="[NSIS_DISPLAY_NAME_32] is installed in [NSIS_INSTALL_LOCATION_32]. Please uninstall it using Programs and Features.">
-      <![CDATA[Installed OR NSIS_INSTALL_LOCATION_32]]>
+    <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>
-    -->
 
-    <Condition Message="Wireshark was installed using the .exe installer. Please uninstall it using Programs and Features.">
-      <![CDATA[Installed OR NSIS_INSTALL_LOCATION_32]]>
-    </Condition>
-
-    <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>
-
-    <!-- XXX It looks like messages are compiled before properties are evaluated.
     <Property Id="NSIS_INSTALL_LOCATION_64" Secure="yes">
       <RegistrySearch Id='NsisInstallRegistrySearch64'
           Type='raw'
       </RegistrySearch>
     </Property>
 
-    <Condition Message="[NSIS_DISPLAY_NAME_64] is installed in [NSIS_INSTALL_LOCATION_64]. Please uninstall it using Programs and Features.">
-      <![CDATA[Installed OR NSIS_INSTALL_LOCATION_64]]>
-    </Condition>
-    -->
+    <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="Wireshark was installed using the .exe installer. Please uninstall it using Programs and Features.">
-      <![CDATA[Installed OR NSIS_INSTALL_LOCATION_64]]>
+    <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>