summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ZeroTierUI/aboutwindow.cpp5
-rw-r--r--ZeroTierUI/aboutwindow.ui7
-rw-r--r--ZeroTierUI/helpers/mac/ZeroTier One (Install).app/Contents/Resources/Scripts/main.scptbin3598 -> 3670 bytes
-rw-r--r--ZeroTierUI/installdialog.cpp14
-rw-r--r--ZeroTierUI/mainwindow.cpp29
-rwxr-xr-xattic/make-official-release.sh11
-rwxr-xr-xattic/submit-official-release.sh5
-rw-r--r--ext/installfiles/mac/install.tmpl.sh2
-rwxr-xr-xext/installfiles/mac/launch.sh2
-rwxr-xr-xext/installfiles/mac/uninstall.sh2
-rw-r--r--node/Defaults.cpp4
11 files changed, 38 insertions, 43 deletions
diff --git a/ZeroTierUI/aboutwindow.cpp b/ZeroTierUI/aboutwindow.cpp
index b5e9454f..1fac8368 100644
--- a/ZeroTierUI/aboutwindow.cpp
+++ b/ZeroTierUI/aboutwindow.cpp
@@ -2,13 +2,16 @@
#include "ui_aboutwindow.h"
#include <QMessageBox>
-#include "../node/Defaults.hpp"
+
+#include "../node/Node.hpp"
AboutWindow::AboutWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::AboutWindow)
{
ui->setupUi(this);
+
+ ui->aboutTextLabel->setText(QString("ZeroTier One\nVersion ")+ZeroTier::Node::versionString()+"\nQt Graphical User Interface\n\n(c)2011-2014 ZeroTier Networks LLC\n\nReleased under the terms of the GNU\nGeneral Public License v3.0, see: http://gplv3.fsf.org for terms.\n\nAuthor(s): Adam Ierymenko");
}
AboutWindow::~AboutWindow()
diff --git a/ZeroTierUI/aboutwindow.ui b/ZeroTierUI/aboutwindow.ui
index ae758558..e32dfca3 100644
--- a/ZeroTierUI/aboutwindow.ui
+++ b/ZeroTierUI/aboutwindow.ui
@@ -151,13 +151,6 @@
<bold>false</bold>
</font>
</property>
- <property name="text">
- <string>ZeroTier One GUI
-(c)2012-2013 ZeroTier Networks LLC
-
-Author(s): Adam Ierymenko
-Version: 1.0</string>
- </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
diff --git a/ZeroTierUI/helpers/mac/ZeroTier One (Install).app/Contents/Resources/Scripts/main.scpt b/ZeroTierUI/helpers/mac/ZeroTier One (Install).app/Contents/Resources/Scripts/main.scpt
index 8ac66d41..3ebf442f 100644
--- a/ZeroTierUI/helpers/mac/ZeroTier One (Install).app/Contents/Resources/Scripts/main.scpt
+++ b/ZeroTierUI/helpers/mac/ZeroTier One (Install).app/Contents/Resources/Scripts/main.scpt
Binary files differ
diff --git a/ZeroTierUI/installdialog.cpp b/ZeroTierUI/installdialog.cpp
index 2f453e3d..06581856 100644
--- a/ZeroTierUI/installdialog.cpp
+++ b/ZeroTierUI/installdialog.cpp
@@ -106,16 +106,14 @@ void InstallDialog::on_networkReply(QNetworkReply *reply)
QApplication::exit(1);
return;
}
- QProcess::execute(installHelperPath,QStringList());
- if (!QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one")) {
- QMessageBox::critical(this,"Installation Failed","Installation failed. Are you sure you entered your password correctly?",QMessageBox::Ok,QMessageBox::NoButton);
- QApplication::exit(1);
- return;
- }
+ // Terminate the GUI and execute the install helper instead
+ ::execl(installHelperPath.toStdString().c_str(),installHelperPath.toStdString().c_str(),(const char *)0);
+
+ // We only make it here if execl() failed
+ QMessageBox::critical(this,"Unable to Locate Helper","Unable to locate install helper, cannot install service.",QMessageBox::Ok,QMessageBox::NoButton);
+ QApplication::exit(1);
- ((QMainWindow *)this->parent())->setHidden(false);
- this->close();
return;
#endif
} break;
diff --git a/ZeroTierUI/mainwindow.cpp b/ZeroTierUI/mainwindow.cpp
index f7d7e399..003b8651 100644
--- a/ZeroTierUI/mainwindow.cpp
+++ b/ZeroTierUI/mainwindow.cpp
@@ -69,6 +69,19 @@ MainWindow::MainWindow(QWidget *parent) :
QWidgetList widgets = this->findChildren<QWidget*>();
foreach(QWidget* widget, widgets)
widget->setAttribute(Qt::WA_MacShowFocusRect,false);
+
+#ifdef __APPLE__
+ if (!QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one")) {
+ // If the service is not installed, download the installer and run it
+ // for the first time.
+ this->setEnabled(false);
+ InstallDialog *id = new InstallDialog(this);
+ id->setModal(true);
+ id->show();
+ this->setHidden(true);
+ return;
+ }
+#endif
}
MainWindow::~MainWindow()
@@ -90,21 +103,15 @@ void MainWindow::timerEvent(QTimerEvent *event)
std::string authToken;
if (!ZeroTier::Utils::readFile(ZeroTier::Node::LocalClient::authTokenDefaultUserPath().c_str(),authToken)) {
#ifdef __APPLE__
- //if (QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one")) {
- if (false) {
+ if (QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one")) {
// Run the little AppleScript hack that asks for admin credentials and
// then installs the auth token file in the current user's home.
+ QMessageBox::information(this,"Authorization Required","You must authenticate to authorize this user to\nadministrate ZeroTier One on this computer.\n\n(This only needs to be done once.)",QMessageBox::Ok,QMessageBox::NoButton);
QString authHelperPath(QCoreApplication::applicationDirPath() + "/../Resources/helpers/mac/ZeroTier One (Authenticate).app/Contents/MacOS/applet");
if (!QFile::exists(authHelperPath)) {
- // Allow this to also work from the source tree if it's run from there.
- // This is for debugging purposes and shouldn't harm the live release
- // in any way.
- authHelperPath = QCoreApplication::applicationDirPath() + "/../../../../ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/MacOS/applet";
- if (!QFile::exists(authHelperPath)) {
- QMessageBox::critical(this,"Unable to Locate Helper","Unable to locate authorization helper, cannot obtain authentication token.",QMessageBox::Ok,QMessageBox::NoButton);
- QApplication::exit(1);
- return;
- }
+ QMessageBox::critical(this,"Unable to Locate Helper","Unable to locate authorization helper, cannot obtain authentication token.",QMessageBox::Ok,QMessageBox::NoButton);
+ QApplication::exit(1);
+ return;
}
QProcess::execute(authHelperPath,QStringList());
} else {
diff --git a/attic/make-official-release.sh b/attic/make-official-release.sh
index 293e97ad..2b74f30c 100755
--- a/attic/make-official-release.sh
+++ b/attic/make-official-release.sh
@@ -18,8 +18,8 @@
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
-if [ "$#" -ne 2 ]; then
- echo "Usage: $0 <path to secret signing identity> <path to destination folder for .nfo and installer>"
+if [ "$#" -ne 1 ]; then
+ echo "Usage: $0 <path to secret signing identity>"
exit 1
fi
@@ -29,16 +29,11 @@ if [ ! -e zerotier-idtool ]; then
fi
secret="$1"
-dest="$2"
if [ ! -e "$secret" ]; then
echo "Can't find $secret"
exit 1
fi
-if [ ! -d "$dest" ]; then
- echo "Can't find $dest directory"
- exit 1
-fi
for inst in `ls ZeroTierOneInstaller-*-*-*_*_*`; do
echo "Found installer: $inst"
@@ -51,6 +46,4 @@ for inst in `ls ZeroTierOneInstaller-*-*-*_*_*`; do
echo "signedBy=`cat $secret | cut -d : -f 1`" >>"$nfo"
echo "ed25519=`./zerotier-idtool sign $secret $inst`" >>"$nfo"
echo "url=http://download.zerotier.com/$inst" >>"$nfo"
- cp $inst $nfo $dest
- rm -f $nfo
done
diff --git a/attic/submit-official-release.sh b/attic/submit-official-release.sh
new file mode 100755
index 00000000..5c54ab7f
--- /dev/null
+++ b/attic/submit-official-release.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# Completely useless to outsiders. :)
+
+scp ZeroTierOneInstaller-*-*-*_*_* nyarlathotep.zerotier.com:/www/download.zerotier.com/htdocs
diff --git a/ext/installfiles/mac/install.tmpl.sh b/ext/installfiles/mac/install.tmpl.sh
index 87addba5..e65e71c1 100644
--- a/ext/installfiles/mac/install.tmpl.sh
+++ b/ext/installfiles/mac/install.tmpl.sh
@@ -23,7 +23,7 @@ if [ $dryRun -gt 0 ]; then
fi
zthome="/Library/Application Support/ZeroTier/One"
-ztapp=`mdfind kMDItemCFBundleIdentifier == 'com.zerotier.ZeroTierOne'`
+ztapp=`mdfind kMDItemCFBundleIdentifier == 'com.zerotier.ZeroTierOne' | sort | head -n 1`
if [ ! -d "$ztapp" ]; then
ztapp="/Applications/ZeroTier One.app"
fi
diff --git a/ext/installfiles/mac/launch.sh b/ext/installfiles/mac/launch.sh
index dc7c2229..371b3f5d 100755
--- a/ext/installfiles/mac/launch.sh
+++ b/ext/installfiles/mac/launch.sh
@@ -2,7 +2,7 @@
zthome="/Library/Application Support/ZeroTier/One"
export PATH="/bin:/usr/bin:/sbin:/usr/sbin:$zthome"
-ztapp=`mdfind kMDItemCFBundleIdentifier == 'com.zerotier.ZeroTierOne'`
+ztapp=`mdfind kMDItemCFBundleIdentifier == 'com.zerotier.ZeroTierOne' | sort | head -n 1`
# Clean all other stuff off the system if the user has trashed the .app
if [ -z "$ztapp" -o ! -d "$ztapp" ]; then
diff --git a/ext/installfiles/mac/uninstall.sh b/ext/installfiles/mac/uninstall.sh
index 73eac91d..d1e9a513 100755
--- a/ext/installfiles/mac/uninstall.sh
+++ b/ext/installfiles/mac/uninstall.sh
@@ -3,7 +3,7 @@
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
zthome="/Library/Application Support/ZeroTier/One"
-ztapp=`mdfind kMDItemCFBundleIdentifier == 'com.zerotier.ZeroTierOne'`
+ztapp=`mdfind kMDItemCFBundleIdentifier == 'com.zerotier.ZeroTierOne' | sort | head -n 1`
if [ "$UID" -ne 0 ]; then
echo "Must be run as root; try: sudo $0"
diff --git a/node/Defaults.cpp b/node/Defaults.cpp
index 41ff540b..3a8defba 100644
--- a/node/Defaults.cpp
+++ b/node/Defaults.cpp
@@ -132,13 +132,9 @@ static inline const char *_mkUpdateUrl()
#endif
#ifdef __APPLE__
-#ifdef TARGET_OS_IPHONE
- // TODO
-#else
return "http://download.zerotier.com/ZeroTierOneInstaller-mac-combined-LATEST.nfo";
#define GOT_UPDATE_URL
#endif
-#endif
// TODO: Windows