[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] Re: Attempts to install a Windows driver from WinPE

On 30/11/09 12:27, Ayal Baron wrote:
Now that I understand what you are trying to do (and I don't mean to discourage) but I believe you are going about this the wrong way.  A direct install of the driver probably does even more things which you are not aware of and are hardwired to the system drive (not through %SYSTEMDIR% and any other environment variable).
Just an example, Changing system environment variables require booting the machine (http://technet.microsoft.com/en-us/library/bb726962.aspx) this is the relevant excerpt:
Note: When you create or modify system environment variables, the changes take effect when you restart the computer. When you create or modify user environment variables, the changes take effect the next time the user logs on to the system.
In addition, if the device driver is installed under the "system" user's credentials then: you have to boot the machine after you change the environment variables (because they are loaded only once at boot and cannot be refreshed) and changing the systemdir for the entire machine and rebooting is probably not recommended.

In any event, in order to reverse engineer what is going on when the driver is installed you can probably use some "recording" applications (apps which install filter device drivers which monitor the registry and the hard drive, record changes and filter out known things which are irrelevant).
The next phase would be to inject the relevant files directly where they should be and make the relevant registry changes (for instance by loading the Hives as you did and running a script that changes the relevant entries).

The other possibility is as I mentioned before offline tools which already know how to do this (e.g. http://technet.microsoft.com/en-us/library/cc749465%28WS.10%29.aspx).

Changing environment variables/the registry are not directly what I'm trying to achieve. In fact, I'd prefer not to if it could be avoided. I'm just trying to install a driver in an offline guest.

I hadn't found pkgmgr.exe, however, I have found a post which suggests that peimg.exe can install drivers in an offline guest. I'm hoping to prove this this afternoon, although I have some other issues with VirtIO under windows in general to sort out first.

Reverse engineering would be an absolute last resort for me, so if either pkgmgr or peimg can do this, I think this is perfect. The host, which is probably not running Windows, boots a Windows PE appliance which contains pkgmgr and/or peimg, and the target drivers. It uses these to install them in the guest.

Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team

M:       +44 (0)7977 267231
GPG ID:  D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]