Checking if Deploy is correctly installed on a user's machine

General discussion forum about all things Team Developer 7.x
Nils Jänicke
Germany
Posts: 11
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Checking if Deploy is correctly installed on a user's machine

Post by Nils Jänicke » 26 Feb 2018, 08:02

Hi,

I have a little question.
I've noticed that our application only runs stable if the deploy is correctly installed. If there is an older version of Deploy installed, the application starts but sometimes it crashes and does not if the deploy of the last TD version is installed.
Is there any chance to check by the application if the deploy (and maybe a VCredist version needed) is installed on the PC?

Best regards
Nils

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 123
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: Checking if Deploy is correctly installed on a user's machine

Post by Jeff Luther » 26 Feb 2018, 16:51

Nils -- I don't have a setup here currently to verify this, but I would think that checking the TD runtime folder files for their dates would be a way. Or perhaps checking the registry for the TD runtime entries might include a version or rev. number?

If I had 2 different installs for a given TD version, I'd install the earlier one and check:
>> Is there a runtime DLL etc. that is always updated with a new deploy version? If so then checking that file's date on SAM_AppStartup would tell you that. Maybe as simple as the deploy file's date is newer than your app's date?

>> If there is no one file which always changes, write a routine to get the latest/newest file date for any file in the deploy folder.

>> Maybe check the registry to see if TD deploy has any rev. or version info.

I would do this for 2 different TD deploy versions and check for any differences either in the runtime folder and/or the registry. And I'd run this check at SAM_AppStartup time. If a newer deploy is detected, let the user know and bail out of the app. That way you don't get beyond your application start and then on to a crash.

I did do a quick check of my couple gig folder of old samples and didn't see anything that had to do with 'check for current runtime' or similar. Let us know what you come up with as a solution.
Jeff Luther @ PC Design
Palm Springs, California
TD info. & samples: http://www.jeffluther.net/TD/

Nils Jänicke
Germany
Posts: 11
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: Checking if Deploy is correctly installed on a user's machine

Post by Nils Jänicke » 27 Feb 2018, 08:29

Hi Jeff,

Thank you for your answer.
But can you please tell me what entry the deploy*.exe writes into the registry that I can check? How can I find it?
I think that may be the best way to check, because I don't know if any installations on a customer's PC uses the same folder for the deploy files and maybe a user copies only the files into this folder without starting the deploy*.exe setup.
The application itself already checks for the version number of the cdlli*.dll file in the application's folder, that works fine and if a user only copies the .exe file into his application folder if a new TD version was used the application opens a message box and after closing it calls SalQuit.
But that is not enough since I've found that the application does not run stable if the user had installed the TD 7.0.3 deploy and the application was compiled with TD 7.0.4. So I should check the deploy version, I think best to do it by checking an registry enty, so I shoul know which entry the deploy*.exe writes into the registry and how I can find it.

Best regards
Nils

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 400
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: Checking if Deploy is correctly installed on a user's machine

Post by Dave Rabelink » 27 Feb 2018, 10:52

When a TD executable has started, it has found and loaded the needed cdlli*.dll on the system, where ever it is.
Could be from the application folder or any other folder within the PATH settings.

To check from the running application where the cdlli*.dll is loaded from, you can do this:
  • Use VisFileFind( "cdllixx.dll" ). This will search for the dll in the PATH. This will be fairly equal to how the application has found the dll. This function returns the exact folder location.
  • Use WinApi. Functions OpenProcess, EnumProcessModules, GetModuleFileNameEx can get you all the loaded dll's with their paths
When you have the full path to cdlli*.dll, you can get the file version using GetFileVersionInfo.

This way you are able to get a complete list of loaded dll's, with full paths and their versions.
(including any used vcr dll's)

I think that even checking a deploy installation is not enough as PATH settings can interfere.
When customers can copy files themselves, installing deploys or not and placing runtime files anywhere, the best way is to query the loaded dll's from within the application.
When the TD application starts, at least the TD runtime is found and needed vcr dll's. When it does not start, your application is not able to check itself in the first place.

What I do is create a complete list of loaded dll's, check their paths and their versions and compare it to the versions needed.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 400
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: Checking if Deploy is correctly installed on a user's machine

Post by Dave Rabelink » 28 Feb 2018, 06:56

Furthermore, we have stopped installing the TD runtime separated from the applications, so no deploy install.
It is basically a xcopy of the whole application folder including the runtime. In other cases we created an InstallShield setup which also in the end installs the application and runtime in one folder.

This makes side-by-side installations easier and we can hotfix the applications separately and upgrade the applications separately without having to manage the TD runtime differences.
And this avoids that customers can mess-up the installations by tinkering with the PATHS or do custom deploy setups.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Nils Jänicke
Germany
Posts: 11
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: Checking if Deploy is correctly installed on a user's machine

Post by Nils Jänicke » 28 Feb 2018, 07:37

Hi Dave,

Thank you for your comments. But it seems that especially the Quick Graph does not work (the application freezes) if the deploy is not installed, in this case it is not enough to have all needed .dll files in the application folder. It seems to be a .net problem since the new quick graph tool uses .net.

So here the question for me: How can I check if the deploy is installed and has the correct version?

Best Regards
Nils

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 400
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: Checking if Deploy is correctly installed on a user's machine

Post by Dave Rabelink » 28 Feb 2018, 08:19

When TD runtime needs .NET components, like QuickGraph, the .NET components need to be in the application folder.
The deploy setup installs those components in the global assembly cache. So a xcopy of the dll's from the deploy folder is not enough.

In this case you can xcopy the .NET components from this location into the application folder:

C:\Program Files (x86)\Gupta\Team Developer 7.0\netbin


As for the deploy registry location:

The deployer installs it using a unique GUID which is always the same.
Best way to get the location in registry to find out which GUID is used for each TD version, use regedt32.exe or a custom tool. I use the free RegCool tool:

https://kurtzimmermann.com

Search for: Team Developer 7.0 Deployment

And you will end up here, see screenshot:

DeployRegistry.png

The settings would show something like above.
There you find the setup info, including the location. The GUID, indicated with the red arrow is the one to use when searching the registry.
So if you want to know if the deploy is installed, search for the GUID at the correct location in the registry.
There you can use the InstallLocation value. This could be an extra check to see if the folder is actually on the system and contains the runtime files.
(the customer can easily delete or move the folder or clean the folder without uninstalling it which makes it possible that even having the registry entries, the TD application is using a different TD runtime).
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Nils Jänicke
Germany
Posts: 11
Joined: 20 Sep 2017, 11:56
Location: Villingen-Schwenningen, Germany

Re: Checking if Deploy is correctly installed on a user's machine

Post by Nils Jänicke » 28 Feb 2018, 10:24

Thank you, after copying the files from the netbin folder the application runs without actual deploy.

Return to “General Discussion”

Who is online

Users browsing this forum: Ccbot [Crawler] and 1 guest