Page 1 of 3
How to determine Commercial or Community versions.
Posted: Sun Dec 08, 2013 5:37 pm
by AndyP
Ok, I've search the dictionary and as far as I can see there is no way to determine if an existing stack is being opened in the Commercial or the Community version of LiveCode.
There is the version function but that returns 6.5.0 for the Commercial and the Community versions with no other info.
Any ideas or is this for Feature Requests?
Re: How to determine Commercial or Community versions.
Posted: Sun Dec 08, 2013 6:09 pm
by FourthWorld
The engine behavior between both versions should be the same, with the exception of one feature: the ability to password-protect a stack script is in Commercial only, since of course it wouldn't make sense in a GPL-governed work. In all other respects they're the same. What do you want to do differently in each?
Re: How to determine Commercial or Community versions.
Posted: Sun Dec 08, 2013 7:09 pm
by AndyP
Thanks for your reply Richard.
I'm developing a plugin for LiveCode that initially will be a commercial offering.
The demo version of this generates password protected stacks which show the result of a templated stack bild but not the scripts generated to allow evaluation of the plugin. This obviously will not be an option in the Community version.
For openess and politeness I would like to inform a Community user that the plugin is a Commercial offering and will not work in the Community version.
I'm thinking that I could prehaps trap the Password error but a built in way to determine the version would be a better option.
Re: How to determine Commercial or Community versions.
Posted: Sun Dec 08, 2013 7:56 pm
by FourthWorld
Your willingness to provide a nice warning is laudable, but I'm afraid the engine is less flexible: for the security of password-protected stacks, the Community Edition can't open them at all.
Re: How to determine Commercial or Community versions.
Posted: Sun Dec 08, 2013 9:20 pm
by AndyP
Hmm...Yep, I should have tested (realised) that earlier
So for me that's back to my old standby of reading and writing encrypted text files to be processed by the stacks.
Thanks for your comments and insight.
Re: How to determine Commercial or Community versions.
Posted: Sun Dec 08, 2013 10:39 pm
by FourthWorld
Of it's designed to be used only with Commercial I wouln't rewrite it just to provide a more graceful way to tell Community users it's not designed fire them. They'll figure it out soon enough when the IDE tells them as they try to open it.
Re: How to determine Commercial or Community versions.
Posted: Mon Dec 09, 2013 1:07 am
by Mark
Hi Andy,
You can make an unprotected stack with a custom property containing your protected stack. Put this handler into the stack script of the unprotected stack:
Code: Select all
on preOpenStack
try
set the password of this stack to "test"
set the password of this stack to empty
go the cMyProtectedStack of this stack in new window
close stack "My Unprotected Splash Stack"
catch myErr
beep
answer error "Sorry, you can't use this utility with the community version of LiveCode."
end try
end preOpenStack
Now you can warn the user if he tries to open your stack with the community edition.
Kind regard,
Mark
Re: How to determine Commercial or Community versions.
Posted: Mon Dec 09, 2013 1:05 pm
by AndyP
Thanks Mark.
That's a good solution.
Re: How to determine Commercial or Community versions.
Posted: Wed Jan 08, 2014 8:28 pm
by splash21
I came across this thread by chance and I'm glad I did. Best tip I've seen for a while - well done, Mark

Re: How to determine Commercial or Community versions.
Posted: Wed Jan 08, 2014 8:49 pm
by Mark
Thanks

Re: How to determine Commercial or Community versions.
Posted: Thu Jan 09, 2014 12:43 am
by [-hh]
..........
Re: How to determine Commercial or Community versions.
Posted: Thu Jan 09, 2014 1:01 am
by Mark
Hi,
That's a great solution, but it won't work with Revolution. I don't know if it will work with MetaCard; I suspect it won't. When RunRev changes the engine name (which will happen eventually), your script will break. If you don't want the script to be broken, you could use
Code: Select all
function commercial
set the idemDel to slash
return (the last item of the addres contains "commercial")
end commercial
Obviously, this works in the IDE only. It won't work in standalones.
Kind regards,
Mark
Re: How to determine Commercial or Community versions.
Posted: Thu Jan 09, 2014 3:14 am
by [-hh]
..........
Re: How to determine Commercial or Community versions.
Posted: Thu Jan 09, 2014 11:19 am
by Mark
Hi Hermann,
The use of slash hasn't changed since the MetaCard times.
Kind regard,
Mark
Re: How to determine Commercial or Community versions.
Posted: Thu Jan 09, 2014 4:37 pm
by FourthWorld
Since the one reliable difference between the Community and Commercial editions is that the former doesn't allow the setting of stack passwords, we could use that as a test:
Code: Select all
function IsCommunityEdition
try
do "set the password of this stack to Anything"
catch tErr
return true
end try
set the password of this stack to empty -- undo
return false
end IsCommunityEdition
It might also be good to have a built-in function for this. Has anyone here submitted such a request?