Saturday, February 28, 2015

Patience

Lately, I've had this annoying issue where Windows would resize my desktop and all open windows to my old monitor's resolution when waking from sleep. Normally, I wouldn't care, but this resolution roulette resulted in my desktop icons always being off by one. Constantly correcting them wasn't going to fly. It didn't help that my "restored" window sizes were off and tucked into the top left corner.

I tried sifting through the Registry to find keyvalues containing the old resolution and found a few promising entries. So, after making a backup, I changed them to the new resolution, rebooted, and...no dice. There were dozens more entries that matched the raw numbers, but the Registry is a big place and I'd rather not get lost in it and break something.

I figured the issue was Windows falling back to the old monitor's details when I killed my current monitor before my machine finished going to sleep. So, I left it on while my machine slept. The issue persisted.

Next up was uninstalling all old, unconnected hardware. Normally, Device Manager doesn't show disconnected hardware. However, Microsoft implemented a flag to force it to show: devmgr_show_nonpresent_devices. After setting this to 1 in an elevated command prompt window and launching devmgmt.msc, I expanded the Monitors category and removed my old monitor. This had a result, but not one I was hoping for. By removing the only other monitors it knew, I caused Windows to use its default, works-with-all resolution (640x480, I believe). Now, my icons were going every which way and my program windows were really out of whack.

Searching the Net for this issue resulted in a forum post claiming reinstalling graphics drivers. Okay. I grabbed the latest nVidia drivers and ran the installer. After hitting "Next" to proceed to selecting an installation type, the installer froze but didn't go unresponsive. So, I clicked "Next" again...only for it to register both clicks, go for a full installation, and install things I didn't want (GeForce Experience, Update Core, 3D Vision, etc).

Seeing this, I immediately killed the installer, but not before it had mucked with the graphics driver. Running the installer again demanded a restart of my machine to "complete" the previous install. Fine. A quick reboot later and the installer was more than happy to run. It did the little freeze again, but, having learned my lesson, I left it to its own devices (no pun intended). I carefully and deliberately chose "Custom install" and filtered out what I didn't want. So, naturally, it ignored my selections and installed everything.

A reboot later to apply the driver, I found all manner of services and processes bearing nVidia's name. These extra programs installed with the driver had entries in Programs and Features, so I thought I'd start with uninstalling GeForce Experience. I got the usual "Are you sure" and "Uninstall complete" messages and figured I should reboot to make sure it took effect. Nope. The process, files, and uninstaller entry were still there. I could run the uninstall as many times as I wanted and nothing would happen.

Having unselected PhysX from previous installs when versions matched, I'd observed that would result in uninstalling it instead of leaving it alone. Applying this logic to the rest of the packages, I figured unchecking them would uninstall them as well. Nope. Nothing uninstalled. It would run the installers for what I checked, but wouldn't uninstall what I unchecked. At one point, it didn't even detect those packages as installed.

So, I deleted the 32bit files for the GeForce Experience, realized it was a 64bit process, and deleted those too. I got the expected "Can't delete file in use" error, killed the offending process, and rebooted. That killed the process, but the uninstall entry for it was still present, functional, and giving me a placebo of an uninstall routine. I tried PhysX, Update.Core and the other entries, and they too wouldn't uninstall. Although, some did give a "I can't do that, Dave" message.

Another web search revealed uninstalling the devices via Device Manager would remove the lock and allow the software to uninstall. That didn't work. While the device was uninstalled, the driver remained in Windows' driver store. I tried removing them again and checked the box to remove them from my machine completely.

Upon reboot, the previous versions of the drivers came back, installed, and halted my progress again. Losing my temper, I killed all nVidia processes, forcibly killed Windows' driver installer, uninstalled the devices again (but didn't reboot), and proceeded to obliterate any and all driver package files in Program Files, Program Files x86, and the Registry. Reckless, yes, but I had a good idea of what to look for from mucking around Windows for so long (essentially entries in HKLM\System\CurrentControlSet\Services keys prefixed with "nv" that weren't related to motherboard chipset drivers, HKLM\Software\Nvidia Corporation, HKCU\Software\Nvidia Corporation, etc).

Yet another reboot later and nothing nVidia was running, except I still had nVidia service entries in the Windows Management Console. Three were missing their support data, but the GeForce Experience entry was still pulling info from somewhere. I've mucked with starting/stopping services in Windows from command line before, but there was a function I never bothered looking for: delete. So, I queried all services regardless of state, piped them to a text file (sc queryex type= service state= all > C:\services.log), looked for any DISPLAY_NAME entries containing "nVidia", grabbed their associated SERVICE_NAME, and deleted them using "sc delete SERVICE_NAME". To take care of the Uninstaller entries, I pulled up CCleaner and deleted them.

Incrementing my reboot count again resulted in a machine apparently free of what the GeForce Driver installer put on it. I had to put the driver back on (because not doing so would make my graphics card a pointless power draw), but to ensure I didn't wind up in the same situation, I employed a trick I learned last year: Delete things you don't want to install from the extracted driver package. Let it self-extract, kill the installer, go to the extracted location, and remove all files and folders you don't want the installer to detect (it's surprisingly flexible). This resulted in an install of what I wanted (Graphics driver, PhysX, and HD audio driver) and nothing else. I missed the Update.Core uninstaller entry on a previous reboot, but a quick summon of CCleaner took care of that.

To note: I had no real use for the additional software nVidia provides with drivers. I don't care about 3D vision, don't have a Shield, don't stream, and I use AfterBurner if I want to record gameplay. There was no real hatred toward the software packages. Now, I'm a bit miffed. Did the initial aborted install really put all nVidia software into this state? How could that pass test? If the abort wasn't the cause, how could non-functional uninstall routines pass test? Do they even test? Do they assume no one would ever want to uninstall their software and, therefore, that aspect doesn't need to be tested?

Now I wait to see if my machine goes bonkers or if my directed reckless removal was nice and clean. I'm not on it right now, so I still don't know if my blasted desktop is fixed or if Windows will continue to bounce between resolutions. Should this fail, I'll have to try HDMI and DVI as it could be DisplayPort causing a problem (I had to reset my monitor and the nVidia Control Panel as well as physically remove my old monitor to get rid of weird colors and artifacting on initial install).

No comments:

Post a Comment