mirror of
https://github.com/docker/docs.git
synced 2026-11-05 00:14:17 +03:00
Fix metrics bugs on Windows
Signed-off-by: Jeffrey Morgan <jmorganca@gmail.com>
This commit is contained in:
@@ -26,7 +26,7 @@ RUN curl -fsSL -o /vbox.dmg http://download.virtualbox.org/virtualbox/$VBOX_VERS
|
||||
|
||||
# Download the Docker parts
|
||||
|
||||
ENV INSTALLER_VERSION 1.9.0
|
||||
ENV INSTALLER_VERSION 1.9.0a
|
||||
ENV DOCKER_VERSION 1.9.0
|
||||
# RUN curl -fsSL -o /docker https://test.docker.com/builds/Darwin/x86_64/docker-$DOCKER_VERSION
|
||||
RUN curl -fsSL -o docker https://get.docker.com/builds/Darwin/x86_64/docker-$DOCKER_VERSION
|
||||
@@ -192,9 +192,6 @@ RUN sed -i \
|
||||
RUN sed -i \
|
||||
-e "s/%INSTALLER_VERSION%/$INSTALLER_VERSION/g" \
|
||||
mpkg/Resources/en.lproj/welcome.rtfd/TXT.rtf
|
||||
RUN sed -i \
|
||||
-e "s/%INSTALLER_VERSION%/$INSTALLER_VERSION/g" \
|
||||
mpkg/Resources/en.lproj/Installed.html
|
||||
RUN sed -i \
|
||||
-e "s/%VBOX_VERSION%/$VBOX_VERSION/g" \
|
||||
/mpkg/Distribution && \
|
||||
|
||||
@@ -17,7 +17,7 @@ RUN cd innosetup && \
|
||||
wine "./innounp.exe" -e "is-unicode.exe"
|
||||
|
||||
# installer components
|
||||
ENV INSTALLER_VERSION 1.9.0
|
||||
ENV INSTALLER_VERSION 1.9.0a
|
||||
ENV DOCKER_VERSION 1.9.0
|
||||
ENV DOCKER_MACHINE_VERSION 0.5.0
|
||||
ENV DOCKER_COMPOSE_VERSION 1.5.0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="15A263e" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9059" systemVersion="15C27e" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9059"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="InstallerSection">
|
||||
@@ -31,9 +31,6 @@
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="checkboxChanged:" target="Qsn-FY-4qK" id="mbj-pc-e04"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xi8-N0-Reb">
|
||||
<rect key="frame" x="18" y="63" width="382" height="51"/>
|
||||
@@ -47,20 +44,20 @@
|
||||
</textField>
|
||||
<scrollView fixedFrame="YES" borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="0.0" verticalPageScroll="0.0" hasHorizontalScroller="NO" hasVerticalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="e5n-p7-Zro">
|
||||
<rect key="frame" x="14" y="149" width="390" height="170"/>
|
||||
<clipView key="contentView" misplaced="YES" id="GuL-k4-Axf">
|
||||
<rect key="frame" x="1" y="1" width="223" height="133"/>
|
||||
<clipView key="contentView" ambiguous="YES" id="GuL-k4-Axf">
|
||||
<rect key="frame" x="0.0" y="0.0" width="390" height="170"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView horizontalCompressionResistancePriority="250" editable="NO" importsGraphics="NO" verticallyResizable="NO" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" usesFontPanel="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" spellingCorrection="YES" smartInsertDelete="YES" id="cgA-DY-Gw8">
|
||||
<rect key="frame" x="0.0" y="0.0" width="223" height="190"/>
|
||||
<textView horizontalCompressionResistancePriority="250" ambiguous="YES" editable="NO" importsGraphics="NO" verticallyResizable="NO" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" usesFontPanel="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" spellingCorrection="YES" smartInsertDelete="YES" id="cgA-DY-Gw8">
|
||||
<rect key="frame" x="0.0" y="0.0" width="390" height="207"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="390" height="170"/>
|
||||
<size key="maxSize" width="463" height="170"/>
|
||||
<size key="maxSize" width="463" height="207"/>
|
||||
<color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="minSize" width="390" height="170"/>
|
||||
<size key="maxSize" width="463" height="170"/>
|
||||
<size key="maxSize" width="463" height="207"/>
|
||||
</textView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#import <InstallerPlugins/InstallerPlugins.h>
|
||||
|
||||
@interface overviewpluginPane : InstallerPane
|
||||
- (IBAction)checkboxChanged:(id)sender;
|
||||
@property (unsafe_unretained) IBOutlet NSTextView *textView;
|
||||
@property (weak) IBOutlet NSButton *checkbox;
|
||||
@end
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,14 +0,0 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
<title>Docker Toolbox for Mac OS X</title>
|
||||
<style>li {padding-bottom:1em;}</style>
|
||||
</head>
|
||||
<body style="font-family: Helvetica, Sans-Serif;">
|
||||
<h1>Installation Successful!</h1>
|
||||
<h3>Upgrade your VM:</h3>
|
||||
<ol>
|
||||
<li>Open a Terminal window.</li>
|
||||
<li>Enter the following command: <br /><code>docker-machine upgrade default</code></li>
|
||||
</body>
|
||||
</html>
|
||||
@@ -69,8 +69,6 @@ Source: ".\start.sh"; DestDir: "{app}"; Flags: ignoreversion; Components: "Docke
|
||||
Source: ".\delete.sh"; DestDir: "{app}"; Flags: ignoreversion; Components: "Docker"
|
||||
Source: "{#dockerMachineCli}"; DestDir: "{app}"; Flags: ignoreversion; Components: "DockerMachine"
|
||||
Source: "{#dockerComposeCli}"; DestDir: "{app}"; Flags: ignoreversion; Components: "DockerCompose"
|
||||
Source: ".\migrate.sh"; DestDir: "{app}"; Flags: ignoreversion; Components: "DockerMachine"
|
||||
Source: ".\migrate.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: "DockerMachine"
|
||||
Source: "{#kitematic}\*"; DestDir: "{app}\kitematic"; Flags: ignoreversion recursesubdirs; Components: "Kitematic"
|
||||
Source: "{#b2dIsoPath}"; DestDir: "{app}"; Flags: ignoreversion; Components: "DockerMachine"; AfterInstall: CopyBoot2DockerISO()
|
||||
Source: "{#git}"; DestDir: "{app}\installers\git"; DestName: "git.exe"; AfterInstall: RunInstallGit(); Components: "Git"
|
||||
@@ -98,7 +96,7 @@ Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"DOCKER_TOOLBOX_I
|
||||
|
||||
var
|
||||
restart: boolean;
|
||||
TrackingDisabled: Boolean;
|
||||
TrackingDisabled: Boolean;
|
||||
TrackingCheckBox: TNewCheckBox;
|
||||
|
||||
function uuid(): String;
|
||||
@@ -140,15 +138,20 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TrackEvent(name: String);
|
||||
procedure TrackEventWithProperties(name: String; properties: String);
|
||||
var
|
||||
payload: String;
|
||||
WinHttpReq: Variant;
|
||||
tracking: String;
|
||||
begin
|
||||
if TrackingDisabled or WizardSilent() then
|
||||
exit;
|
||||
|
||||
if Length(properties) > 0 then
|
||||
properties := ', ' + properties;
|
||||
|
||||
try
|
||||
payload := Encode64(Format(ExpandConstant('{{"event": "%s", "properties": {{"token": "{#MixpanelToken}", "distinct_id": "%s", "os": "win32", "os version": "%s", "version": "{#MyAppVersion}"}}'), [name, uuid(), WindowsVersionString()]));
|
||||
payload := Encode64(Format(ExpandConstant('{{"event": "%s", "properties": {{"token": "{#MixpanelToken}", "distinct_id": "%s", "os": "win32", "os version": "%s", "version": "{#MyAppVersion}" %s}}'), [name, uuid(), WindowsVersionString(), properties]));
|
||||
WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1');
|
||||
WinHttpReq.Open('POST', 'https://api.mixpanel.com/track/?data=' + payload, false);
|
||||
WinHttpReq.SetRequestHeader('Content-Type', 'application/json');
|
||||
@@ -157,9 +160,9 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function NeedRestart(): Boolean;
|
||||
procedure TrackEvent(name: String);
|
||||
begin
|
||||
Result := restart;
|
||||
TrackEventWithProperties(name, '');
|
||||
end;
|
||||
|
||||
function NeedToInstallVirtualBox(): Boolean;
|
||||
@@ -186,17 +189,6 @@ begin
|
||||
Result := not DirExists('C:\Program Files\Git') or not FileExists('C:\Program Files\Git\git-bash.exe')
|
||||
end;
|
||||
|
||||
procedure TrackingCheckBoxClicked(Sender: TObject);
|
||||
begin
|
||||
if TrackingCheckBox.Checked then begin
|
||||
TrackingDisabled := False;
|
||||
TrackEvent('Enabled Tracking');
|
||||
end else begin
|
||||
TrackEvent('Disabled Tracking');
|
||||
TrackingDisabled := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure InitializeWizard;
|
||||
var
|
||||
WelcomePage: TWizardPage;
|
||||
@@ -211,11 +203,10 @@ begin
|
||||
TrackingCheckBox.Top := WizardForm.WelcomeLabel2.Top + WizardForm.WelcomeLabel2.Height + 10;
|
||||
TrackingCheckBox.Left := WizardForm.WelcomeLabel2.Left;
|
||||
TrackingCheckBox.Width := WizardForm.WelcomeLabel2.Width;
|
||||
TrackingCheckBox.Height := 40;
|
||||
TrackingCheckBox.Height := 28;
|
||||
TrackingCheckBox.Caption := 'Help Docker improve Toolbox.';
|
||||
TrackingCheckBox.Checked := True;
|
||||
TrackingCheckBox.Parent := WelcomePage.Surface;
|
||||
TrackingCheckBox.OnClick := @TrackingCheckboxClicked;
|
||||
|
||||
TrackingLabel := TLabel.Create(WizardForm);
|
||||
TrackingLabel.Parent := WelcomePage.Surface;
|
||||
@@ -226,8 +217,8 @@ begin
|
||||
TrackingLabel.Visible := True;
|
||||
TrackingLabel.Left := WizardForm.WelcomeLabel2.Left;
|
||||
TrackingLabel.Width := WizardForm.WelcomeLabel2.Width;
|
||||
TrackingLabel.Top := TrackingCheckBox.Top + TrackingCheckBox.Height + 20;
|
||||
TrackingLabel.Height := 300;
|
||||
TrackingLabel.Top := TrackingCheckBox.Top + TrackingCheckBox.Height + 5;
|
||||
TrackingLabel.Height := 50;
|
||||
|
||||
// Don't do this until we can compare versions
|
||||
// Wizardform.ComponentsList.Checked[3] := NeedToInstallVirtualBox();
|
||||
@@ -245,7 +236,13 @@ end;
|
||||
function NextButtonClick(CurPageID: Integer): Boolean;
|
||||
begin
|
||||
if CurPageID = wpWelcome then begin
|
||||
TrackEvent('Continued from Overview');
|
||||
if TrackingCheckBox.Checked then begin
|
||||
TrackEventWithProperties('Continued from Overview', '"Tracking Enabled": "Yes"');
|
||||
TrackingDisabled := False;
|
||||
end else begin
|
||||
TrackEventWithProperties('Continued from Overview', '"Tracking Enabled": "No"');
|
||||
TrackingDisabled := True;
|
||||
end;
|
||||
end;
|
||||
Result := True
|
||||
end;
|
||||
@@ -329,49 +326,6 @@ begin
|
||||
Result := true
|
||||
end;
|
||||
|
||||
function MigrateVM() : Boolean;
|
||||
var
|
||||
ResultCode: Integer;
|
||||
begin
|
||||
if NeedToInstallGit() or NeedToInstallVirtualBox() or not FileExists(ExpandConstant('{app}\docker-machine.exe')) then begin
|
||||
Result := true
|
||||
exit
|
||||
end;
|
||||
|
||||
ExecAsOriginalUser(VBoxPath() + 'VBoxManage.exe', 'showvminfo default', '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
|
||||
if ResultCode <> 1 then begin
|
||||
Result := true
|
||||
exit
|
||||
end;
|
||||
|
||||
ExecAsOriginalUser(VBoxPath() + 'VBoxManage.exe', 'showvminfo boot2docker-vm', '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
|
||||
if ResultCode <> 0 then begin
|
||||
Result := true
|
||||
exit
|
||||
end;
|
||||
|
||||
TrackEvent('Boot2Docker Migration Started');
|
||||
WizardForm.StatusLabel.Caption := 'Migrating Boot2Docker VM...'
|
||||
WizardForm.FilenameLabel.Caption := 'This will take a minute...'
|
||||
ExecAsOriginalUser(ExpandConstant('{app}\docker-machine.exe'), ExpandConstant('rm -f default > nul 2>&1'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
|
||||
DelTree(ExpandConstant('{userdocs}\..\.docker\machine\machines\default'), True, True, True);
|
||||
ExecAsOriginalUser(ExpandConstant('{app}\migrate.bat'), ExpandConstant('> {localappdata}\Temp\toolbox-migration-logs.txt 2>&1'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
|
||||
if ResultCode = 0 then
|
||||
begin
|
||||
TrackEvent('Boot2Docker Migration Succeeded');
|
||||
MsgBox('Succcessfully migrated Boot2Docker VM to a Docker Machine VM named "default"', mbInformation, MB_OK);
|
||||
end
|
||||
else begin
|
||||
TrackEvent('Boot2Docker Migration Failed');
|
||||
MsgBox('Migration of Boot2Docker VM failed. Please file an issue with the migration logs at https://github.com/docker/toolbox/issues/new.', mbCriticalError, MB_OK);
|
||||
Exec(ExpandConstant('{win}\notepad.exe'), ExpandConstant('{localappdata}\Temp\toolbox-migration-logs.txt'), '', SW_SHOW, ewNoWait, ResultCode)
|
||||
Result := false
|
||||
WizardForm.Close;
|
||||
exit;
|
||||
end;
|
||||
Result := true
|
||||
end;
|
||||
|
||||
const
|
||||
ModPathName = 'modifypath';
|
||||
ModPathType = 'user';
|
||||
@@ -390,6 +344,7 @@ begin
|
||||
Success := True;
|
||||
if CurStep = ssPostInstall then
|
||||
begin
|
||||
trackEvent('Installing Files Succeeded');
|
||||
if IsTaskSelected(ModPathName) then
|
||||
ModPath();
|
||||
if not WizardSilent() then
|
||||
@@ -399,9 +354,6 @@ begin
|
||||
if CanUpgradeVM() then begin
|
||||
Success := UpgradeVM();
|
||||
end;
|
||||
// else begin
|
||||
// Success := MigrateVM();
|
||||
// end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
:: Batch file that installer can run. Simply runs bash script with the same name
|
||||
|
||||
cd %~dp0
|
||||
"C:\Program Files\Git\bin\sh.exe" --login -i migrate.sh
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o pipefail
|
||||
./docker-machine -D create -d virtualbox --virtualbox-memory 2048 --virtualbox-import-boot2docker-vm boot2docker-vm default | sed -e '/BEGIN/,/END/d'
|
||||
Reference in New Issue
Block a user