mirror of
https://github.com/timsutton/brigadier.git
synced 2025-05-28 22:16:06 -04:00
Update README.md
- usage - details on Windows usage and file extraction
This commit is contained in:
parent
1c6f739d8f
commit
13112c194d
1 changed files with 30 additions and 5 deletions
35
README.md
35
README.md
|
@ -2,7 +2,7 @@
|
|||
|
||||
A Windows- and OS X-compatible Python script that fetches, from Apple's or your software update server, the Boot Camp ESD ("Electronic Software Distribution") for a specific model of Mac. It unpacks the multiple layers of archives within the flat package and if the script is run on Windows with the `--install` option, it also runs the 64-bit MSI installer. It currently _does not_ support installation on 32-bit Windows.
|
||||
|
||||
On Windows, the archives are unpacked using [7-Zip](http://www.7-zip.org) and [dmg2img](http://vu1tur.eu.org/tools), so these are downloaded and installed (and removed later) as needed. 7-Zip can convert .dmgs to ISOs as well, however I experienced inconsistent results across different currently-offered BootCampESD.pkgs, and haven't had any issues with dmg2img.
|
||||
On Windows, the archives are unpacked using [7-Zip](http://www.7-zip.org) and [dmg2img](http://vu1tur.eu.org/tools), so these are downloaded and installed (and removed later) as needed. 7-Zip can convert .dmgs to ISOs as well, however I experienced inconsistent results across different currently-offered BootCampESD.pkgs, and haven't had any issues with dmg2img. More details on the extraction on Windows can be found below.
|
||||
|
||||
This was written for two reasons:
|
||||
|
||||
|
@ -11,17 +11,29 @@ This was written for two reasons:
|
|||
|
||||
It was originally designed to be run as post-imaging step for Boot Camp deployments to Macs, but as it requires network connectivity, a network driver must be already available on the system. (See Caveats below)
|
||||
|
||||
## Usage
|
||||
|
||||
Run brigadier with no options to download and unpack the ESD that applies to this model, to the current working directory. On OS X, the ESD is kept in a .dmg format for easy burning to a disc; on Windows, the driver files are extracted.
|
||||
|
||||
Run it with the `--model` option to specify an alternate model, in the form `MacPro3,1`, etc.
|
||||
|
||||
Run it with the `--install` option to download and install it, deleting the drivers after installation. This obviously works only on Windows.
|
||||
|
||||
Place a `brigadier.plist` file in the same folder as the script to override the .sucatalog URL to point to an internal Software Update Server catalog (details below).
|
||||
|
||||
Additional options shown below.
|
||||
|
||||
## Windows requirements
|
||||
|
||||
You'll either need [Python for Windows](http://www.python.org/download/releases) (this was tested with the latest 2.7 release) in order to execute the script, or a tool like [PyInstaller](http://www.pyinstaller.org), which can compile the interpreter and script together into a single executable.
|
||||
You can find a pre-compiled binary of the most recent [release version](https://github.com/timsutton/brigadier/blob/master/VERSION) [here](https://dl.dropbox.com/u/429559/brigadier.zip) (sha1 189fa1b8f8267bb7bcb882e1becdc9e18c20f48a). This was built using [PyInstaller](http://www.pyinstaller.org).
|
||||
|
||||
You can find a pre-compiled 32-bit binary (which will run on 64-bit Windows) of the most recent [release version](https://github.com/timsutton/brigadier/blob/master/VERSION) [here](https://dl.dropbox.com/u/429559/brigadier.zip) (sha1 189fa1b8f8267bb7bcb882e1becdc9e18c20f48a).
|
||||
If you'd rather run it as a standard Python script, you'll need [Python for Windows](http://www.python.org/download/releases) (this was tested with the latest 2.7 release) in order to execute the script.
|
||||
|
||||
If you'd rather build it yourself using PyInstaller, install Python, PyInstaller and the appropriate version of [pywin32](http://sourceforge.net/projects/pywin32/files), then build a "single file deployment" with PyInstaller:
|
||||
If you'd rather build it yourself using PyInstaller, install [Python](http://www.python.org/download/releases), [PyInstaller](http://www.pyinstaller.org) and the appropriate version of [pywin32](http://sourceforge.net/projects/pywin32/files), then build a "single file deployment" with PyInstaller:
|
||||
|
||||
`%SystemRoot%\Python27\python \path\to\pyinstaller\pyinstaller.py -F \path\to\brigadier`
|
||||
|
||||
The resultant file should be in the `dist` folder created in the working directory.
|
||||
The resultant file, `brigadier.exe`, should be in the `dist` folder created in the working directory.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
@ -54,9 +66,22 @@ There is one workaround performed by the script when running in this scenario, w
|
|||
|
||||
By default, when `--install` is used, it will clean up its extracted files after installation, unless the `--leave-files` option is given, so unless you want to keep the files around you shouldn't need to clean up after it.
|
||||
|
||||
## Unpack details on Windows
|
||||
|
||||
On OS X, we have the native hdiutil and pkgutil commands to do the work of unpacking the driver files. On Windows, we:
|
||||
|
||||
1. Check if 7-Zip is already installed - if not, we download and install it
|
||||
2. Download dmg2iso and store it in a temporary directory
|
||||
2. Extract the BootCampESD.pkg xar archive with 7-Zip
|
||||
3. Extract the Payload archive with 7-Zip, once to decompress gzip and again to unpack the cpio archive
|
||||
4. Use dmg2iso to convert the resultant WindowsSupport.dmg to an ISO
|
||||
5. Use 7-Zip to extract the driver files from the ISO
|
||||
6. Uninstall 7-Zip if we installed it
|
||||
|
||||
## Caveats
|
||||
|
||||
* It requires an internet connection, which therefore requires that a working network driver be available. The simplest way I've found to do this is to place the various network drivers from BootCampESDs inside a "BootCamp" (or similar) folder within `C:\Windows\INF`. This folder is the default search location for device drivers, and it should automatically detect and install drivers located here for all unknown hardware. You can also modify the `DevicePath` [registry key](http://technet.microsoft.com/en-us/library/cc731664(v=ws.10).aspx) to add a custom location, but using the existing `INF` folder means no other changes besides a file copy are required to update an existing image's drivers, so this can be done without actually restoring the image and booting it just to install a driver.
|
||||
* It currently performs almost no error handling.
|
||||
* The 7-Zip and dmg2iso tools download from URLs hardcoded in the script. Soon the `brigadier.plist` will support overriding these URLs with your own copies stored on a private webserver.
|
||||
* After installation, it sets the `FirstTimeRun` registry key at `HKEY_CURRENT_USER\Software\Apple Inc.\Apple Keyboard Support` to disable the first-launch Boot Camp help popup, and there's currently no option to disable this behaviour.
|
||||
* Only tested on 64-bit Windows 7. It's worth mentioning that the December 2012 Boot Camp driver ESDs seem to be 64-bit only, so extra work would need to be done to support 32-bit Windows.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue