Tuesday, January 15, 2013

Error 1402.Could not open key: UNKNOWN\Components\XXXXXXXXXXXXXXXXXXXXXXXX

When attempting to install an msi you receive one of the following error messages: “Unable to open sub key” or “Error 1402.Could not open key:” or “Error 1402.Could not open key: UNKNOWN\Components\XXXXXXXXXXXXXXXXXXXXXXXX”

This is caused by incorrect registry permissions on the key described in the error message.   Usually the administrators group does not have access to the key. 

Of course the key UNKNOWN doesn't exist.  The key is actually here: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components

Most websites will tell you to run the following script, however it doesn't seem to be able to set the permissions properly in most cases I have seen.

cd /d "%ProgramFiles%\Windows Resource Kits\Tools"
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f
subinacl /subdirectories %SystemDrive% /grant=administrators=f /grant=system=f
subinacl /subdirectories %windir%\*.* /grant=administrators=f /grant=system=f
secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose

You can fix each individual key by taking ownership, and then granding Administrators permissions to the key manually.  The problem is that there are usually a large number of problematic keys, making fixing them one by one quite tedious.

Here are instructions to give administrators full rights to the everything under the Components key and restore ownership back to the default (SYSTEM):



1. Open Regedit, and browse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components.
2. Right-click the "Components" key and select "Permissions".
3. Click the "Advanced" button
4. Click the "Owner" tab
5. Click "Administrators", and check "Replace owner on subcontainers and objects.
6. Click Apply. You will receive an error that "Registry Editor could not set owner on the key currently selected, or some of its subkeys.".  This is normal, the owner was usually set regardless of this message
7. Click the Permissions tab
8. Check the "Replace all child object permissions with inheritable permissions from this object" item.
9. Click Apply, then click "Yes" to confirm.
10. Click the "Owner tab".
11. Click "Other users or groups", and enter "SYSTEM".
12. Check "Replace owner on subcontainers and objects".
13. Click OK and close Regedit.



Now you can attempt to install your software again, and it should work.

Tuesday, May 8, 2012

Windows 7 Install media command prompt hotkey

Boot to Windows 7 installation media.
At the "Install Windows" screen (the first screen), hit Shift+F10.  A command prompt will appear.

Tuesday, April 3, 2012

Zenoss / Windows Server 2008 WMI

I was getting the error "Could not read the Windows event log (NT_STATUS_ACCESS_DENIED). Check your username/password settings and verify network connectivity. " repeatedly on a few Windows Server 2008 machines.

I tested from a remote machine with wbemtest and received the message "Number: 0x80070005 Facility: Win32 Description: Access is denied.".

The user I was attempting to login with was a local administrator.

The culprit? User Account Control. After disabling UAC and restarting the server, I was able to use WMI remotely. It appears that UAC was authenticating the user at a non-elevated level, causing the security issue.

The idea of UAC is nice, but the execution is ugly.

Friday, March 2, 2012

MSI Error 1723: There is a problem with this windows installer package.

MSI file installation errors out with "1723: There is a problem with this windows installer package.". If you try to launch a .vbs file, you get the error message "Can't find script engine "VBScript" for script "filename""

This is caused by an invalid file specified in the following Registry Value:
HKEY_CLASSES_ROOT\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32\Default .

The value should, in most cases be "C:\Windows\system32\VBScript.dll"

In my case, it was set to "C:\Program Files\McAfee\VirusScan Enterprise\scriptsn.dll". Apparently this was leftover from a previously uninstalled copy of McAfee VirusScan Enterprise 8.7i, which we no longer use.

In order to edit the value, you should edit the permissions on "HKEY_CLASSES_ROOT\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32" to give Administrators Full Control.

Thursday, January 26, 2012

Repair Missing / Incorrect Product Name in HP Desktop BIOS.

The Product Name / SKU Number / Serial Number in an HP Desktop BIOS are not available for editing by default.

While in the bios, press Ctrl+A , and then go to Security>System ID's. The missing editable fields are now available for editing.
wmic csproduct get name

Windows command line to return Model Name from BIOS. Tested with HP Desktops / Laptops successfully.

Monday, August 15, 2011

Word Frequency Generator links

I just spent 30 minutes searching the web and found these two useful word list frequency generators:

http://rainbow.arch.scriptmania.com/tools/word_counter.html

http://writewords.org.uk/word_count.asp