Today's post is a bit of a rant. Also, it took me so long to write, that I didn't want to spend much more time formatting it. So, if it looks a bit messy, I'll try to get back and clean it up a bit later. If you've been reading my blog, you know that I'm in the process of a network deployment. Recently, we qualified for a (basically, free) computer form UPS. Unfortunately, all they had to offer were machines with AMD processors and chipsets. If you haven't guessed it by now, I'm an Intel guy. And now, I know why.
The Problem with AMD
Apparently, AMD doesn't want to make it easy for (particularly small) business to install their software. This is evidenced by the fact that they have completely non-standard Windows installers. They probably use InstallShield for some of their software (which, arguably, makes horrible installers, in my opinion, after having looked at just a few InstallShield MSIs with ORCA from Microsoft). However, their Catalyst Display Driver package uses something called Monet, which until last week, I've never heard of before. And let me say that I hope I never hear of it again, as it caused me nothing but trouble this week.
The idea is that I'm using the Microsoft Deployment Toolkit 2008 to deploy my clients. This driver comes with software that I would like to have installed on the machine, so I decided to go ahead and install the whole package (minus a few items that I really don't need). But it turned out to be a real chore. To start, there is the lack of documentation. Here's the help documentation from Setup.exe and InstallManagerApp.exe, which are responsible for the GUI installation:
Figure 1. Setup.exe/InstalManagerApp.exe command-line switches Well, I'm confused already. But here's what happens. If you use the slash (/) switches, you can get an unattended GUI install. What do I mean? What I mean is, if you use the right combination of switches, you can achieve an unattended install that still shows a GUI. Ok, that's not so bad. Let's step through these switches a bit. By specifying /UNATTENDED_INSTALL, you would think that would be all I have to do to achieve my goal. Well, you would be wrong. Even when using this switch, the installer stops on the very first wizard page to ask what language you want. Why do I need to choose a language if I'm doing an unattended install? (More precisely, if no language is specified on the command line, English ought to be the default and installation should proceed unattended.) So, in order to get around this, we need to pass the /FORCE_HIDE_FIRST_RUN switch, which does just that—it skips the language selection step. So you run the new command and now the wizard appears to stop in its tracks on the last page and just sits there. That's because even during an "unattended" install, the setup program expects you to click the Finish button. Stupid. So we need to pass the /FORCE_CLOSE_WHEN_DONE switch. Just to be extra cautious, I pass the /AUTOACCEPT_ALL switch, which automatically accepts all EULAs (which according to AMD is supposed to be unpublished, hehe). I also pass the /ON_REBOOT_MESSAGE:NO switch to make sure the installer doesn't tell the operating system to reboot, a big no-no when using the Microsoft Deployment Toolkit. So our final command looks like this: setup.exe /UNATTENDED_INSTALL /FORCE_HIDE_FIRST_RUN /FORCE_CLOSE_WHEN_DONE /AUTOACCEPT_ALL /ON_REBOOT_MESSAGE:NO
.
Well now there are three problems. In older releases of the Catalyst Display Driver package, HydraVision was installed with everything else and the Windows Vista Experience Index score was also updated so that the Aero user interface would be enabled. This no longer happens in the 9.4 release of the package. It turns out they have a few errors in their new install routine. The lack of installation of HydraVision (a multi-desktop or even desktop spitting application) can be gotten around by replacing /UNATTENDED_INSTALL with /UNATTENDED_INSTALL:"\Packaes\Apps\CCC\HydraVision-Full\ccc-hv-full.msi;<driver_folder>\Packgaes".
Enabling the Aero user interface (in an unattended manner) is also similarly easy. In previous releases, there was an MSI called EnableAero.msi. At first, I was including this in the installation, but I soon realized that all the MSI was doing is running the following command: C:\Windows\System32\WinSat features
C:\Windows\System32\WinSAT formal
. So, number one, the EnableAero.msi installer is completely unnecessary. Secondly, the way they are running the command is also unnecessary. Instead, there is a command line switch that enables you to only update the graphics and restart the Display Window Manager: C:\Windows\System32\WinSAT dwm
.
Now we have achieved the following: an unattended installation (though, still showing a GUI) that installs HydraVision and enables the Aero user interface in Vista. But what if we want a truly silent install? Is this possible? Yes, it is. There are two ways of doing this.
First, there is a file called ATISetup.exe in the Bin{64} folder of the Catalyst Display Driver package. If you run this file without any command line options, you will see the following command line options (there are more, but for brevity, which it's already too late for, I'll omit the unimportant ones):
- -install
- Performs a silent install
- -uninstall [all]
- Performs a silent uninstall ([all] uninstalls all hidden packages)
- -output screen [detail]
- Screen outputs basic information to the console while including detail will output more verbose information. Useful for debugging.
- -h #### -v #### -b ## -j ###[ddc]
- Sets the horizontal resolution, vertical resolution, color depth (or bits per pixel (a/k/a bits per pel)), and vertical refresh rate. Using DDC for the vertical refresh rate tells the driver to get the information from the monitor via DDC or EDID, if the monitor supports it. Most LCDs in use do, as do most CRTs that are left in use. Also, be aware that the documentation for these switches is incorrect: -b only takes 2 digits, and -j can take 3. They have this reversed on their display of the help options (and thus, you can specify 120Hz refresh rate for your CRT if it supports it).
Here's the kicker: you try to run the following command: ATISetup -install -h 1280 -v 1024 -b 32 -j ddc
, and it doesn't work. The install occurs, but again, HydraVision is not installed, and when you reboot, the display defaults to a resolution of 800 x 600 @ 32-bits. Again, the problem with HydraVision can be fixed and the installer used, but not the screen resolution. For me, this is back to square one. Why did I go through all of this? To save you the trouble—and to pick on AMD.
So how do I get the driver to install, with all the companion applications, and have the screen resolution set to the desired size and enable the Aero user interface? It comes down to two lowly batch files (or in Vista world, a .cmd file).
First, we need to write the batch (or command) file that will install the driver and companion applications. Apparently, what really happens when you run the Setup.exe file in the root driver package with the -install switch, it just passes it onto the .\Bin{64}\ATISetup.exe installer. If you use the slash (/) switches, then the GUI installer is used (e.g. the GUI installer is shown, but is unattended if you use the switches I outlined above).
Here's the install batch file (I named it install.cmd):
NOTE: You may freely copy and use the batch file source code contained in Figures 2 and 3 of this blog entry without needing to give attribution. I hope someone may find it useful.
Figure 2. Install.cmd source code.This will (more or less) silently install the driver and all accompanying software that you chose. (NOTE: I removed the following folders from the \Packages\Apps directory: CatalystRegistration (a registration nag-ware) and Blizzard (an Internet shortcut to download a trial version of the game World of Warcraft.) Once this batch file has been executed, you need to restart the computer. (NOTE: if you are using the Microsoft Deployment Toolkit to deploy your operating system, you must tell MDT that the application requires a reboot and let MDT reboot the computer or you will mess up the automated deployment.)
Once the computer has rebooted, your video resolution will be 800x600 @ 32-bit. Unfortunately, Windows still does not have a way to "script" the video resolution through an API. No Windows Script interface, no WMI, no PowerShell. So we are left to "hacking" the Windows registry. Please note that the batch file below has only been tested on Windows Vista. For any other operating system, verify the keys that need to be set (perhaps the resolution switches only work for Windows XP and below?).
Figure 3. SetVideoRes.cmd source code.
The > nul
makes the batch script not output anything to the screen since REG.exe and WinSAT probably use stdout or stderr bypassing the @ECHO OFF
command in the batch file. I called this batch file SetVideoRes.cmd. It first uses REG QUERY to determine the GUID of the video card and stores it in a variable. Then it creates several registry entries in the registry pertaining to the display resolution. Finally, it runs the Windows System Assessment Tool to enable the Aero user interface. Once this script has run, the computer needs to be rebooted again so that Windows picks up the new display resolution settings. And finally, there you have it, a completely unattended installation of the Catalyst Display Driver package. Too much work. For Intel, this would have been as easy as calling setup /s /v/qn
if it's an InstallShield installer or <driver_installer>.msi /qn /norestart
if it were an actual Windows MSI.
I hope this helps someone out there. It took me a whole week, installing the operating system about 25 times to figure this all out. What a pain! I did contact AMD Customer Care, but they basically told me that they provided limited unattended install support and that they only supported unattended installs on Windows Vista for particular ATi products. Poor business practice, in my opinion. Not everyone is a Hewlett-Packard or a Microsoft.
One final note, I just finished a book on microformats on the web. This blog entry is long enough, so suffice it to say, I've tried my hand at a few hCard entries in this post. Not every company mentioned has an hCard entry. I may go back and update this entry later. I mention this only for those who may be looking. I'm going to write more about that in another post.
That's it for now. Sorry it was so long. Take care.
Updates
- 2009-05-14 - Fixed code in SetVideoRes.cmd in figure 3: Added quotes around the registry key because the keyname has a space. Also removed the warning about testing on Vista. I have tested the code and it does work. However, it should go without saying that anything you take off the Internet should be tested in a secure, isolated environment before being put into production. Also fixed my SetVideoRes.cmd batch file to call
C:\Windows\System32\WinSAT formal
to make sure that the experience score actually gets updated in the System display window.