* Check Installed Plugins Against The Store problem

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
tatewise
Megastar
Posts: 27076
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Check Installed Plugins Against The Store problem

Post by tatewise » 10 Oct 2013 17:39

The V2.1 Plugin and probably earlier versions has a problem checking Versions in the sequence 1.8, 1.9, 1.10, 1.11, etc.

On line 49 the version < versionStore test considers Version 1.10 to be older than 1.8 and asks to download 1.8 over 1.10.

It seems that the two components of the version should be kept separate, or the version numbers must be syntax checked so 1.9 must be followed by 2.0 and 1.10 must be banned.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 8440
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Check Installed Plugins Against The Store problem

Post by Jane » 10 Oct 2013 18:55

I don't think there were any two part numbers with 2 digits after the ., I'll change the code to cope.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
tatewise
Megastar
Posts: 27076
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Check Installed Plugins Against The Store problem

Post by tatewise » 10 Oct 2013 19:08

You are correct, the 2 digit version "1.10" was in my Plugins.
This should cope with many forms of version number providing they are repetitions of digits separated by dots.

Code: Select all

function IntVersion(strVersion)
	local intVersion = 0
	local tblVersion = strVersion:split(".")
	for i=1,5 do
		intVersion = intVersion * 1000 + tonumber(tblVersion[i] or 0)
	end
--	print(strVersion," > ",intVersion)
	return intVersion
end -- function IntVersion
then in main function

Code: Select all

 if versionStore ~= nil and IntVersion(version) < IntVersion(versionStore) then
   local res = fhMessageBox('Newer version of '..name:gsub('%.fh_lua','')..' found, would you like to upgrade from '..version..' to '..versionStore,'MB_YESNO','MB_ICONQUESTION')
which explicitly reports the old and new versions.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 8440
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Check Installed Plugins Against The Store problem

Post by Jane » 10 Oct 2013 20:10

I have already fixed the plugin, something very similar, I will double check it in the morning and then post it up.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

Post Reply