Is Microsoft Dynamics eConnect installed on a machine?
Is Microsoft Dynamics eConnect installed on a machine? How do we quickly check for eConnect installs on a machine?
To enable our software to run correctly, the concept of dependencies & pre-requisites exists. That is software/hardware/configurations that we require to exist within a computer environment.
Microsoft eConnect is an example of this. eConnect is an API that allows manipulation of data in Microsoft Dyanmics GP.
Personally I have eConnect installed on a server and the clients connect to eConnect via WCF and the transaction serivce. I don't end up with eConnect on the clients, other than deploying the serialisation dlls. This minimises the need to to roll out eConnect as an install to the whole computer client estate and manage the application, COM objects and the services in all those client machine locations, however this may not suit everyone. eConnect was designed to be versitile with lots of options (Windows message Q, Biz Talk, .NET)
For other people it may be important to know if eConnect is installed or not.
Checking eConnect is installed
Lets imagine we have a Dynamics GP Addin, for the cient software, that requires eConnect on the local machine to be installed. When launching the Addin it is wise to check, at runtime, that eConnect is installed correctly. This is possible by:
- Checking the Windows registry of the machine for the eConnect keys
- Trying a "dummy" call to eConnect, to see if any exceptions are raised, i.e. find an operation in eConnect that is intert but will test it is working, yet leaving no persistant changes.
It is best to do both checks, is eConnect installed and it does it works? Just because eConnect has been installed on a machine does not mean it is in a operational condition, files or configuration may have been damaged since the install.
Depending on the sucess or failiure of the above check, you may then choose to disable functionality in the plugin, email an administrator and notify the user that the installtion is not correct.
Registry checking
Check the registry for the eConnect version number, an example registry key to check is;
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Business Solutions\eConnect 18.0\1033\SETUP\Version
Obviously the eConnect version number will change and the key "eConnect 18.0" will vary depending on version. Indeed for earlier versions of eConnect you may find it under the 32bit branch of the registry. (I think that would be the "WOW6432Node").
So best way forward is to iterate through the sub keys of
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Business Solutions\
Looking for any eConnect nn.n sub keys being present. Obviously, if you know the exact version you are looking for, in that case just look for the exact match.