mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-03 03:36:41 +00:00
Mac install fixes, more internal use scripts.
This commit is contained in:
parent
60731e6d02
commit
3482d836ae
@ -2,13 +2,16 @@
|
|||||||
#include "ui_aboutwindow.h"
|
#include "ui_aboutwindow.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include "../node/Defaults.hpp"
|
|
||||||
|
#include "../node/Node.hpp"
|
||||||
|
|
||||||
AboutWindow::AboutWindow(QWidget *parent) :
|
AboutWindow::AboutWindow(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::AboutWindow)
|
ui(new Ui::AboutWindow)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
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()
|
AboutWindow::~AboutWindow()
|
||||||
|
@ -151,13 +151,6 @@
|
|||||||
<bold>false</bold>
|
<bold>false</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</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">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
Binary file not shown.
@ -106,16 +106,14 @@ void InstallDialog::on_networkReply(QNetworkReply *reply)
|
|||||||
QApplication::exit(1);
|
QApplication::exit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QProcess::execute(installHelperPath,QStringList());
|
|
||||||
|
|
||||||
if (!QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one")) {
|
// Terminate the GUI and execute the install helper instead
|
||||||
QMessageBox::critical(this,"Installation Failed","Installation failed. Are you sure you entered your password correctly?",QMessageBox::Ok,QMessageBox::NoButton);
|
::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);
|
QApplication::exit(1);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
((QMainWindow *)this->parent())->setHidden(false);
|
|
||||||
this->close();
|
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
} break;
|
} break;
|
||||||
|
@ -69,6 +69,19 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
QWidgetList widgets = this->findChildren<QWidget*>();
|
QWidgetList widgets = this->findChildren<QWidget*>();
|
||||||
foreach(QWidget* widget, widgets)
|
foreach(QWidget* widget, widgets)
|
||||||
widget->setAttribute(Qt::WA_MacShowFocusRect,false);
|
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()
|
MainWindow::~MainWindow()
|
||||||
@ -90,22 +103,16 @@ void MainWindow::timerEvent(QTimerEvent *event)
|
|||||||
std::string authToken;
|
std::string authToken;
|
||||||
if (!ZeroTier::Utils::readFile(ZeroTier::Node::LocalClient::authTokenDefaultUserPath().c_str(),authToken)) {
|
if (!ZeroTier::Utils::readFile(ZeroTier::Node::LocalClient::authTokenDefaultUserPath().c_str(),authToken)) {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
//if (QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one")) {
|
if (QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one")) {
|
||||||
if (false) {
|
|
||||||
// Run the little AppleScript hack that asks for admin credentials and
|
// Run the little AppleScript hack that asks for admin credentials and
|
||||||
// then installs the auth token file in the current user's home.
|
// 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");
|
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)) {
|
if (!QFile::exists(authHelperPath)) {
|
||||||
QMessageBox::critical(this,"Unable to Locate Helper","Unable to locate authorization helper, cannot obtain authentication token.",QMessageBox::Ok,QMessageBox::NoButton);
|
QMessageBox::critical(this,"Unable to Locate Helper","Unable to locate authorization helper, cannot obtain authentication token.",QMessageBox::Ok,QMessageBox::NoButton);
|
||||||
QApplication::exit(1);
|
QApplication::exit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
QProcess::execute(authHelperPath,QStringList());
|
QProcess::execute(authHelperPath,QStringList());
|
||||||
} else {
|
} else {
|
||||||
// If the service is not installed, download the installer and run it
|
// If the service is not installed, download the installer and run it
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||||
|
|
||||||
if [ "$#" -ne 2 ]; then
|
if [ "$#" -ne 1 ]; then
|
||||||
echo "Usage: $0 <path to secret signing identity> <path to destination folder for .nfo and installer>"
|
echo "Usage: $0 <path to secret signing identity>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -29,16 +29,11 @@ if [ ! -e zerotier-idtool ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
secret="$1"
|
secret="$1"
|
||||||
dest="$2"
|
|
||||||
|
|
||||||
if [ ! -e "$secret" ]; then
|
if [ ! -e "$secret" ]; then
|
||||||
echo "Can't find $secret"
|
echo "Can't find $secret"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ ! -d "$dest" ]; then
|
|
||||||
echo "Can't find $dest directory"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for inst in `ls ZeroTierOneInstaller-*-*-*_*_*`; do
|
for inst in `ls ZeroTierOneInstaller-*-*-*_*_*`; do
|
||||||
echo "Found installer: $inst"
|
echo "Found installer: $inst"
|
||||||
@ -51,6 +46,4 @@ for inst in `ls ZeroTierOneInstaller-*-*-*_*_*`; do
|
|||||||
echo "signedBy=`cat $secret | cut -d : -f 1`" >>"$nfo"
|
echo "signedBy=`cat $secret | cut -d : -f 1`" >>"$nfo"
|
||||||
echo "ed25519=`./zerotier-idtool sign $secret $inst`" >>"$nfo"
|
echo "ed25519=`./zerotier-idtool sign $secret $inst`" >>"$nfo"
|
||||||
echo "url=http://download.zerotier.com/$inst" >>"$nfo"
|
echo "url=http://download.zerotier.com/$inst" >>"$nfo"
|
||||||
cp $inst $nfo $dest
|
|
||||||
rm -f $nfo
|
|
||||||
done
|
done
|
||||||
|
5
attic/submit-official-release.sh
Executable file
5
attic/submit-official-release.sh
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Completely useless to outsiders. :)
|
||||||
|
|
||||||
|
scp ZeroTierOneInstaller-*-*-*_*_* nyarlathotep.zerotier.com:/www/download.zerotier.com/htdocs
|
@ -23,7 +23,7 @@ if [ $dryRun -gt 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
zthome="/Library/Application Support/ZeroTier/One"
|
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
|
if [ ! -d "$ztapp" ]; then
|
||||||
ztapp="/Applications/ZeroTier One.app"
|
ztapp="/Applications/ZeroTier One.app"
|
||||||
fi
|
fi
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
zthome="/Library/Application Support/ZeroTier/One"
|
zthome="/Library/Application Support/ZeroTier/One"
|
||||||
export PATH="/bin:/usr/bin:/sbin:/usr/sbin:$zthome"
|
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
|
# Clean all other stuff off the system if the user has trashed the .app
|
||||||
if [ -z "$ztapp" -o ! -d "$ztapp" ]; then
|
if [ -z "$ztapp" -o ! -d "$ztapp" ]; then
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||||
|
|
||||||
zthome="/Library/Application Support/ZeroTier/One"
|
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
|
if [ "$UID" -ne 0 ]; then
|
||||||
echo "Must be run as root; try: sudo $0"
|
echo "Must be run as root; try: sudo $0"
|
||||||
|
@ -132,12 +132,8 @@ static inline const char *_mkUpdateUrl()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#ifdef TARGET_OS_IPHONE
|
|
||||||
// TODO
|
|
||||||
#else
|
|
||||||
return "http://download.zerotier.com/ZeroTierOneInstaller-mac-combined-LATEST.nfo";
|
return "http://download.zerotier.com/ZeroTierOneInstaller-mac-combined-LATEST.nfo";
|
||||||
#define GOT_UPDATE_URL
|
#define GOT_UPDATE_URL
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: Windows
|
// TODO: Windows
|
||||||
|
Loading…
Reference in New Issue
Block a user