Page 1 of 2

Compiling or protecting external files with app

Posted: Sat Jun 18, 2011 11:04 pm
by mebtrek
I’m at a crossroad in development of an application that I would ideally like to roll out muti-platform in order to broaden the market. The application includes several calculating html files that are called by the LiveCode application and run in revBrowser stacks therein. I don’t know of a way to compile these html files into the LiveCode application file, so these files would have to be distributed along with the application and placed in a folder somewhere along with the LiveCode application. The problem is that such externally resident files would not be protected and could be pirated.

Does anyone know of a way to compile such files in with the LiveCode application compilation? If not, does anyone know of a way to protect the external files, for example, by maintaining them encrypted in the externally resident state and only decrypted by LiveCode code when called by the LiveCode application and ran in the revBrowser stack? This functionality would be a great boon to LiveCode development. Of course, there are options out there to compile html files into self running Windows executable files with this sort of protection, however, this would leave out Mac users, which is not what I would opt to do. Lastly, does anyone know of software that will compile Html file into one like Windows exe files but that will run on the Mac? If there is one, that would at least allow the muti-platform LiveCode shell application with calls to separate self running externals for each platform but that is not the ideal solution I’m looking for. Any suggestions and advice would be much appreciated.

Re: Compiling or protecting external files with app

Posted: Sun Jun 19, 2011 5:52 am
by shaosean
Store a copy of the HTML into custom properties and write them out to a temporary folder that you can access and then delete them when you are finished..

Re: Compiling or protecting external files with app

Posted: Sun Jun 19, 2011 12:57 pm
by mebtrek
I'll have to research how to code your suggestion but will give it a try. For now, at least you've provided me with hope that what I'm looking to do can be done -- at least to some extent. If I'm understanding your suggestion correctly, utilization of temporary folders during runtime would, I think, maintain vulnerability of files to piracy. Thanks much for the suggestion!

Re: Compiling or protecting external files with app

Posted: Sun Jun 19, 2011 3:54 pm
by Klaus
Hi mebtrek,

maybe this is possible in your case?

Store the HTML files in (hidden) fields and then simply supply this to the revbrowser instance:
...
put fld "important hmlt stuff 1" into tHTMLText
revBrowserSet tBrowserId, "htmltext", tHTMLText
...
But I have no idea if and how this will work with referenced images etc.
But should work if the images are somewhere on the net when you supply the complete url
in the HTML and no relative pathnames, know what I mean?

At least worth a try :D


Best

Klaus

Re: Compiling or protecting external files with app

Posted: Sun Jun 19, 2011 5:45 pm
by shaosean
You can embed the images right in to the HTML and have no need for any path issues..

Re: Compiling or protecting external files with app

Posted: Sun Jun 19, 2011 6:39 pm
by Klaus
Hi sean,

in the mood to enlighten us?
I am not experienced in this advaced HTML stuff.

Pleeeeeease :D


Best

Klaus

Re: Compiling or protecting external files with app

Posted: Mon Jun 20, 2011 12:14 am
by wsamples
Have you looked at encrypt and decrypt in the dictionary?

Re: Compiling or protecting external files with app

Posted: Mon Jun 20, 2011 3:37 am
by mebtrek
Thanks everyone. The suggestions and what was found in the dictionary for encrypt / decrypt look very promising and I’m reasonable optimistic that I’ll be able to develop a solution. Will report back with it when I do, however, got called away and won’t be able to get back to this for a week or two. I don’t know how long these posts are tracked but please check back.

Meanwhile, for further perspective, the html files I’m looking to run are not on the net as hosted site files but just a patchwork of local html files (now hopefully to be embedded in the LiveCode project file then compiled) like a relatively simple site to run via revBrowser within a LiveCode application. Moreover, the revBrowser stack/s that the files will run in are curtailed in that they do not include the url address window or any browser buttons. Their only purpose is to display html files, thus the necessity for revBrowser. The html code will call other linked html pages. Images aren’t much of a concern because they alone would not be subject of piracy concerns and those that I would need for this project could be simply placed is associated stacks/cards.

If anyone is wondering why all this instead of running cards containing text and images therein, that’s because of the content, which is an array fairly complex Excel spreadsheet data converted to interactive calculating html files. I find that presently, it is much easier to do it this way than arduously and relatively inflexibly duplicating spreadsheeting capabilities with the LiveCode DataGrid. What would be absolutely GREAT would be the coming of a spreadsheet component in LiveCode. Until then, life goes on.

Cheers,
Mebtrek

Re: Compiling or protecting external files with app

Posted: Mon Jun 20, 2011 9:06 am
by SparkOut
Not sure if it will do what you want, but maybe take a look at http://www.runrevplanet.com/index.php?o ... Itemid=100

Re: Compiling or protecting external files with app

Posted: Wed Jun 22, 2011 7:09 am
by shaosean
Klaus wrote:in the mood to enlighten us?
I am not experienced in this advaced HTML stuff.
http://tools.ietf.org/html/rfc2397

If you search the archive of the use-list, i believe i submitted something to it a long time ago in regards to this matter..

Re: Compiling or protecting external files with app

Posted: Wed Jun 29, 2011 9:23 pm
by admin12
Of course, you could always store the files you want to protect in a folder with .htaccess, which is encrypted password protection. It is VERY easy to set up and nearly impossible to crack.

Mike

Re: Compiling or protecting external files with app

Posted: Wed Jun 29, 2011 9:38 pm
by townsend
This might help. Today I wanted to dispaly HTML in a Label object.

Code: Select all

put "<b>hello in bold</b>" into field my.label
It didn't work.

But then I found the HTMLText property in the Dictionary.

Code: Select all

set the HTMLText of field my.label to "<b>hello in bold</b>"
Which displayed my HTML just fine. It works in both Label and Text fields.

Re: Compiling or protecting external files with app

Posted: Thu Jun 30, 2011 12:04 am
by jacque
Labels are just fields with a few properties set. Normal textstyles work. You can select the field and use the Text menu.

Re: Compiling or protecting external files with app

Posted: Sun Jul 03, 2011 7:54 pm
by mebtrek
I've tried about everything suggested but can't seem to get it to work. Writing to temp folder still leaves files exposed; use of htaccess appears to involve some server side component which I do not want or need for a local standalone application; couldn't develop working code to encrypt, run and decrypt within LiveCode, etc. The closest I came was to nicely and securely encrypt the html files using a third party software tool. The resulting encrypted html files when opened invoke a password entry box from javascript code embedded within the encrypted html files code that prompts for the decryption key (password) to decrypt and run. All of this occurs from withing the html files without need for the third party software, however, I found no way to pass keys (the password string) via LiveCode code to the entry box created by the external html file being opened. At least for now, I'm shifting gears and abandoning the hopes for a cross-platform application in favor of one which will be Windows only calling external protected executable files compiled from the html files. Thanks all for your help. Nevertheless, if anyone has any further suggestions or perhaps sample LiveCode scripting for on-the-fly decryption/recryption that would be appreciated.

Re: Compiling or protecting external files with app

Posted: Mon Jul 04, 2011 3:25 am
by jacque
What problems were you having with encrypt/decrypt? I've used those with good effect and they'd be perfect for what you want.