Only offer to migrate if requirements are met

Signed-off-by: Jeffrey Morgan <jmorganca@gmail.com>
This commit is contained in:
Jeffrey Morgan 2015-08-12 15:09:06 -07:00
parent a3064d24cc
commit 05ca1fc9a7
1 changed files with 8 additions and 4 deletions

View File

@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Docker Toolbox" #define MyAppName "Docker Toolbox"
#define MyAppVersion "1.8.0" #define MyAppVersion "1.8.0b"
#define MyAppPublisher "Docker" #define MyAppPublisher "Docker"
#define MyAppURL "https://docker.com" #define MyAppURL "https://docker.com"
#define MyAppContact "https://docs.docker.com" #define MyAppContact "https://docs.docker.com"
@ -305,6 +305,12 @@ function MigrateVM() : Boolean;
var var
ResultCode: Integer; ResultCode: Integer;
begin begin
if not FileExists('C:\Program Files\Oracle\VirtualBox\VBoxManage.exe') or not FileExists(ExpandConstant('{app}\docker-machine.exe')) then
begin
Result := true
exit
end;
ExecAsOriginalUser('C:\Program Files\Oracle\VirtualBox\VBoxManage.exe', 'showvminfo default', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) ExecAsOriginalUser('C:\Program Files\Oracle\VirtualBox\VBoxManage.exe', 'showvminfo default', '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
if ResultCode <> 1 then if ResultCode <> 1 then
begin begin
@ -364,8 +370,6 @@ begin
if IsTaskSelected(taskname) then if IsTaskSelected(taskname) then
ModPath(); ModPath();
migrationSuccess:= true
if IsComponentSelected('DockerMachine') then
migrationSuccess:= MigrateVM(); migrationSuccess:= MigrateVM();
if migrationSuccess then if migrationSuccess then