I know I saw the answer to this somewhere before, but I can't seem to find it now. How do you test if a certain Widget or LCB Library is installed from LiveCode script? And also how to check if it's a certain version of the target extension?
Thanks in Advance.
Testing if a LCB Library or Widget is installed from LCS
-
- Posts: 627
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
-
- Posts: 627
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: Testing if a LCB Library or Widget is installed from LCS
I found it, you check the contents of the loadedExtensions.
Still not sure about how to check meta info, like the version number, of a loaded extensions. It seems like libs that come with LC have a functions that returns it's version.
Still not sure about how to check meta info, like the version number, of a loaded extensions. It seems like libs that come with LC have a functions that returns it's version.
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: Testing if a LCB Library or Widget is installed from LCS
In the IDE you can do
revIDEExtensions() to get an array with all the metdata. You can cut that down with parameters, eg revIDEExtensions("library") or revIDEExtensions("widget", "installed").
For individual extension properties, use
revIDEExtensionProperty(<kind>, <propName>)
where propName is various things, including:
"status", "name", "type_id", "author", "title", "svgicon", "version", "source_file", "source_type", "type", "uservisible", "support_files", "svgicon", ...
revIDEExtensions() to get an array with all the metdata. You can cut that down with parameters, eg revIDEExtensions("library") or revIDEExtensions("widget", "installed").
For individual extension properties, use
revIDEExtensionProperty(<kind>, <propName>)
where propName is various things, including:
"status", "name", "type_id", "author", "title", "svgicon", "version", "source_file", "source_type", "type", "uservisible", "support_files", "svgicon", ...
-
- Posts: 627
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: Testing if a LCB Library or Widget is installed from LCS
Thanks Ali! I should be able to get that to work for stacks that rely on a certain version of an extension being installed. I found I can include an extension module in the script of a stack by binary64 encoding, decode the binary into a variable and then load a module from that, so I was trying to be proactive, looking ahead to try to avoid possible conflicts with the same module or older version of it that could already be loaded in the IDE. I guess if I want to check the version in a standalone I'd have to sift through the handlers in revideextensionlibrary.livecodescript, where those handlers live (then again there probably wouldn't be much point to doing that in a standalone since the proper version of a module would be included at build time.)livecodeali wrote: ↑Fri May 11, 2018 3:12 pmIn the IDE you can do
revIDEExtensions() to get an array with all the metdata. You can cut that down with parameters, eg revIDEExtensions("library") or revIDEExtensions("widget", "installed").
For individual extension properties, use
revIDEExtensionProperty(<kind>, <propName>)
where propName is various things, including:
"status", "name", "type_id", "author", "title", "svgicon", "version", "source_file", "source_type", "type", "uservisible", "support_files", "svgicon", ...