diff --git a/Dockerfile.osx b/Dockerfile.osx index 9b881420c4..416d58844f 100644 --- a/Dockerfile.osx +++ b/Dockerfile.osx @@ -18,8 +18,8 @@ RUN curl -fsSL https://github.com/mackyle/xar/archive/xar-1.6.1.tar.gz | tar xvz ./autogen.sh && ./configure && \ make && make install -ENV VBOX_VERSION 5.0.2 -ENV VBOX_REV 102096 +ENV VBOX_VERSION 5.0.0 +ENV VBOX_REV 101573 RUN curl -fsSL -o /vbox.dmg http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VirtualBox-$VBOX_VERSION-$VBOX_REV-OSX.dmg \ && echo "$(curl -fsSL 'http://download.virtualbox.org/virtualbox/'"$VBOX_VERSION"'/SHA256SUMS' | awk '$2 ~ /-OSX.dmg$/ { print $1 }') */vbox.dmg" | sha256sum -c - @@ -68,10 +68,10 @@ RUN cd /mpkg/vbox && \ rm -rf vbox # Add components -COPY mpkg/Distribution /mpkg/Distribution +COPY osx/mpkg/Distribution /mpkg/Distribution # docker.pkg -COPY mpkg/docker.pkg /mpkg/docker.pkg +COPY osx/mpkg/docker.pkg /mpkg/docker.pkg RUN cd /mpkg/docker.pkg && \ mkdir rootfs && \ cd rootfs && \ @@ -89,7 +89,7 @@ RUN cd /mpkg/docker.pkg && \ rm -rf ./rootfs # kitematicapp.pkg -COPY mpkg/kitematicapp.pkg /mpkg/kitematicapp.pkg +COPY osx/mpkg/kitematicapp.pkg /mpkg/kitematicapp.pkg RUN cd /mpkg/kitematicapp.pkg && \ mkdir ./rootfs && \ cd ./rootfs && \ @@ -107,7 +107,7 @@ RUN cd /mpkg/kitematicapp.pkg && \ rm -rf ./rootfs # dockermachine.pkg -COPY mpkg/dockermachine.pkg /mpkg/dockermachine.pkg +COPY osx/mpkg/dockermachine.pkg /mpkg/dockermachine.pkg RUN cd /mpkg/dockermachine.pkg && \ mkdir rootfs && \ cd rootfs && \ @@ -125,7 +125,7 @@ RUN cd /mpkg/dockermachine.pkg && \ rm -rf ./rootfs # dockercompose.pkg -COPY mpkg/dockercompose.pkg /mpkg/dockercompose.pkg +COPY osx/mpkg/dockercompose.pkg /mpkg/dockercompose.pkg RUN cd /mpkg/dockercompose.pkg && \ mkdir rootfs && \ cd rootfs && \ @@ -143,7 +143,7 @@ RUN cd /mpkg/dockercompose.pkg && \ rm -rf ./rootfs # boot2dockeriso.pkg -COPY mpkg/boot2dockeriso.pkg /mpkg/boot2dockeriso.pkg +COPY osx/mpkg/boot2dockeriso.pkg /mpkg/boot2dockeriso.pkg RUN cd /mpkg/boot2dockeriso.pkg && \ cd Scripts && find . | cpio -o --format odc | gzip -c > ../Scripts.bin && cd .. && \ rm -r Scripts && mv Scripts.bin Scripts && \ @@ -161,8 +161,8 @@ RUN cd /mpkg/boot2dockeriso.pkg && \ rm -rf ./rootfs # dockerquickstartterminalapp.pkg -COPY mpkg/dockerquickstartterminalapp.pkg /mpkg/dockerquickstartterminalapp.pkg -COPY mpkg/quickstart.app /mpkg/quickstart.app +COPY osx/mpkg/dockerquickstartterminalapp.pkg /mpkg/dockerquickstartterminalapp.pkg +COPY osx/mpkg/quickstart.app /mpkg/quickstart.app RUN cd /mpkg/dockerquickstartterminalapp.pkg && \ mkdir ./rootfs && \ cd ./rootfs && \ @@ -177,8 +177,8 @@ RUN cd /mpkg/dockerquickstartterminalapp.pkg && \ cd .. && \ rm -rf ./rootfs -COPY mpkg/Resources /mpkg/Resources -COPY mpkg/Plugins /mpkg/Plugins +COPY osx/mpkg/Resources /mpkg/Resources +COPY osx/mpkg/Plugins /mpkg/Plugins RUN sed -i \ -e "s/%MIXPANEL_TOKEN%/$MIXPANEL_TOKEN/g" \ diff --git a/osx/installerplugins/common/mixpanel.h b/osx/installerplugins/common/mixpanel.h index aa5cb4e02a..29831c8736 100644 --- a/osx/installerplugins/common/mixpanel.h +++ b/osx/installerplugins/common/mixpanel.h @@ -20,29 +20,31 @@ @implementation Mixpanel + (NSString *) uuid { - NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]; - NSString *cacheDirPath = [NSString pathWithComponents:[NSArray arrayWithObjects:cachePath, @"io.docker.pkg.toolbox", nil]]; - NSString *cacheFilePath = [NSString pathWithComponents:[NSArray arrayWithObjects:cacheDirPath, @"id", nil]]; + NSString *appPath = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) objectAtIndex:0]; + NSString *appDirPath = [NSString pathWithComponents:[NSArray arrayWithObjects:appPath, @"DockerToolbox", nil]]; + NSString *appFilePath = [NSString pathWithComponents:[NSArray arrayWithObjects:appDirPath, @"id", nil]]; - NSString *uuid = [NSString stringWithContentsOfFile:cacheFilePath encoding:NSUTF8StringEncoding error:nil]; + NSString *uuid = [NSString stringWithContentsOfFile:appFilePath encoding:NSUTF8StringEncoding error:nil]; if (!uuid || ![uuid length]) { uuid = [[NSUUID UUID] UUIDString]; + [[NSFileManager defaultManager] createDirectoryAtPath:appDirPath withIntermediateDirectories:YES attributes:nil error:nil]; + [uuid writeToFile:appFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil]; } - [[NSFileManager defaultManager] createDirectoryAtPath:cacheDirPath withIntermediateDirectories:YES attributes:nil error:nil]; - [uuid writeToFile:cacheFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil]; - return uuid; } + (void) trackEvent:(NSString *)name forPane:(InstallerPane*)pane withProperties:(NSDictionary *)properties { BOOL trackingDisabled = [[[[pane section] sharedDictionary] objectForKey:@"disableTracking"] boolValue]; - NSString *uuid = [self uuid]; - - if (!uuid || trackingDisabled) { + if (trackingDisabled) { return; } + NSString *uuid = [self uuid]; + if (!uuid) { + return; + } + NSString *props = @""; for (NSString *key in properties) { props = [props stringByAppendingFormat:@",\"%@\": \"%@\"", key, [properties objectForKey:key]]; diff --git a/osx/installerplugins/installerplugins.xcodeproj/project.pbxproj b/osx/installerplugins/installerplugins.xcodeproj/project.pbxproj index eae09b107c..a72207ffe8 100644 --- a/osx/installerplugins/installerplugins.xcodeproj/project.pbxproj +++ b/osx/installerplugins/installerplugins.xcodeproj/project.pbxproj @@ -51,9 +51,9 @@ 1B4C91BE1B85198100A06068 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/quickstartplugin.xib; sourceTree = ""; }; 1B4C91C11B85198100A06068 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; 1B4C91C31B85198100A06068 /* InstallerSections.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = InstallerSections.plist; sourceTree = ""; }; + 1B763C8B1B8F7F2A00981AA8 /* informationplugin.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = informationplugin.bundle; path = /Users/jmorgan/workspace/toolbox/osx/installerplugins/build/Debug/informationplugin.bundle; sourceTree = ""; }; 1B8417E71B85261F00B1FA4D /* kitematic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = kitematic.png; sourceTree = ""; }; 1B8417E81B85261F00B1FA4D /* quickstart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = quickstart.png; sourceTree = ""; }; - 1BF1029E1B8B940500FCB650 /* informationplugin.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = informationplugin.bundle; path = /Users/jmorgan/workspace/toolbox/osx/installerplugins/../mpkg/Plugins/informationplugin.bundle; sourceTree = ""; }; 1BF102BB1B8BDEDA00FCB650 /* overviewplugin.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = overviewplugin.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 1BF102BE1B8BDEDA00FCB650 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 1BF102C01B8BDEDA00FCB650 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -241,7 +241,7 @@ ); name = informationplugin; productName = informationplugin; - productReference = 1BF1029E1B8B940500FCB650 /* informationplugin.bundle */; + productReference = 1B763C8B1B8F7F2A00981AA8 /* informationplugin.bundle */; productType = "com.apple.product-type.bundle"; }; 1BF102BA1B8BDEDA00FCB650 /* overviewplugin */ = { @@ -701,6 +701,7 @@ 1BF102CF1B8BDEDA00FCB650 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/osx/installerplugins/managevmplugin/managevmpluginPane.m b/osx/installerplugins/managevmplugin/managevmpluginPane.m index 8d28b37f20..4fac1f86ec 100644 --- a/osx/installerplugins/managevmplugin/managevmpluginPane.m +++ b/osx/installerplugins/managevmplugin/managevmpluginPane.m @@ -32,15 +32,15 @@ NSString *dockerMachinePath = @"/usr/local/bin/docker-machine"; } // Boot2Docker certs exist - if (![[NSFileManager defaultManager] fileExistsAtPath:@"~/.boot2docker/certs/boot2docker-vm/ca.pem"] || - ![[NSFileManager defaultManager] fileExistsAtPath:@"~/.boot2docker/certs/boot2docker-vm/cert.pem"] || - ![[NSFileManager defaultManager] fileExistsAtPath:@"~/.boot2docker/certs/boot2docker-vm/key.pem"]) { + if (![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.boot2docker/certs/boot2docker-vm/ca.pem", NSHomeDirectory()]] || + ![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.boot2docker/certs/boot2docker-vm/cert.pem", NSHomeDirectory()]] || + ![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.boot2docker/certs/boot2docker-vm/key.pem", NSHomeDirectory()]]) { return NO; } // Boot2Docker ssh keys exist - if (![[NSFileManager defaultManager] fileExistsAtPath:@"~/.ssh/id_boot2docker"] || - ![[NSFileManager defaultManager] fileExistsAtPath:@"~/.ssh/id_boot2docker.pub"]) { + if (![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.ssh/id_boot2docker", NSHomeDirectory()]] || + ![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.ssh/id_boot2docker.pub", NSHomeDirectory()]]) { return NO; } @@ -59,7 +59,7 @@ NSString *dockerMachinePath = @"/usr/local/bin/docker-machine"; [removeVMTask waitUntilExit]; // Remove the VM dir in case there's anything left over - NSTask* removeDirTask = [NSTask launchedTaskWithLaunchPath:@"/bin/rm" arguments:[NSArray arrayWithObjects:@"-rf", @"~/.docker/machine/machines/default", nil]]; + NSTask* removeDirTask = [NSTask launchedTaskWithLaunchPath:@"/bin/rm" arguments:[NSArray arrayWithObjects:@"-rf", [NSString stringWithFormat:@"%@/.docker/machine/machines/default", NSHomeDirectory()], nil]]; [removeDirTask waitUntilExit]; // Do the migration @@ -179,7 +179,7 @@ NSString *dockerMachinePath = @"/usr/local/bin/docker-machine"; [self migrateBoot2DockerVM]; return NO; } else if (self.migrateCheckbox.state == NSOffState) { - [Mixpanel trackEvent:@"Skipped Boot2Docker Migration" forPane:self]; + [Mixpanel trackEvent:@"Boot2Docker Migration Skipped" forPane:self]; } return YES; } diff --git a/osx/installerplugins/overviewplugin/Base.lproj/overviewplugin.xib b/osx/installerplugins/overviewplugin/Base.lproj/overviewplugin.xib index aaf1261f91..c492b6425b 100644 --- a/osx/installerplugins/overviewplugin/Base.lproj/overviewplugin.xib +++ b/osx/installerplugins/overviewplugin/Base.lproj/overviewplugin.xib @@ -25,21 +25,21 @@ - + - - + + - - + + - - + + @@ -51,29 +51,23 @@ - + - - - - - - - - - diff --git a/osx/installerplugins/overviewplugin/overview.html b/osx/installerplugins/overviewplugin/overview.html index 3ffea00ac1..05eb87e380 100644 --- a/osx/installerplugins/overviewplugin/overview.html +++ b/osx/installerplugins/overviewplugin/overview.html @@ -4,6 +4,7 @@ Docker Toolbox for Mac OS X +

The Docker Toolbox installer includes the following:

diff --git a/osx/installerplugins/overviewplugin/overviewpluginPane.h b/osx/installerplugins/overviewplugin/overviewpluginPane.h index fc2b2fe0b4..ad65ee4c32 100644 --- a/osx/installerplugins/overviewplugin/overviewpluginPane.h +++ b/osx/installerplugins/overviewplugin/overviewpluginPane.h @@ -9,6 +9,7 @@ #import @interface overviewpluginPane : InstallerPane +- (IBAction)checkboxChanged:(id)sender; @property (unsafe_unretained) IBOutlet NSTextView *textView; @property (weak) IBOutlet NSButton *checkbox; @end diff --git a/osx/installerplugins/overviewplugin/overviewpluginPane.m b/osx/installerplugins/overviewplugin/overviewpluginPane.m index 1c130d272b..1f67f26608 100644 --- a/osx/installerplugins/overviewplugin/overviewpluginPane.m +++ b/osx/installerplugins/overviewplugin/overviewpluginPane.m @@ -33,7 +33,7 @@ [[self.textView textStorage] setAttributedString:formattedHTML]; if (self.firstTime) { [Mixpanel trackEvent:@"Installer Started" forPane:self]; - self.firstTime = YES; + self.firstTime = NO; } } @@ -41,15 +41,18 @@ if (dir != InstallerDirectionForward) { return; } - - if (self.checkbox.state != NSOnState) { + + [Mixpanel trackEvent:@"Continued from Overview" forPane:self]; +} + +- (IBAction)checkboxChanged:(id)sender { + if ([(NSButton*)sender state] == NSOnState) { + [Mixpanel trackEvent:@"Enabled Tracking" forPane:self]; + [[[self section] sharedDictionary] removeObjectForKey:@"disableTracking"]; + } else { [Mixpanel trackEvent:@"Disabled Tracking" forPane:self]; [[[self section] sharedDictionary] setObject:[NSNumber numberWithBool:YES] forKey:@"disableTracking"]; - return; } - - [[[self section] sharedDictionary] removeObjectForKey:@"disableTracking"]; - [Mixpanel trackEvent:@"Enabled Tracking" forPane:self]; } @end diff --git a/osx/installerplugins/quickstartplugin/Base.lproj/quickstartplugin.xib b/osx/installerplugins/quickstartplugin/Base.lproj/quickstartplugin.xib index 6d0c263a20..1764cc1ca6 100644 --- a/osx/installerplugins/quickstartplugin/Base.lproj/quickstartplugin.xib +++ b/osx/installerplugins/quickstartplugin/Base.lproj/quickstartplugin.xib @@ -1,8 +1,8 @@ - + - + @@ -26,19 +26,10 @@ - - - - - - - - - - + - + @@ -80,7 +71,16 @@ Terminal - + + + + + + + + + + diff --git a/osx/installerplugins/quickstartplugin/quickstartpluginPane.m b/osx/installerplugins/quickstartplugin/quickstartpluginPane.m index 6c7d47f194..8758a158e2 100644 --- a/osx/installerplugins/quickstartplugin/quickstartpluginPane.m +++ b/osx/installerplugins/quickstartplugin/quickstartpluginPane.m @@ -15,9 +15,11 @@ return [[NSBundle bundleForClass:[self class]] localizedStringForKey:@"PaneTitle" value:nil table:nil]; } -- (void) willEnterPane:(InstallerSectionDirection)dir { +- (void) didEnterPane:(InstallerSectionDirection)dir { self.previousEnabled = NO; - +} + +- (void) willEnterPane:(InstallerSectionDirection)dir { BOOL kitematicInstalled = [[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Docker/Kitematic (Beta).app"]; BOOL quickstartInstalled = [[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Docker/Docker Quickstart Terminal.app"]; diff --git a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/MacOS/managevmplugin b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/MacOS/managevmplugin index 68591e8ac4..b598527f61 100755 Binary files a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/MacOS/managevmplugin and b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/MacOS/managevmplugin differ diff --git a/osx/mpkg/Plugins/overviewplugin.bundle/Contents/MacOS/overviewplugin b/osx/mpkg/Plugins/overviewplugin.bundle/Contents/MacOS/overviewplugin index 052bd39a48..95a2a1a22c 100755 Binary files a/osx/mpkg/Plugins/overviewplugin.bundle/Contents/MacOS/overviewplugin and b/osx/mpkg/Plugins/overviewplugin.bundle/Contents/MacOS/overviewplugin differ diff --git a/osx/mpkg/Plugins/overviewplugin.bundle/Contents/Resources/Base.lproj/overviewplugin.nib b/osx/mpkg/Plugins/overviewplugin.bundle/Contents/Resources/Base.lproj/overviewplugin.nib index 6f421a954c..778b4c278d 100644 Binary files a/osx/mpkg/Plugins/overviewplugin.bundle/Contents/Resources/Base.lproj/overviewplugin.nib and b/osx/mpkg/Plugins/overviewplugin.bundle/Contents/Resources/Base.lproj/overviewplugin.nib differ diff --git a/osx/mpkg/Plugins/overviewplugin.bundle/Contents/Resources/overview.html b/osx/mpkg/Plugins/overviewplugin.bundle/Contents/Resources/overview.html index 3ffea00ac1..05eb87e380 100644 --- a/osx/mpkg/Plugins/overviewplugin.bundle/Contents/Resources/overview.html +++ b/osx/mpkg/Plugins/overviewplugin.bundle/Contents/Resources/overview.html @@ -4,6 +4,7 @@ Docker Toolbox for Mac OS X +

The Docker Toolbox installer includes the following:

diff --git a/osx/mpkg/Plugins/quickstartplugin.bundle/Contents/MacOS/quickstartplugin b/osx/mpkg/Plugins/quickstartplugin.bundle/Contents/MacOS/quickstartplugin index e84a326a99..3e0ac39033 100755 Binary files a/osx/mpkg/Plugins/quickstartplugin.bundle/Contents/MacOS/quickstartplugin and b/osx/mpkg/Plugins/quickstartplugin.bundle/Contents/MacOS/quickstartplugin differ diff --git a/osx/mpkg/Plugins/quickstartplugin.bundle/Contents/Resources/Base.lproj/quickstartplugin.nib b/osx/mpkg/Plugins/quickstartplugin.bundle/Contents/Resources/Base.lproj/quickstartplugin.nib index 3d9dbe3420..7682e287d4 100644 Binary files a/osx/mpkg/Plugins/quickstartplugin.bundle/Contents/Resources/Base.lproj/quickstartplugin.nib and b/osx/mpkg/Plugins/quickstartplugin.bundle/Contents/Resources/Base.lproj/quickstartplugin.nib differ diff --git a/osx/mpkg/Resources/en.lproj/Localizable.strings b/osx/mpkg/Resources/en.lproj/Localizable.strings index 703e41b776..4c36381966 100644 --- a/osx/mpkg/Resources/en.lproj/Localizable.strings +++ b/osx/mpkg/Resources/en.lproj/Localizable.strings @@ -13,10 +13,10 @@ 'choiceBoot2DockerISO_msg' = 'Installs the boot2docker.iso into /usr/local/share/'; 'choiceDockerQuickstartTerminalAPP_title' = 'Docker Quickstart Terminal'; -'choiceDockerQuickstartTerminalAPP_msg' = 'Installs the Docker Quickstart Terminal application into /Applications/'; +'choiceDockerQuickstartTerminalAPP_msg' = 'Installs the Docker Quickstart Terminal application into /Applications/Docker/'; 'choiceKitematicAPP_title' = 'Kitematic %KITEMATICAPP_VERSION%'; -'choiceKitematicAPP_msg' = 'Installs Kitematic into /Applications/'; +'choiceKitematicAPP_msg' = 'Installs Kitematic into /Applications/Docker/'; 'choiceVBox_title' = 'Oracle VM VirtualBox %VBOX_VERSION%'; 'choiceVBox_msg' = 'Installs or Upgrades the Oracle VM VirtualBox application into /Applications if it is not already installed.';