How to determine Commercial or Community versions.

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

AndyP
Posts: 634
Joined: Wed Aug 27, 2008 12:57 pm
Contact:

How to determine Commercial or Community versions.

Post by AndyP » Sun Dec 08, 2013 5:37 pm

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?
Andy .... LC CLASSIC ROCKS!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to determine Commercial or Community versions.

Post by FourthWorld » Sun Dec 08, 2013 6:09 pm

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

AndyP
Posts: 634
Joined: Wed Aug 27, 2008 12:57 pm
Contact:

Re: How to determine Commercial or Community versions.

Post by AndyP » Sun Dec 08, 2013 7:09 pm

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.
Andy .... LC CLASSIC ROCKS!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to determine Commercial or Community versions.

Post by FourthWorld » Sun Dec 08, 2013 7:56 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

AndyP
Posts: 634
Joined: Wed Aug 27, 2008 12:57 pm
Contact:

Re: How to determine Commercial or Community versions.

Post by AndyP » Sun Dec 08, 2013 9:20 pm

Hmm...Yep, I should have tested (realised) that earlier :oops:

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.
Andy .... LC CLASSIC ROCKS!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to determine Commercial or Community versions.

Post by FourthWorld » Sun Dec 08, 2013 10:39 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to determine Commercial or Community versions.

Post by Mark » Mon Dec 09, 2013 1:07 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

AndyP
Posts: 634
Joined: Wed Aug 27, 2008 12:57 pm
Contact:

Re: How to determine Commercial or Community versions.

Post by AndyP » Mon Dec 09, 2013 1:05 pm

Thanks Mark.

That's a good solution.
Andy .... LC CLASSIC ROCKS!

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Contact:

Re: How to determine Commercial or Community versions.

Post by splash21 » Wed Jan 08, 2014 8:28 pm

I came across this thread by chance and I'm glad I did. Best tip I've seen for a while - well done, Mark 8)
LiveCode Development & Training : http://splash21.com

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to determine Commercial or Community versions.

Post by Mark » Wed Jan 08, 2014 8:49 pm

Thanks :oops:
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: How to determine Commercial or Community versions.

Post by [-hh] » Thu Jan 09, 2014 12:43 am

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:35 pm, edited 1 time in total.
shiftLock happens

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to determine Commercial or Community versions.

Post by Mark » Thu Jan 09, 2014 1:01 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: How to determine Commercial or Community versions.

Post by [-hh] » Thu Jan 09, 2014 3:14 am

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:35 pm, edited 1 time in total.
shiftLock happens

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to determine Commercial or Community versions.

Post by Mark » Thu Jan 09, 2014 11:19 am

Hi Hermann,

The use of slash hasn't changed since the MetaCard times.

Kind regard,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to determine Commercial or Community versions.

Post by FourthWorld » Thu Jan 09, 2014 4:37 pm

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply