Browse Source

Mac uninstall script fixes.

Adam Ierymenko 11 years ago
parent
commit
191d204674
3 changed files with 212 additions and 179 deletions
  1. 1 0
      .gitignore
  2. 195 172
      ZeroTierUI/networkwidget.ui
  3. 16 7
      ext/installfiles/mac/uninstall.sh

+ 1 - 0
.gitignore

@@ -35,3 +35,4 @@ mac-tap/tuntap/tap.kext
 /zt1-*-install
 /zt1-*-install
 /file2lz4c
 /file2lz4c
 .qmake.stash
 .qmake.stash
+*.autosave

+ 195 - 172
ZeroTierUI/networkwidget.ui

@@ -40,28 +40,7 @@
    </property>
    </property>
    <item>
    <item>
     <widget class="QWidget" name="leftWidget" native="true">
     <widget class="QWidget" name="leftWidget" native="true">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <layout class="QFormLayout" name="formLayout">
-      <property name="fieldGrowthPolicy">
-       <enum>QFormLayout::ExpandingFieldsGrow</enum>
-      </property>
-      <property name="labelAlignment">
-       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-      </property>
-      <property name="formAlignment">
-       <set>Qt::AlignHCenter|Qt::AlignTop</set>
-      </property>
-      <property name="horizontalSpacing">
-       <number>6</number>
-      </property>
-      <property name="verticalSpacing">
-       <number>2</number>
-      </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
       <property name="leftMargin">
       <property name="leftMargin">
        <number>0</number>
        <number>0</number>
       </property>
       </property>
@@ -74,152 +53,61 @@
       <property name="bottomMargin">
       <property name="bottomMargin">
        <number>0</number>
        <number>0</number>
       </property>
       </property>
-      <item row="2" column="0">
-       <widget class="QLabel" name="label_2">
-        <property name="text">
-         <string>Network ID:</string>
-        </property>
-        <property name="textFormat">
-         <enum>Qt::PlainText</enum>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="1">
-       <widget class="QPushButton" name="networkIdPushButton">
-        <property name="font">
-         <font>
-          <weight>75</weight>
-          <bold>true</bold>
-         </font>
-        </property>
-        <property name="toolTip">
-         <string>Click to copy network ID to clipboard.</string>
-        </property>
-        <property name="styleSheet">
-         <string notr="true">QPushButton {
-	border: 0;
-	padding: 0;
-	margin: 0;
-	text-align: left;
-	background-color: transparent;
-}
-
-QPushButton:focus {
-	background-color: rgba(0,0,0,25);
-}
-
-QPushButton:hover {
-	background-color: rgba(0,0,0,25);
-}
-</string>
-        </property>
-        <property name="text">
-         <string>0000000000000000</string>
-        </property>
-        <property name="flat">
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="0">
-       <widget class="QLabel" name="label_3">
-        <property name="text">
-         <string>Name:</string>
-        </property>
-        <property name="textFormat">
-         <enum>Qt::PlainText</enum>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="1">
+      <item>
        <widget class="QLabel" name="nameLabel">
        <widget class="QLabel" name="nameLabel">
-        <property name="font">
-         <font>
-          <weight>75</weight>
-          <bold>true</bold>
-         </font>
-        </property>
-        <property name="text">
-         <string>?</string>
-        </property>
-        <property name="textFormat">
-         <enum>Qt::PlainText</enum>
-        </property>
-       </widget>
-      </item>
-      <item row="4" column="0">
-       <widget class="QLabel" name="label_5">
-        <property name="text">
-         <string>Type:</string>
-        </property>
-        <property name="textFormat">
-         <enum>Qt::PlainText</enum>
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
         </property>
         </property>
-       </widget>
-      </item>
-      <item row="4" column="1">
-       <widget class="QLabel" name="networkTypeLabel">
         <property name="font">
         <property name="font">
          <font>
          <font>
-          <weight>75</weight>
-          <bold>true</bold>
+          <pointsize>15</pointsize>
          </font>
          </font>
         </property>
         </property>
-        <property name="text">
-         <string>?</string>
-        </property>
-        <property name="textFormat">
-         <enum>Qt::PlainText</enum>
-        </property>
-       </widget>
-      </item>
-      <item row="5" column="0">
-       <widget class="QLabel" name="label">
-        <property name="text">
-         <string>Status:</string>
-        </property>
-        <property name="textFormat">
-         <enum>Qt::PlainText</enum>
+        <property name="styleSheet">
+         <string notr="true">background-color: rgba(0,0,0,25);
+padding: 0.25em;
+margin: 0;</string>
         </property>
         </property>
-       </widget>
-      </item>
-      <item row="6" column="0">
-       <widget class="QLabel" name="label_4">
         <property name="text">
         <property name="text">
-         <string>Device:</string>
+         <string>networkname</string>
         </property>
         </property>
         <property name="textFormat">
         <property name="textFormat">
          <enum>Qt::PlainText</enum>
          <enum>Qt::PlainText</enum>
         </property>
         </property>
-       </widget>
-      </item>
-      <item row="6" column="1">
-       <widget class="QLabel" name="deviceLabel">
-        <property name="font">
-         <font>
-          <weight>75</weight>
-          <bold>true</bold>
-         </font>
-        </property>
-        <property name="text">
-         <string>?</string>
+        <property name="alignment">
+         <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
         </property>
         </property>
-        <property name="textFormat">
-         <enum>Qt::PlainText</enum>
+        <property name="textInteractionFlags">
+         <set>Qt::NoTextInteraction</set>
         </property>
         </property>
        </widget>
        </widget>
       </item>
       </item>
-      <item row="5" column="1">
-       <widget class="QWidget" name="widget" native="true">
+      <item>
+       <widget class="QWidget" name="networkStatsWidget" native="true">
         <property name="sizePolicy">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
           <horstretch>0</horstretch>
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
          </sizepolicy>
         </property>
         </property>
-        <layout class="QHBoxLayout" name="horizontalLayout_3">
-         <property name="spacing">
-          <number>12</number>
+        <layout class="QFormLayout" name="formLayout">
+         <property name="fieldGrowthPolicy">
+          <enum>QFormLayout::ExpandingFieldsGrow</enum>
+         </property>
+         <property name="labelAlignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="formAlignment">
+          <set>Qt::AlignHCenter|Qt::AlignTop</set>
+         </property>
+         <property name="horizontalSpacing">
+          <number>6</number>
+         </property>
+         <property name="verticalSpacing">
+          <number>2</number>
          </property>
          </property>
          <property name="leftMargin">
          <property name="leftMargin">
           <number>0</number>
           <number>0</number>
@@ -233,14 +121,65 @@ QPushButton:hover {
          <property name="bottomMargin">
          <property name="bottomMargin">
           <number>0</number>
           <number>0</number>
          </property>
          </property>
-         <item>
-          <widget class="QLabel" name="statusLabel">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
+         <item row="2" column="0">
+          <widget class="QLabel" name="label_2">
+           <property name="text">
+            <string>Network ID:</string>
+           </property>
+           <property name="textFormat">
+            <enum>Qt::PlainText</enum>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="1">
+          <widget class="QPushButton" name="networkIdPushButton">
+           <property name="font">
+            <font>
+             <weight>75</weight>
+             <bold>true</bold>
+            </font>
+           </property>
+           <property name="toolTip">
+            <string>Click to copy network ID to clipboard.</string>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">QPushButton {
+	border: 0;
+	padding: 0;
+	margin: 0;
+	text-align: left;
+	background-color: transparent;
+}
+
+QPushButton:focus {
+	background-color: rgba(0,0,0,25);
+}
+
+QPushButton:hover {
+	background-color: rgba(0,0,0,25);
+}
+</string>
+           </property>
+           <property name="text">
+            <string>0000000000000000</string>
+           </property>
+           <property name="flat">
+            <bool>true</bool>
            </property>
            </property>
+          </widget>
+         </item>
+         <item row="3" column="0">
+          <widget class="QLabel" name="label_5">
+           <property name="text">
+            <string>Type:</string>
+           </property>
+           <property name="textFormat">
+            <enum>Qt::PlainText</enum>
+           </property>
+          </widget>
+         </item>
+         <item row="3" column="1">
+          <widget class="QLabel" name="networkTypeLabel">
            <property name="font">
            <property name="font">
             <font>
             <font>
              <weight>75</weight>
              <weight>75</weight>
@@ -255,40 +194,125 @@ QPushButton:hover {
            </property>
            </property>
           </widget>
           </widget>
          </item>
          </item>
-         <item>
-          <widget class="QLabel" name="ageLabel">
+         <item row="4" column="0">
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Status:</string>
+           </property>
+           <property name="textFormat">
+            <enum>Qt::PlainText</enum>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="1">
+          <widget class="QWidget" name="widget" native="true">
            <property name="sizePolicy">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
             <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
              <horstretch>0</horstretch>
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
             </sizepolicy>
            </property>
            </property>
+           <layout class="QHBoxLayout" name="horizontalLayout_3">
+            <property name="spacing">
+             <number>12</number>
+            </property>
+            <property name="leftMargin">
+             <number>0</number>
+            </property>
+            <property name="topMargin">
+             <number>0</number>
+            </property>
+            <property name="rightMargin">
+             <number>0</number>
+            </property>
+            <property name="bottomMargin">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QLabel" name="statusLabel">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="font">
+               <font>
+                <weight>75</weight>
+                <bold>true</bold>
+               </font>
+              </property>
+              <property name="text">
+               <string>?</string>
+              </property>
+              <property name="textFormat">
+               <enum>Qt::PlainText</enum>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLabel" name="ageLabel">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="font">
+               <font>
+                <pointsize>8</pointsize>
+               </font>
+              </property>
+              <property name="text">
+               <string>(configuration is 0 seconds old)</string>
+              </property>
+              <property name="textFormat">
+               <enum>Qt::PlainText</enum>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_2">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>40</width>
+                <height>1</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+           </layout>
+          </widget>
+         </item>
+         <item row="5" column="0">
+          <widget class="QLabel" name="label_4">
+           <property name="text">
+            <string>Device:</string>
+           </property>
+           <property name="textFormat">
+            <enum>Qt::PlainText</enum>
+           </property>
+          </widget>
+         </item>
+         <item row="5" column="1">
+          <widget class="QLabel" name="deviceLabel">
            <property name="font">
            <property name="font">
             <font>
             <font>
-             <pointsize>8</pointsize>
+             <weight>75</weight>
+             <bold>true</bold>
             </font>
             </font>
            </property>
            </property>
            <property name="text">
            <property name="text">
-            <string>(configuration is 0 seconds old)</string>
+            <string>?</string>
            </property>
            </property>
            <property name="textFormat">
            <property name="textFormat">
             <enum>Qt::PlainText</enum>
             <enum>Qt::PlainText</enum>
            </property>
            </property>
           </widget>
           </widget>
          </item>
          </item>
-         <item>
-          <spacer name="horizontalSpacer_2">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>1</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
         </layout>
         </layout>
        </widget>
        </widget>
       </item>
       </item>
@@ -455,7 +479,6 @@ QListWidget:hover {
   </layout>
   </layout>
  </widget>
  </widget>
  <tabstops>
  <tabstops>
-  <tabstop>networkIdPushButton</tabstop>
   <tabstop>ipListWidget</tabstop>
   <tabstop>ipListWidget</tabstop>
   <tabstop>leaveNetworkButton</tabstop>
   <tabstop>leaveNetworkButton</tabstop>
  </tabstops>
  </tabstops>

+ 16 - 7
ext/installfiles/mac/uninstall.sh

@@ -10,11 +10,20 @@ if [ "$UID" -ne 0 ]; then
 	exit 1
 	exit 1
 fi
 fi
 
 
-echo
+# Run with -q to be quieter and run without delay
+quickAndQuiet=0
+if [ "$1" = "-q" ]; then
+  quickAndQuiet=1
+	echo() { :; }
+fi
 
 
-echo "This will uninstall ZeroTier One, hit CTRL+C to abort."
-echo "Waiting 5 seconds..."
-sleep 5
+echo
+  
+if [ $quickAndQuiet -eq 0 ]; then  
+  echo "This will uninstall ZeroTier One, hit CTRL+C to abort."
+  echo "Waiting 5 seconds..."
+  sleep 5
+fi
 
 
 echo "Unloading and removing LaunchDaemons item..."
 echo "Unloading and removing LaunchDaemons item..."
 launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist
 launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist
@@ -27,11 +36,11 @@ killall -KILL zerotier-one >>/dev/null 2>&1
 sleep 1
 sleep 1
 
 
 echo "Unloading kernel extension..."
 echo "Unloading kernel extension..."
-kextunload "$ztpath/tap.kext"
+kextunload "$ztpath/tap.kext" >>/dev/null 2>&1
 
 
 echo "Erasing UI app, binary, and support files..."
 echo "Erasing UI app, binary, and support files..."
-cd $ztpath
-rm -rfv "$ztapp" zerotier-one *.persist authtoken.secret identity.public *.log *.pid *.kext *.sh
+cd "$ztpath"
+rm -rfv "$ztapp" zerotier-one *.persist authtoken.secret identity.public *.log *.pid *.kext *.sh networks.d updates.d shutdownIfUnreadable
 
 
 echo "Done."
 echo "Done."
 echo
 echo