WiX: Disable desktop icon and shortcut checkboxes.
authorGerald Combs <gerald@wireshark.org>
Sat, 24 Sep 2016 00:45:39 +0000 (17:45 -0700)
committerMichael Mann <mmann78@netscape.net>
Sat, 24 Sep 2016 02:10:00 +0000 (02:10 +0000)
Enable and disable the Wireshark and Wireshark-gtk desktop icon and
shortcut checkboxes depending on our feature selections to match the
NSIS installer behavior (and make sense).

Set the level of "Fe.WiresharkGTK" to 2 so that it's disabled by default.
This roughly matches the behavior of the NSIS installer.

Note that we can't enable or disable radio buttons.

Change-Id: I1c73f901344e21bd62e67890ce544f644c0cdda6
Reviewed-on: https://code.wireshark.org/review/17898
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
packaging/wix/Features.wxi
packaging/wix/WiresharkOptionsDlg.wxs

index 559d73361e82f17eb7c5a7080f8d2b719d6c25dc..606f5eefee48357e4b7a855ae3655fb86eb5f9ca 100644 (file)
@@ -28,7 +28,7 @@
       <ComponentGroupRef Id="CG.TShark" />
     </Feature>
     <?ifdef GTK_DIR?>
-      <Feature Id="Fe.WiresharkGTK" Title="Wireshark 1" Level="1" AllowAdvertise="yes" Display="expand" Description="The classic user interface.">
+      <Feature Id="Fe.WiresharkGTK" Title="Wireshark 1" Level="2" AllowAdvertise="yes" Display="expand" Description="The classic user interface.">
         <ComponentGroupRef Id="CG.WiresharkGTK" />
         <ComponentGroupRef Id="CG.GTKRequiredDependencies" />
         <ComponentGroupRef Id="CG.GTKSubdirectory" />
index aa89e864f1803167eb89ecc33564e4d30ca782c8..7d17bafc52795904fe49a8b337200b5b64fdb0f2 100644 (file)
@@ -9,16 +9,39 @@
                 <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Select Additional Tasks" />
 
                 <Control Id="Shortcuts" Type="GroupBox" X="15" Y="50" Width="250" Height="125" Text="Create Shortcuts"/>
-                <Control Id="WiresharkStartMenuCB" Type="CheckBox" X="20" Y="65" Width="180" Height="15" CheckBoxValue="1"  Property="WIRESHARK_START_MENU" Text="Wireshark Start Menu Item" />
-                <Control Id="WiresharkDesktopIconCB" Type="CheckBox" X="20" Y="83" Width="180" Height="15" CheckBoxValue="1" Property="WIRESHARK_DESKTOP_ICON" Text="Wireshark Desktop Icon" />
-                <Control Id="WiresharkQuickLaunchIconCB" Type="CheckBox" X="20" Y="101" Width="180" Height="15" CheckBoxValue="1" Property="WIRESHARK_QUICK_LAUNCH_ICON" Text="Wireshark Quick Launch Icon" />
-                <Control Id="WiresharkLegacyStartMenuCB" Type="CheckBox" X="20" Y="117" Width="180" Height="15" CheckBoxValue="1" Property="WIRESHARK_LEGACY_START_MENU" Text="Wireshark Legacy Start Menu Item" />
-                <Control Id="WiresharkLegacyDesktopIconCB" Type="CheckBox" X="20" Y="135" Width="180" Height="15" CheckBoxValue="1" Property="WIRESHARK_LEGACY_DESKTOP_ICON" Text="Wireshark Legacy Desktop Icon" />
-                <Control Id="WiresharkLegacyQuickLaunchIconCB" Type="CheckBox" X="20" Y="153" Width="180" Height="15" CheckBoxValue="1" Property="WIRESHARK_LEGACY_QUICK_LAUNCH_ICON" Text="Wireshark Legacy Quick Launch Icon" />
+                <Control Id="WiresharkStartMenuCB" Type="CheckBox" X="20" Y="65" Width="180" Height="15" CheckBoxValue="1"  Property="WIRESHARK_START_MENU" Text="Wireshark Start Menu Item">
+                  <Condition Action="enable"><![CDATA[&Fe.Wireshark = 3]]></Condition>
+                  <Condition Action="disable"><![CDATA[&Fe.Wireshark <> 3]]></Condition>
+                </Control>
+                <Control Id="WiresharkDesktopIconCB" Type="CheckBox" X="20" Y="83" Width="180" Height="15" CheckBoxValue="1" Property="WIRESHARK_DESKTOP_ICON" Text="Wireshark Desktop Icon">
+                  <Condition Action="enable"><![CDATA[&Fe.Wireshark = 3]]></Condition>
+                  <Condition Action="disable"><![CDATA[&Fe.Wireshark <> 3]]></Condition>
+                </Control>
+                <Control Id="WiresharkQuickLaunchIconCB" Type="CheckBox" X="20" Y="101" Width="180" Height="15" CheckBoxValue="1" Property="WIRESHARK_QUICK_LAUNCH_ICON" Text="Wireshark Quick Launch Icon">
+                  <Condition Action="enable"><![CDATA[&Fe.Wireshark = 3]]></Condition>
+                  <Condition Action="disable"><![CDATA[&Fe.Wireshark <> 3]]></Condition>
+                </Control>
+
+                <Control Id="WiresharkLegacyStartMenuCB" Type="CheckBox" X="20" Y="117" Width="180" Height="15" CheckBoxValue="1" Property="WIRESHARK_LEGACY_START_MENU" Text="Wireshark Legacy Start Menu Item">
+                  <Condition Action="enable"><![CDATA[&Fe.WiresharkGTK = 3]]></Condition>
+                  <Condition Action="disable"><![CDATA[&Fe.WiresharkGTK <> 3]]></Condition>
+                </Control>
+                <Control Id="WiresharkLegacyDesktopIconCB" Type="CheckBox" X="20" Y="135" Width="180" Height="15" CheckBoxValue="1" Property="WIRESHARK_LEGACY_DESKTOP_ICON" Text="Wireshark Legacy Desktop Icon">
+                  <Condition Action="enable"><![CDATA[&Fe.WiresharkGTK = 3]]></Condition>
+                  <Condition Action="disable"><![CDATA[&Fe.WiresharkGTK <> 3]]></Condition>
+                </Control>
+                <Control Id="WiresharkLegacyQuickLaunchIconCB" Type="CheckBox" X="20" Y="153" Width="180" Height="15" CheckBoxValue="1" Property="WIRESHARK_LEGACY_QUICK_LAUNCH_ICON" Text="Wireshark Legacy Quick Launch Icon">
+                  <Condition Action="enable"><![CDATA[&Fe.WiresharkGTK = 3]]></Condition>
+                  <Condition Action="disable"><![CDATA[&Fe.WiresharkGTK <> 3]]></Condition>
+                </Control>
 
                 <Control Id="FileExtensions" Type="GroupBox" X="15" Y="180" Width="250" Height="100" Text="File Extensions"/>
                 <Control Id="FileExtensionsRadio" Type="RadioButtonGroup"  X="20" Y="190" Width="235" Height="50" Property="WIRESHARK_FILE_EXTENSIONS">
                   <RadioButtonGroup Property="WIRESHARK_FILE_EXTENSIONS">
+                    <!--
+                      It doesn't look like RadioButtons can be enabled or disabled:
+                      http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/disabling-a-single-RadioButton-td694368.html
+                    -->
                     <RadioButton Value="0" X="5" Y="5" Height="15" Width="235" Text="Associate trace file extensions to Wireshark" />
                     <RadioButton Value="1" X="5" Y="20" Height="15" Width="235" Text="Associate trace file extensions to Wireshark Legacy" />
                     <RadioButton Value="2" X="5" Y="35" Height="15" Width="235" Text="None" />
@@ -36,4 +59,4 @@
             </Dialog>
         </UI>
     </Fragment>
-</Wix>
\ No newline at end of file
+</Wix>