I cannot simply remove the registry key.
I've written an executable tool to handle the clean up but run into the issue that the entire key (as well as dozens of others) under HKCU are not readable during the uninstallation; I've written a vb script to test whether the key is readable at different times during the uninstallation as well and cannot seem to find them if my action is run as deferred or commit.
If I run the vbscript or .exe on their own, everything works as expected. I imagine my issue is that msiexec is locking out these keys (for some reason I cannot understand as only 1 of them is relevant to my application), but was wondering whether there is a well known timing for registry value edits?
Of note: the HKLM hive doesn't give me any problems.
The vbscript I'm running to test the readability of the key:
Code: Select all
option explicit
dim oShell, sKey, strKeyPath, reg, strComputer
Const HKEY_CURRENT_USER = &H80000001
strKeyPath = "Software"
strComputer = "."
Set reg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&_
strComputer & "\root\default:StdRegProv")
EnumerateKeys HKEY_CURRENT_USER, strKeyPath
Sub EnumerateKeys(hive, key)
Dim success, arrSubKeys, subkey
success = reg.EnumKey(hive, key, arrSubKeys)
If Not IsNull(arrSubKeys) Then
For Each subkey In arrSubKeys
If subkey = "MyKey" Then
MsgBox subkey
End If
Next
End If
End Sub
FOLLOW US
Get the latest news in Application Packaging