2018-04-11 17:20:17 +02:00
|
|
|
if not exist "C:\Windows\Temp\7zInstaller-x64.msi" (
|
|
|
|
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z1604-x64.msi', 'C:\Windows\Temp\7zInstaller-x64.msi')" <NUL
|
2016-08-30 17:53:02 +02:00
|
|
|
)
|
2018-04-11 17:20:17 +02:00
|
|
|
msiexec /qb /i C:\Windows\Temp\7zInstaller-x64.msi
|
2016-08-30 17:53:02 +02:00
|
|
|
|
|
|
|
if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
|
|
|
|
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
|
|
|
|
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
|
|
|
|
goto :done
|
|
|
|
|
|
|
|
:vmware
|
|
|
|
|
|
|
|
if not exist "C:\Windows\Temp\windows.iso" (
|
|
|
|
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.0.0/2985596/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
|
|
|
|
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
|
|
|
|
FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
|
|
|
|
rd /S /Q "C:\Program Files (x86)\VMWare"
|
|
|
|
)
|
|
|
|
|
|
|
|
cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
|
|
|
|
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"
|
|
|
|
|
|
|
|
goto :done
|
|
|
|
|
|
|
|
:virtualbox
|
|
|
|
|
2017-01-11 22:05:32 +01:00
|
|
|
move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
|
|
|
|
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
|
|
|
|
|
2016-08-30 17:53:02 +02:00
|
|
|
:: There needs to be Oracle CA (Certificate Authority) certificates installed in order
|
|
|
|
:: to prevent user intervention popups which will undermine a silent installation.
|
2017-01-11 22:05:32 +01:00
|
|
|
cmd /c certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha1.cer
|
2016-08-30 17:53:02 +02:00
|
|
|
|
|
|
|
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
|
|
|
|
goto :done
|
|
|
|
|
|
|
|
:parallels
|
|
|
|
if exist "C:\Users\vagrant\prl-tools-win.iso" (
|
|
|
|
move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
|
|
|
|
cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
|
|
|
|
cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
|
|
|
|
rd /S /Q "c:\Windows\Temp\parallels"
|
|
|
|
)
|
|
|
|
|
|
|
|
:done
|
2018-04-11 17:20:17 +02:00
|
|
|
msiexec /qb /x C:\Windows\Temp\7zInstaller-x64.msi
|