From d1e0e955ab81dff7ceb0e88347bb6e78b7fbd909 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 31 Jul 2013 12:39:49 -0700 Subject: [PATCH] builder/vmware: verify various paths exist for Workstation --- builder/vmware/driver_workstation9.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/builder/vmware/driver_workstation9.go b/builder/vmware/driver_workstation9.go index f931050ba..46620d31c 100644 --- a/builder/vmware/driver_workstation9.go +++ b/builder/vmware/driver_workstation9.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "log" + "os" "os/exec" "path/filepath" "strings" @@ -104,6 +105,18 @@ func (d *Workstation9Driver) Verify() error { } } + if _, err := os.Stat(d.AppPath); err != nil { + return fmt.Errorf("VMware application not found: %s", d.AppPath) + } + + if _, err := os.Stat(d.VmrunPath); err != nil { + return fmt.Errorf("'vmrun' application not found: %s", d.VmrunPath) + } + + if _, err := os.Stat(d.VdiskManagerPath); err != nil { + return fmt.Errorf("'vmrun' application not found: %s", d.VdiskManagerPath) + } + // Check to see if it APPEARS to be licensed. if err := workstationCheckLicense(); err != nil { return err