I'm unsure whether I should put this question in Serverfault or Stackoverflow.
I'm developing a script (so 'press start->search
' is not an option) and try to find out a way to find where an application was installed.
I already have the app SID. Looked at
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
and
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders
but it didn't help for this app.
Creeping through the whole registry I found this path:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\0019F09C4327ED11A893800002C0A966
Could anyone explain how can 0019F09C4327ED11A893800002C0A966
be calculated if I don't know it in advance?
I noticed that the key name here is mixed back-to-front application SID:
key 0E0D0A87 6588 CF44 08ED 156E22CA84C6
sid 78A0D0E0-8856-44FC-80DE-51E622AC486C
so I tried to search straight and reversed path numbers, just 0019F09C and reversed, but no luck.
In this question the application is PHP, but the solution should work for any app which is built according to MS rules (that is, don't just unzip itself somewhere but add proper data to the registry. I hope PHP do).
upd: screenshot to to Evan Anderson's answer