I work for a Test and Measurement company. We write software that installs either on an embedded instrument and a PC and can be used to control USB measurement devices. There are quite a number of pieces of software that must be installed in order to make this work - USB drivers, specialized IO software, licensing libraries, etc. In addition we must coexist with other company's software.
We sometimes have problems that are caused by other vendors software (VISA libraries, most notably) and by different versions of our own supporting software - we install version M of our IO software but another program written by my company may use install a later version N. Sometimes it works, sometimes it doesn't. When it doesn't we frequently ask our customers for a list of all software installed on their systems which is more often than not incomplete.
It occurred to me that I can use an InstallShield prerequisite to run a PowerShell script when we release a new version of our software to capture the installed software list by dumping the Uninstall keys in the registry. I have this working, but there's a problem that I just can't figure out. I'm hopeful that someone here has a thought that can help me understand what is going on.
The PS script does essentially this:
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
This is captured as HTML for readability. The output contains the name of the installed s/w, version, and installation date, and it works pretty well except for two pieces of software that my company writes, call them Foo and Bar. Those two entries are simply missing, and yet all the rest of the S/W on the system, including others written by us are present.
To check that the PS script is doing the right thing, I added 4 "reg query" commands that dump the same registry keys and run immediately before the PS code.
reg query hkey_local_machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s > hklm_uninstall.txt
reg query hkey_local_machine\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall /s > hklm_woww6432node_uninstall.txt
reg query hkey_current_user\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s > hklm_uninstall.txt
reg query hkey_current_user\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall /s > hkcu_woww6432node_uninstall.txt
The results are the same - Foo and Bar are missing.
Now here's the puzzling thing: when I run this same script from a command or PowerShell window, Foo and Bar are present along with everything else.
I've thought this might be an artifact of InstallShield running as a 32 bit process but the output is dumping all other keys from all four registry keys and the keys live in the 64 bit registry. The keys for Foo and Bar can be seen in both HKLM and HKCU in the appropriate place when viewed in RegEdit.
Does anyone have a clue as to what might be going on here? I'm flummoxed.