Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect if MongoDB is installed on windows

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.

like image 739
trashrobber Avatar asked Jul 25 '14 18:07

trashrobber


3 Answers

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!

like image 194
Bey0ndZ Avatar answered Oct 20 '22 04:10

Bey0ndZ


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.

like image 5
Diego Alves Avatar answered Oct 20 '22 04:10

Diego Alves


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.

like image 4
alernerdev Avatar answered Oct 20 '22 03:10

alernerdev