summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2014-02-26 14:37:21 -0800
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2014-02-26 14:37:21 -0800
commit2203958798ca151cfde348254d8d18a5ca471e31 (patch)
tree983cb049da0b17598f66f0f61c044114d6b28de0 /main.cpp
parent268ec8d1e0a01459eb7f04e0652f26bb7b597ba6 (diff)
downloadinfinitytier-2203958798ca151cfde348254d8d18a5ca471e31.tar.gz
infinitytier-2203958798ca151cfde348254d8d18a5ca471e31.zip
Windows auto-updater invocation works... time to try an installer!
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index 9e6f5189..28d8e2e8 100644
--- a/main.cpp
+++ b/main.cpp
@@ -641,7 +641,20 @@ int main(int argc,char **argv)
try {
node = new Node(homeDir,port,controlPort);
switch(node->run()) {
-#ifndef __WINDOWS__
+#ifdef __WINDOWS__
+ case Node::NODE_RESTART_FOR_UPGRADE: {
+ const char *upgPath = node->reasonForTermination();
+ if (upgPath) {
+ if (!ZeroTierOneService::doStartUpgrade(std::string(upgPath))) {
+ exitCode = 3;
+ fprintf(stderr,"%s: abnormal termination: unable to execute update at %s (doStartUpgrade failed)\n",argv[0],(upgPath) ? upgPath : "(unknown path)");
+ }
+ } else {
+ exitCode = 3;
+ fprintf(stderr,"%s: abnormal termination: unable to execute update at %s (no upgrade path provided)\n",argv[0],(upgPath) ? upgPath : "(unknown path)");
+ }
+ } break;
+#else // __UNIX_LIKE__
case Node::NODE_RESTART_FOR_UPGRADE: {
const char *upgPath = node->reasonForTermination();
// On Unix-type OSes we exec() right into the upgrade. This in turn will