Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
c0f9dbde
Commit
c0f9dbde
authored
Sep 03, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/virtualbox: search VBOX_MSI_INSTALL_PATH [GH-1337]
parent
f0bc4fd0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
CHANGELOG.md
CHANGELOG.md
+2
-0
builder/virtualbox/common/driver.go
builder/virtualbox/common/driver.go
+21
-9
No files found.
CHANGELOG.md
View file @
c0f9dbde
...
...
@@ -33,6 +33,8 @@ BUG FIXES:
*
builder/parallels/all: Added some navigation keys [GH-1442]
*
builder/qemu: If headless, sdl display won't be used. [GH-1395]
*
builder/qemu: Use
`512M`
as
`-m`
default. [GH-1444]
*
builder/virtualbox/all: Search
`VBOX_MSI_INSTALL_PATH`
for path to
`VBoxManage`
on Windows. [GH-1337]
*
builder/virtualbox/all: Seed RNG to avoid same ports. [GH-1386]
*
builder/virtualbox/all: Better error if guest additions URL couldn't be
detected. [GH-1439]
...
...
builder/virtualbox/common/driver.go
View file @
c0f9dbde
...
...
@@ -55,15 +55,16 @@ func NewDriver() (Driver, error) {
// On Windows, we check VBOX_INSTALL_PATH env var for the path
if
runtime
.
GOOS
==
"windows"
{
if
installPath
:=
os
.
Getenv
(
"VBOX_INSTALL_PATH"
);
installPath
!=
""
{
log
.
Printf
(
"[DEBUG] builder/virtualbox: VBOX_INSTALL_PATH: %s"
,
installPath
)
for
_
,
path
:=
range
strings
.
Split
(
installPath
,
";"
)
{
path
=
filepath
.
Join
(
path
,
"VBoxManage.exe"
)
if
_
,
err
:=
os
.
Stat
(
path
);
err
==
nil
{
vboxmanagePath
=
path
break
}
vars
:=
[]
string
{
"VBOX_INSTALL_PATH"
,
"VBOX_MSI_INSTALL_PATH"
}
for
_
,
key
:=
range
vars
{
value
:=
os
.
Getenv
(
key
)
if
value
!=
""
{
log
.
Printf
(
"[DEBUG] builder/virtualbox: %s = %s"
,
key
,
value
)
vboxmanagePath
=
findVBoxManageWindows
(
value
)
}
if
vboxmanagePath
!=
""
{
break
}
}
}
...
...
@@ -84,3 +85,14 @@ func NewDriver() (Driver, error) {
return
driver
,
nil
}
func
findVBoxManageWindows
(
paths
string
)
string
{
for
_
,
path
:=
range
strings
.
Split
(
paths
,
";"
)
{
path
=
filepath
.
Join
(
path
,
"VBoxManage.exe"
)
if
_
,
err
:=
os
.
Stat
(
path
);
err
==
nil
{
return
path
}
}
return
""
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment