Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

Commit

Permalink
re-write the [Run] section using inno-script
Browse files Browse the repository at this point in the history
So we can control exactly when it runs. Now we only install
vbox or msys if they are missing from the system.

And thus updating vbox doesn't fall afoul of the 'cannot find kernel
driver' issue on upgrade, and msys doesn't fail because the explorer
addin is loaded.

much much YAY
  • Loading branch information
SvenDowideit committed May 21, 2014
1 parent 48a6407 commit bf6294c
Showing 1 changed file with 78 additions and 13 deletions.
91 changes: 78 additions & 13 deletions Boot2Docker.iss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
SetupIconFile=boot2docker.ico
DisableProgramGroupPage=yes
DisableReadyPage=yes

AppId={{05BD04E9-4AB5-46AC-891E-60EA8FD57D56}
AppCopyright=Docker Project
Expand Down Expand Up @@ -51,14 +53,14 @@ Source: "C:\Users\svend_000\windows-installer\start.sh"; DestDir: "{app}"; Flags
Source: "C:\Users\svend_000\windows-installer\delete.sh"; DestDir: "{app}"; Flags: ignoreversion

; msys-Git
Source: "C:\Users\svend_000\windows-installer\msys-Git\Git-1.9.0-preview20140217.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\msys-Git\Git-1.9.0-preview20140217.exe"; DestDir: "{app}"; Flags:

;VirtualBox - 64 bit only
;https://forums.virtualbox.org/viewtopic.php?f=3&t=21127
Source: "C:\Users\svend_000\windows-installer\VirtualBox\VirtualBox-4.3.10-r93012-MultiArch_amd64.msi"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\VirtualBox\common.cab"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\VirtualBox\VirtualBox-4.3.10-r93012-MultiArch_amd64.msi"; DestDir: "{app}"; Flags:
Source: "C:\Users\svend_000\windows-installer\VirtualBox\common.cab"; DestDir: "{app}"; AfterInstall: VBoxInstalled()
; the cert http://www.catonrug.net/2013/03/virtualbox-silent-install-store-oracle-certificate.html
Source: "C:\Users\svend_000\windows-installer\VirtualBox\oracle-vbox.cer"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\VirtualBox\oracle-vbox.cer"; DestDir: "{app}"; AfterInstall: MSYSInstalled()

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

Expand All @@ -71,20 +73,83 @@ Name: "{commonprograms}\Boot2Docker Start"; WorkingDir: "{app}"; Filename: "{app
Name: "{group}\Delete Boot2Docker VM"; WorkingDir: "{app}"; Filename: "{app}\delete.sh"
Name: "{group}\Unix Bash"; Filename: "C:\Program Files (x86)\Git\bin\sh.exe"; Parameters: "--login -i"; Flags: dontcloseonexit

[Run]
; http://unattended.sourceforge.net/installers.php
; sadly, the auto-checkbox Flag: postinstall also means that its run after the final b2d install screen, which is not what we want.
; TODO: unwrap the msys-git installer and just include it into this one.
Description: "Install MSYS-git UNIX-like environment (Required)"; StatusMsg: "Installing MSYS-git UNIX-like environment"; Filename: "{app}\Git-1.9.0-preview20140217.exe"; Parameters: "/sp- /verysilent /norestart"; Flags: runhidden
StatusMsg: "Installing vbox cert"; Filename: "certutil"; Parameters: "-addstore ""TrustedPublisher"" oracle-vbox.cer"; Flags: runhidden
Description: "Install VirtualBox virtualisation (Required)"; StatusMsg: "Installing VirtualBox virtualisation"; Filename: "msiexec"; Parameters: "/qn /i ""{app}\VirtualBox-4.3.10-r93012-MultiArch_amd64.msi"""; Flags:

[UninstallRun]
Filename: "{app}\delete.sh"

[Code]
var
restart: boolean;
function NeedRestart(): Boolean;
begin
Result := restart;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
WizardForm.FinishedLabel.Caption := 'Docker for Windows installation completed. The `Boot2Docker Start` icon on your desktop, and Program Files will initialise, start and connect you to your Boot2Docker virtual machine.';
end;
if CurPageID = wpSelectDir then
// to go with DisableReadyPage=yes and DisableProgramGroupPage=yes
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
else
WizardForm.NextButton.Caption := SetupMessage(msgButtonNext);
if CurPageID = wpFinished then
WizardForm.NextButton.Caption := SetupMessage(msgButtonFinish)
end;
//;[Run]
//; http://unattended.sourceforge.net/installers.php
//; sadly, the auto-checkbox Flag: postinstall also means that its run after the final b2d install screen, which is not what we want.
//; TODO: unwrap the msys-git installer and just include it into this one.
//;Description: "Install MSYS-git UNIX-like environment (Required)"; StatusMsg: "Installing MSYS-git UNIX-like environment"; Filename: "{app}\Git-1.9.0-preview20140217.exe"; Parameters: "/sp- /verysilent /norestart"; Flags: runhidden; Check: MSYSInstalled()
//;StatusMsg: "Installing vbox cert"; Filename: "certutil"; Parameters: "-addstore ""TrustedPublisher"" oracle-vbox.cer"; Flags: runhidden
//;Description: "Install VirtualBox virtualisation (Required)"; StatusMsg: "Installing VirtualBox virtualisation"; Filename: "msiexec"; Parameters: "/qn /i ""{app}\VirtualBox-4.3.10-r93012-MultiArch_amd64.msi"""; Check: VBoxInstalled()
procedure VBoxInstalled();
var
ResultCode: Integer;
begin
if GetEnv('VBOX_INSTALL_PATH') = '' then
begin
//MsgBox('installing vbox', mbInformation, MB_OK);
WizardForm.FilenameLabel.Caption := 'installing VirtualBox'
if Exec(ExpandConstant('msiexec'), ExpandConstant('/qn /i "{app}\VirtualBox-4.3.10-r93012-MultiArch_amd64.msi"'), '', SW_HIDE,
ewWaitUntilTerminated, ResultCode) then
begin
// handle success if necessary; ResultCode contains the exit code
//MsgBox('vbox installed OK', mbInformation, MB_OK);
end
else begin
// handle failure if necessary; ResultCode contains the error code
MsgBox('vbox install failure', mbInformation, MB_OK);
end;
restart := True;
end else begin
//MsgBox('NOT installing vbox', mbInformation, MB_OK);
end;
end;
procedure MSYSInstalled();
var
ResultCode: Integer;
begin
if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1') then
begin
//MsgBox('NOT installing msys', mbInformation, MB_OK);
end
else begin
//MsgBox('installing msys', mbInformation, MB_OK);
WizardForm.FilenameLabel.Caption := 'installing MSYS Git'
if Exec(ExpandConstant('{app}\Git-1.9.0-preview20140217.exe'), '/sp- /verysilent /norestart', '', SW_HIDE,
ewWaitUntilTerminated, ResultCode) then
begin
// handle success if necessary; ResultCode contains the exit code
//MsgBox('msys installed OK', mbInformation, MB_OK);
end
else begin
// handle failure if necessary; ResultCode contains the error code
MsgBox('msys install failure', mbInformation, MB_OK);
end;
end;
end;

0 comments on commit bf6294c

Please # to comment.