Skip to content
This repository was archived by the owner on Sep 26, 2021. It is now read-only.

Commit d5dca18

Browse files
committed
Fix metrics bugs on Windows
Signed-off-by: Jeffrey Morgan <[email protected]>
1 parent 07d75d5 commit d5dca18

File tree

10 files changed

+31
-108
lines changed

10 files changed

+31
-108
lines changed

Dockerfile.osx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ RUN curl -fsSL -o /vbox.dmg http://download.virtualbox.org/virtualbox/$VBOX_VERS
2626

2727
# Download the Docker parts
2828

29-
ENV INSTALLER_VERSION 1.9.0
29+
ENV INSTALLER_VERSION 1.9.0a
3030
ENV DOCKER_VERSION 1.9.0
3131
# RUN curl -fsSL -o /docker https://test.docker.com/builds/Darwin/x86_64/docker-$DOCKER_VERSION
3232
RUN curl -fsSL -o docker https://get.docker.com/builds/Darwin/x86_64/docker-$DOCKER_VERSION
@@ -192,9 +192,6 @@ RUN sed -i \
192192
RUN sed -i \
193193
-e "s/%INSTALLER_VERSION%/$INSTALLER_VERSION/g" \
194194
mpkg/Resources/en.lproj/welcome.rtfd/TXT.rtf
195-
RUN sed -i \
196-
-e "s/%INSTALLER_VERSION%/$INSTALLER_VERSION/g" \
197-
mpkg/Resources/en.lproj/Installed.html
198195
RUN sed -i \
199196
-e "s/%VBOX_VERSION%/$VBOX_VERSION/g" \
200197
/mpkg/Distribution && \

Dockerfile.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN cd innosetup && \
1717
wine "./innounp.exe" -e "is-unicode.exe"
1818

1919
# installer components
20-
ENV INSTALLER_VERSION 1.9.0
20+
ENV INSTALLER_VERSION 1.9.0a
2121
ENV DOCKER_VERSION 1.9.0
2222
ENV DOCKER_MACHINE_VERSION 0.5.0
2323
ENV DOCKER_COMPOSE_VERSION 1.5.0

osx/installerplugins/overviewplugin/Base.lproj/overviewplugin.xib

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="15A263e" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9059" systemVersion="15C27e" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9059"/>
66
</dependencies>
77
<objects>
88
<customObject id="-2" userLabel="File's Owner" customClass="InstallerSection">
@@ -31,9 +31,6 @@
3131
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
3232
<font key="font" metaFont="system"/>
3333
</buttonCell>
34-
<connections>
35-
<action selector="checkboxChanged:" target="Qsn-FY-4qK" id="mbj-pc-e04"/>
36-
</connections>
3734
</button>
3835
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xi8-N0-Reb">
3936
<rect key="frame" x="18" y="63" width="382" height="51"/>
@@ -47,20 +44,20 @@
4744
</textField>
4845
<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">
4946
<rect key="frame" x="14" y="149" width="390" height="170"/>
50-
<clipView key="contentView" misplaced="YES" id="GuL-k4-Axf">
51-
<rect key="frame" x="1" y="1" width="223" height="133"/>
47+
<clipView key="contentView" ambiguous="YES" id="GuL-k4-Axf">
48+
<rect key="frame" x="0.0" y="0.0" width="390" height="170"/>
5249
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
5350
<subviews>
54-
<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">
55-
<rect key="frame" x="0.0" y="0.0" width="223" height="190"/>
51+
<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">
52+
<rect key="frame" x="0.0" y="0.0" width="390" height="207"/>
5653
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
5754
<animations/>
5855
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
5956
<size key="minSize" width="390" height="170"/>
60-
<size key="maxSize" width="463" height="170"/>
57+
<size key="maxSize" width="463" height="207"/>
6158
<color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
6259
<size key="minSize" width="390" height="170"/>
63-
<size key="maxSize" width="463" height="170"/>
60+
<size key="maxSize" width="463" height="207"/>
6461
</textView>
6562
</subviews>
6663
<animations/>

osx/installerplugins/overviewplugin/overviewpluginPane.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#import <InstallerPlugins/InstallerPlugins.h>
1010

1111
@interface overviewpluginPane : InstallerPane
12-
- (IBAction)checkboxChanged:(id)sender;
1312
@property (unsafe_unretained) IBOutlet NSTextView *textView;
1413
@property (weak) IBOutlet NSButton *checkbox;
1514
@end
Binary file not shown.
Binary file not shown.

osx/mpkg/Resources/en.lproj/Installed.html

Lines changed: 0 additions & 14 deletions
This file was deleted.

windows/Toolbox.iss

Lines changed: 21 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ Source: ".\start.sh"; DestDir: "{app}"; Flags: ignoreversion; Components: "Docke
6969
Source: ".\delete.sh"; DestDir: "{app}"; Flags: ignoreversion; Components: "Docker"
7070
Source: "{#dockerMachineCli}"; DestDir: "{app}"; Flags: ignoreversion; Components: "DockerMachine"
7171
Source: "{#dockerComposeCli}"; DestDir: "{app}"; Flags: ignoreversion; Components: "DockerCompose"
72-
Source: ".\migrate.sh"; DestDir: "{app}"; Flags: ignoreversion; Components: "DockerMachine"
73-
Source: ".\migrate.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: "DockerMachine"
7472
Source: "{#kitematic}\*"; DestDir: "{app}\kitematic"; Flags: ignoreversion recursesubdirs; Components: "Kitematic"
7573
Source: "{#b2dIsoPath}"; DestDir: "{app}"; Flags: ignoreversion; Components: "DockerMachine"; AfterInstall: CopyBoot2DockerISO()
7674
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
9896
9997
var
10098
restart: boolean;
101-
TrackingDisabled: Boolean;
99+
TrackingDisabled: Boolean;
102100
TrackingCheckBox: TNewCheckBox;
103101
104102
function uuid(): String;
@@ -140,15 +138,20 @@ begin
140138
end;
141139
end;
142140
143-
procedure TrackEvent(name: String);
141+
procedure TrackEventWithProperties(name: String; properties: String);
144142
var
145143
payload: String;
146144
WinHttpReq: Variant;
145+
tracking: String;
147146
begin
148147
if TrackingDisabled or WizardSilent() then
149148
exit;
149+
150+
if Length(properties) > 0 then
151+
properties := ', ' + properties;
152+
150153
try
151-
payload := Encode64(Format(ExpandConstant('{{"event": "%s", "properties": {{"token": "{#MixpanelToken}", "distinct_id": "%s", "os": "win32", "os version": "%s", "version": "{#MyAppVersion}"}}'), [name, uuid(), WindowsVersionString()]));
154+
payload := Encode64(Format(ExpandConstant('{{"event": "%s", "properties": {{"token": "{#MixpanelToken}", "distinct_id": "%s", "os": "win32", "os version": "%s", "version": "{#MyAppVersion}" %s}}'), [name, uuid(), WindowsVersionString(), properties]));
152155
WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1');
153156
WinHttpReq.Open('POST', 'https://api.mixpanel.com/track/?data=' + payload, false);
154157
WinHttpReq.SetRequestHeader('Content-Type', 'application/json');
@@ -157,9 +160,9 @@ begin
157160
end;
158161
end;
159162
160-
function NeedRestart(): Boolean;
163+
procedure TrackEvent(name: String);
161164
begin
162-
Result := restart;
165+
TrackEventWithProperties(name, '');
163166
end;
164167
165168
function NeedToInstallVirtualBox(): Boolean;
@@ -186,17 +189,6 @@ begin
186189
Result := not DirExists('C:\Program Files\Git') or not FileExists('C:\Program Files\Git\git-bash.exe')
187190
end;
188191
189-
procedure TrackingCheckBoxClicked(Sender: TObject);
190-
begin
191-
if TrackingCheckBox.Checked then begin
192-
TrackingDisabled := False;
193-
TrackEvent('Enabled Tracking');
194-
end else begin
195-
TrackEvent('Disabled Tracking');
196-
TrackingDisabled := True;
197-
end;
198-
end;
199-
200192
procedure InitializeWizard;
201193
var
202194
WelcomePage: TWizardPage;
@@ -211,11 +203,10 @@ begin
211203
TrackingCheckBox.Top := WizardForm.WelcomeLabel2.Top + WizardForm.WelcomeLabel2.Height + 10;
212204
TrackingCheckBox.Left := WizardForm.WelcomeLabel2.Left;
213205
TrackingCheckBox.Width := WizardForm.WelcomeLabel2.Width;
214-
TrackingCheckBox.Height := 40;
206+
TrackingCheckBox.Height := 28;
215207
TrackingCheckBox.Caption := 'Help Docker improve Toolbox.';
216208
TrackingCheckBox.Checked := True;
217209
TrackingCheckBox.Parent := WelcomePage.Surface;
218-
TrackingCheckBox.OnClick := @TrackingCheckboxClicked;
219210
220211
TrackingLabel := TLabel.Create(WizardForm);
221212
TrackingLabel.Parent := WelcomePage.Surface;
@@ -226,8 +217,8 @@ begin
226217
TrackingLabel.Visible := True;
227218
TrackingLabel.Left := WizardForm.WelcomeLabel2.Left;
228219
TrackingLabel.Width := WizardForm.WelcomeLabel2.Width;
229-
TrackingLabel.Top := TrackingCheckBox.Top + TrackingCheckBox.Height + 20;
230-
TrackingLabel.Height := 300;
220+
TrackingLabel.Top := TrackingCheckBox.Top + TrackingCheckBox.Height + 5;
221+
TrackingLabel.Height := 50;
231222
232223
// Don't do this until we can compare versions
233224
// Wizardform.ComponentsList.Checked[3] := NeedToInstallVirtualBox();
@@ -245,7 +236,13 @@ end;
245236
function NextButtonClick(CurPageID: Integer): Boolean;
246237
begin
247238
if CurPageID = wpWelcome then begin
248-
TrackEvent('Continued from Overview');
239+
if TrackingCheckBox.Checked then begin
240+
TrackEventWithProperties('Continued from Overview', '"Tracking Enabled": "Yes"');
241+
TrackingDisabled := False;
242+
end else begin
243+
TrackEventWithProperties('Continued from Overview', '"Tracking Enabled": "No"');
244+
TrackingDisabled := True;
245+
end;
249246
end;
250247
Result := True
251248
end;
@@ -329,49 +326,6 @@ begin
329326
Result := true
330327
end;
331328
332-
function MigrateVM() : Boolean;
333-
var
334-
ResultCode: Integer;
335-
begin
336-
if NeedToInstallGit() or NeedToInstallVirtualBox() or not FileExists(ExpandConstant('{app}\docker-machine.exe')) then begin
337-
Result := true
338-
exit
339-
end;
340-
341-
ExecAsOriginalUser(VBoxPath() + 'VBoxManage.exe', 'showvminfo default', '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
342-
if ResultCode <> 1 then begin
343-
Result := true
344-
exit
345-
end;
346-
347-
ExecAsOriginalUser(VBoxPath() + 'VBoxManage.exe', 'showvminfo boot2docker-vm', '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
348-
if ResultCode <> 0 then begin
349-
Result := true
350-
exit
351-
end;
352-
353-
TrackEvent('Boot2Docker Migration Started');
354-
WizardForm.StatusLabel.Caption := 'Migrating Boot2Docker VM...'
355-
WizardForm.FilenameLabel.Caption := 'This will take a minute...'
356-
ExecAsOriginalUser(ExpandConstant('{app}\docker-machine.exe'), ExpandConstant('rm -f default > nul 2>&1'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
357-
DelTree(ExpandConstant('{userdocs}\..\.docker\machine\machines\default'), True, True, True);
358-
ExecAsOriginalUser(ExpandConstant('{app}\migrate.bat'), ExpandConstant('> {localappdata}\Temp\toolbox-migration-logs.txt 2>&1'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
359-
if ResultCode = 0 then
360-
begin
361-
TrackEvent('Boot2Docker Migration Succeeded');
362-
MsgBox('Succcessfully migrated Boot2Docker VM to a Docker Machine VM named "default"', mbInformation, MB_OK);
363-
end
364-
else begin
365-
TrackEvent('Boot2Docker Migration Failed');
366-
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);
367-
Exec(ExpandConstant('{win}\notepad.exe'), ExpandConstant('{localappdata}\Temp\toolbox-migration-logs.txt'), '', SW_SHOW, ewNoWait, ResultCode)
368-
Result := false
369-
WizardForm.Close;
370-
exit;
371-
end;
372-
Result := true
373-
end;
374-
375329
const
376330
ModPathName = 'modifypath';
377331
ModPathType = 'user';
@@ -390,6 +344,7 @@ begin
390344
Success := True;
391345
if CurStep = ssPostInstall then
392346
begin
347+
trackEvent('Installing Files Succeeded');
393348
if IsTaskSelected(ModPathName) then
394349
ModPath();
395350
if not WizardSilent() then
@@ -399,9 +354,6 @@ begin
399354
if CanUpgradeVM() then begin
400355
Success := UpgradeVM();
401356
end;
402-
// else begin
403-
// Success := MigrateVM();
404-
// end;
405357
end;
406358
end;
407359

windows/migrate.bat

Lines changed: 0 additions & 4 deletions
This file was deleted.

windows/migrate.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)