Trying to find the windows registry key(s) that
tell windows add/remove programs where Star Trek Legacy is installed.
I'm on windows 7 pro 32 bit, but this will need to be able to run on win xp, vista, 7 (32 or 64)
I'm writing a small Visual Basic program that is a GUI for editing files in Star Trek Legacy.
The problem I'm having is finding the install path of Star Trek Legacy so the program can
find all the files that can be edited.
I've searched through my registry for these key words:
Bethesda
Star Trek Legacy
Legacy.exe
Bethesda is the maker of Star Trek Legacy
It does not show up in:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Currentversion\Uninstall\
or anywhere else as a full path, there are some references left from when I edited some text files with text editors, but nothing that indicates it's full path:
F:\Program Files\Bethesda Softworks\Star Trek Legacy\
This path as default is C:\Program Files\Bethesda Softworks\Star Trek Legacy on most machines, but on mine I have it installed to F:\
Although, on a 64 bit system the path would be C:\Program Files (x86)\Bethesda Softworks\Star Trek Legacy\
I need my VB program to find the absolute install path to the user's Star Trek Legacy folder and check to see if Legacy.exe is inside it then proceed to load.
I already have this setup as asking the user to select the drive where they installed Star Trek Legacy then the program has a hard-coded path of:
"Program Files\Bethesda Softworks\Star Trek Legacy\"
But as I said, this will cause an issue if they are running 64bit since Program Files is Program Files (x86) on those systems and the hard-coded path will return an error.
I am at a loss since Star Trek Legacy is installed, and it has an icon on the desktop with the full path correct and it shows up in Add/Remove Programs and I can uninstall it through Add/Remove programs.
However, it does not show up in the registry anywhere. How is this possible? And how can I pull the same information that Add/Remove Programs does or the system does so that my program can find the correct path on any windows system and path
that Star Trek Legacy might be installed.
November 2nd, 2010 10:15am
You have the same keys under HKCU for per-user installations. Have you checked there?
Free Windows Admin Tool Kit Click here and download it now
November 2nd, 2010 10:26am
Thank you for the quick reply :)
Yes, I've searched the entire registry for anything that would indicate the full install path.
The installer for Star Trek Legacy is an msi
So I'm thinking that the information is being stored via WMI
Unfortunately I am not well versed in how to call that information from my VB program into a variable.
Or how to even read that information into my VB program.
November 2nd, 2010 11:15am
I've seen some programs register paths with the old 8+3 naming standard. Have you tried searching for bethes~1 or startr~1?
As this is an msi it should register in the places you've mentioned.
Free Windows Admin Tool Kit Click here and download it now
November 2nd, 2010 12:24pm
Thank you for the quick reply and all your help thus far.
I found a work-around
Since my program has to be installed where Star Trek Legacy is installed and the installer asks for that location when you install my program, then I have the installer write two keys that contain path information for where my program is installed to the
registry.
Then in my program I read those keys.
It works because my program has to be installed where the user installed Star Trek Legacy anyway.
November 2nd, 2010 1:33pm