misheska / basebox-packer

Packer templates for vagrant baseboxes
286 stars 80 forks source link

Fixes #34, #35 add debugging vars, address powershell/slipstream issues #38

Closed rasa closed 10 years ago

rasa commented 10 years ago

Skip all .bat/.cmd scripts that start with an underscore (floppy/00-run-all-scripts.cmd) Added debug variables PACKER_DEBUG and PACKER_PAUSE (floppy/00-run-all-scripts.cmd) Moved A:\ to end of the PATH, to give precendence to installed applications (floppy/00-run-all-scripts.cmd) Search for tee.exe in the PATH first, before looking in A:\ (floppy/00-run-all-scripts.cmd) Removed extra " char in junction command (floppy/openssh.bat) Replace IF with GOTO to avoid delayed expansion issues, and to easily add future provisioners (script/provisioner.bat) Replace all ! with % as appropriate Use wget or bitsadmin, if found in the PATH, or on A:\, otherwise use powershell Skip downloading any file if it's found on a:\, d:\ or in the PATH This addresses the following issues after slipstreaming Windows updates into installation media: After installing all Windows and .Net 3.51 updates, running powershell during installation would produce: "Version v4.0.30319 of the .NET Framework is not installed and it is required to run version 3 of Windows PowerShell." After installing all Windows and .Net 3.51 updates, and then .NET 4.51 (NDP451-KB2858728-x86-x64-AllOS-ENU.exe), running powershell during installation would produce: "Internal Windows PowerShell error. Loading managed Windows PowerShell failed with error 80070002."

rasa commented 10 years ago

I'm working on this PR as I just saw this sillyness when running scripts/vagrant.bat:

    vmware: BITSADMIN version 3.0 [ 7.7.9600 ]
    vmware: BITS administration utility.
    vmware: (C) Copyright 2000-2006 Microsoft Corp.
    vmware:
    vmware: BITSAdmin is deprecated and is not guaranteed to be available in future versions of Windows.
    vmware: Administrative tools for the BITS service are now provided by BITS PowerShell cmdlets.
    vmware:
    vmware: Unable to add file - 0x800704dd
    vmware: The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist.
    vmware:
rasa commented 10 years ago

And now this:

    vmware: C:\Users\vagrant>powershell -Command "(New-Object System.Net.WebClient).DownloadFile...
    vmware: Exception calling "DownloadFile" with "2" argument(s): "An exception occurred
    vmware: during a WebClient request."
    vmware: At line:1 char:1
    vmware: + (New-Object
    vmware: System.Net.WebClient).DownloadFile('http://downloads.sourceforge.net ...
    vmware: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    vmware: ~~~
    vmware: + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    vmware: + FullyQualifiedErrorId : WebException

God, Windows is so fragile.

rasa commented 10 years ago

After I complete my testing, I will push a new PR soon, that will recreate this PR from the current master.