I need to detect if MongoDB is installed on a Windows machine in my app installer.
Does anyone know what I can look for in the registry to be sure it is installed?
I've searched the entire registry and researched on SO and google for hours. Mongo registry entries are using GUID keys, so these change per install and I don't think I can find it this way in innosetup.
I'm hoping someone has already solved this problem and can help me so I don't have to spend more hours reinventing the wheel. Thanks to anyone with useful information.
The default installation directory for MongoDB on Windows would be: C:\Program Files\MongoDB
Reference: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/
Also, Detecting installed programs via registry for the registry angle!
For more information, google!
Open the command prompt and type "cd c:\program files\mongodb\server\your version\bin". After you enter the bin folder type "mongo start". If you get either a successful connection or failed one it means it's installed at least.
The problem is that the user could have installed MongoDB via a zip file -- so there wont be any trace of the installation in the registry at all. You could go the extra mile and try to connect to the standard 27017 port and try to get a status, but what if mongodb is not running at the moment? There is no good answer here -- simply ask the user if he has MongoDB installed and whats the directory. Its not very "automated" but in this case, it is more reliable and less problematic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With