Plugin versioning code broken in 15.4

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Plugin versioning code broken in 15.4

Post by wjstarck » Tue Nov 24, 2015 8:57 am

The plugin versioning code appears to be broken in 15.4.x

Prior to 15.4.x, we would name our plugin like so: MyPlugIn[VersionMajMin].dll, eg MyPlugin.15.3.dll. On launching, OD would select the highest version number of the plugin according to OD's version number, strip the version off of the plugin name, and replace the prior version with this new updated version, eg MyPlugin.dll. This is no longer happening in 15.4, causing the incorrect (older) version of our plugin to load. Can you check into this?

Thanks,
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Plugin versioning code broken in 15.4

Post by jsalmon » Tue Nov 24, 2015 10:17 am

Looking into this. Side note, Open Dental doesn't find the "highest version number", it finds an EXACT version match. E.g. Open Dental v15.3 will ONLY look for MyPlugin15.3.dll and copy it over MyPlugin.dll if found. It could be as simple as you don't have a MyPlugin15.3.dll available for it to copy. However, it is currently not working as expected for me, I'm getting a "null Type" exception which is very strange because it is acting like it cannot find my Plugin class within my plugin when trying to load its assemblies.

I'll keep you posted.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Plugin versioning code broken in 15.4

Post by jsalmon » Tue Nov 24, 2015 10:37 am

Wow, that's embarrasing. My plugin was failing because I didn't put in the correct case sensitivity in my program link. e.g. myPlugin[VersionMajMin].dll was in my program link but the actual dll is MyPlugin... and so it was failing to load the assembly "myPlugin.Plugin" which myPlugin is not the correct dll name, MyPlugin is. Thus my null exception was throwing. As soon as I corrected the casing in my program link it worked as expected.

I'm assuming your issue is the one I mentioned above. We have it documented as such in our plugin page:
If Open Dental is on a newer version, and the dll is still on an older version with no matching [VersionMajMin], then Open Dental will attempt to load the old MyPlugin.dll.
http://www.opendental.com/manual/plugins.html
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: Plugin versioning code broken in 15.4

Post by wjstarck » Fri Nov 27, 2015 6:36 am

Hmm...slightly embarrassed here too :oops:

Turned out that the issue was that a customer had upgraded from 14.3 to 15.4b (which no one had ever done before). So there had been some substantive changes between 14 and 15 branches, combined with my (bad) assumption that OD would pick the closest match and load it. So the 14 plugin wouldn't work with 15. Normally I'm ahead of the curve, using the beta well before anyone else does, but in this case 15.3 was working just fine with 15.4 so I was in less of a hurry.

It would be nice if OD couldn't find an exact match, it would throw up a warning that it couldn't find an exact match and was loading the newest plugin it could find (by date). The newest might work and it might not, but at least would save us plugin developers a starting place to troubleshoot, and would save a lot of support time in these situations. Any chance of making that happen?

Thanks!
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Plugin versioning code broken in 15.4

Post by jsalmon » Wed Dec 02, 2015 3:12 pm

wjstarck wrote:It would be nice if OD couldn't find an exact match, it would throw up a warning that it couldn't find an exact match and was loading the newest plugin it could find (by date)...
Hmmm. Yes we could do that but that warning would pop up every single time the user launched Open Dental and I think they would get extremely aggravated especially if the plugin works just fine (which will hopefully happen most of the time).

I'd be fine with improving the dll version searching tool to look for the "most recent dll". The only scenario I see going wrong would be if an updated dll got pasted over the non-versioned dll (MyPlugin.dll) but no corresponding versioned dll added to the directory (MyPlugin15.3.dll) which as soon as Open Dental v15.3 is launched, this new code will blast away MyPlugin.dll with "the closest" versioned dll found (if present).

I'm just not sure that will save you support calls... Unless it would, let me know and I'll write it up as an enhancement to our plugin framework for v16.1
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: Plugin versioning code broken in 15.4

Post by wjstarck » Thu Dec 03, 2015 8:58 am

Hmmm. Yes we could do that but that warning would pop up every single time the user launched Open Dental and I think they would get extremely aggravated especially if the plugin works just fine (which will hopefully happen most of the time).
That makes sense.
I'd be fine with improving the dll version searching tool to look for the "most recent dll". The only scenario I see going wrong would be if an updated dll got pasted over the non-versioned dll (MyPlugin.dll) but no corresponding versioned dll added to the directory (MyPlugin15.3.dll) which as soon as Open Dental v15.3 is launched, this new code will blast away MyPlugin.dll with "the closest" versioned dll found (if present).

I see. Could we check myplugin.dll for assembly version info first and do nothing if it matches the running version of OD, and if it doesn't then convert the newest version to myplugin.dll?
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Plugin versioning code broken in 15.4

Post by jsalmon » Thu Dec 03, 2015 9:26 am

wjstarck wrote:Could we check myplugin.dll for assembly version info first and do nothing if it matches the running version of OD, and if it doesn't then convert the newest version to myplugin.dll?
Yes. I would need a way to know to start doing this special logic (like a new check box in the Program Link Edit window) because I can't (well... I don't want to) push this new logic onto all plugin users. I for one do not follow the Open Dental versioning pattern in the assembly for my plugins so it would be a waste of time for Open Dental to spend the I/O time reading all the dlls in its installation directory. But now we're getting into the realm of me adding completely new functionality which I will just send you through the Feature Request system.

I like the idea of trying to enhance the current [VersionMajMin] logic which I would feel comfortable doing as a "minor enhancement" (no FR system). However, I'm having a hard time thinking of a sound, foolproof way of going about things. I'll sleep on it and see what I can come up with unless you beat me to it.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: Plugin versioning code broken in 15.4

Post by wjstarck » Thu Dec 03, 2015 10:35 am

OK thanks
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

Post Reply