joefitzgerald / packer-windows

Windows Packer Templates
MIT License
1.63k stars 1.12k forks source link

Windows 10 + installing MSI's #170

Closed jcoutch closed 8 years ago

jcoutch commented 9 years ago

When working with Windows 10 and attempting to provision a VM, I noticed that when it attempts to install 7Zip to unzip various packages in the final steps (i.e. SDelete), I'm getting:

"The Windows Installer Service could not be accessed. This can occur if the Windows Installer is not correctly installed. Contact your support personnel for assistance."

If I run the MSI directly, it works fine. It's only when calling msiexec directly with the /qb flag that it fails.

While I know this is more than likely a Windows 10 bug, I'm wondering if some of the steps during the provisioning process should be re-written to use a package manager like Chocolatey...at least for the 7Zip install. Thus far, I haven't had any issues installing Chocolatey packages...probably because it's installing the MSI in a different way.

Thoughts? If this sounds good, I can put together a PowerShell script and do a pull request.

StefanScherer commented 9 years ago

@jcoutch Haven't tried the Win10 template recently, but it worked some weeks ago.

After having a closer look at compact.bat I think of replacing the unzip part with Powershell. This three scripts vm-guest-tools.bat, rsync.bat and compact.bat download (and cache) and install and uninstall 7Zip. Only the first one really needs 7Zip to "uncompress" the ISO file. Something like this Powershell might work extracting the ZIPs: http://www.howtogeek.com/tips/how-to-extract-zip-files-using-powershell/

SDelete can also be downloaded as an uncompressed exe file from http://live.sysinternals.com/sdelete.exe

The base images should be smaller than bigger, so I think Chocolatey should not be part of the base box (although I usually add it with Vagrant).

sneal commented 8 years ago

I can't reproduce this using latest packer-windows master. Perhaps a recent Windows update fixed the issue?