A resource for installation or setup folder hierarchy of various applications
Is there a web site (or something else) that has information on folders and their hierarchy where various programs and applications are installed?
Please let me explain. I am writing an application that (part of what it does) references certain files installed by other application. To be able to determine the file paths for these folders I have to download and install each application seperatly on my development pc, search for the file I want, and then write its path in my application.
This method is very time consuming and, frankly, boring, as it requires downloading and installing each application (some of them in excess of 600MB) and then locating the required file just to be able to "know" its path.
So, I was wondering if there is something that could speed things up. like, for example, a website that would have such information. I tried each of the applications own website for information but no dice.
Any help from you w开发者_JS百科ill be much appreciated. Many thanks
If you're using Windows Installer, I would use a combination of the various search elements you have available. (AppSearch, RegLocator, etc.)
Here's an example using WiX code, this particular example first looks in the App Paths registry location to find the details for winword.exe
, secondly it ensures that the version number is at least 11 (Office 2003).
<Property Id="WORDEXE" Secure="yes">
<RegistrySearch Id="RegSearch_WORDEXE" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe" Type="file">
<FileSearch Name="WINWORD.EXE" MinVersion="11.0.0.0" />
</RegistrySearch>
</Property>
As long as all the applications you're searching for are using the App Paths
key to expose themselves to the system then you should be able to work backwards from that and not even need to prompt the user. (This registry section is the reason you can just enter winword
from the "Run" dialog even though it's not in the path and can't be run from a command prompt window.)
I know this isn't especially helpful, but to answer your question directly, I highly doubt that such a website exists, except for certain very common programs like MS Office or any of the major operating systems itself.
I have to say, though, hard-coding the paths in your program seems like a rather bad idea. What if someone using your program has one of these dependencies installed in a non-standard path? Normally anything your application would need to access should be installed in some sort of system folder whose path you can get dynamically from the runtime environment. (At least I know it works this way on Linux, I'm not sure to exactly what extent it's true on Windows)
精彩评论