Page 1 of 1

Client / Server Application

Posted: Thu Oct 30, 2014 11:44 am
by stoavio
Hi all -

I am building my first application in LC and wanted to poll the community for their thoughts on how to best accomplish something. I'll get right to the point!

I am building an application that provides adjuvant feature-functionality to Outlook. I guess you would call it a plugin although it will run independent of Outlook. It does work with Outlook data files, however.

On the "server-side" application, I will build my users an interface to define the settings for the "client-side" version of the application which will run in the background every day. This server-side version is intended for use by an administrator to set things like preferences, paths, etc. After all of the settings are defined in the server-side version of the application, I intend to deploy the client-side application across the network and launch it via Active Directory a login script or GPO. This is where I am getting stuck: what is the best way for me to read/access the settings that were defined in the server-side version of the application from the client-side app? This application will rely on whoever is using it to have a network share in place, but how can I make the client-side version of my application retrieve whatever settings were defined in the server-side app? Obviously, I could hard-code a path in the client-side app to go out onto the network and retrieve a config file (INI or the like) but that obviously won't work, as I intend to offer this tool to people who will naturally have different network configurations. Ideally I'd like for the administrator to be able to input a "settings path" which resides on their network, and have the client-side version of the application go to that path to retrieve the values of all of the settings.

Thanks for reading... and helping to deepen my knowledge! :)

Re: Client / Server Application

Posted: Thu Oct 30, 2014 2:27 pm
by pink
My first thought is to set the default directory of a settings file relative to the server application, i.e. the settings file resides in a subfolder with the application itself.

My second thought is probably impractical, but if you have a web server setup, you could have the client app look at a URL to find a settings file.

My third thought is to have the client app try to communicate to the sever app using sockets. It would require someone using the client app to know the hostname, or IP address of the server computer.

Here's some great resources on Sockets:

http://lessons.runrev.com/s/lessons/m/4 ... ng-sockets
http://livecode.byu.edu/internet/IntroToSockets.php

Re: Client / Server Application

Posted: Fri Oct 31, 2014 12:38 am
by stoavio
pink wrote:My first thought is to set the default directory of a settings file relative to the server application, i.e. the settings file resides in a subfolder with the application itself.

My second thought is probably impractical, but if you have a web server setup, you could have the client app look at a URL to find a settings file.

My third thought is to have the client app try to communicate to the sever app using sockets. It would require someone using the client app to know the hostname, or IP address of the server computer.

Here's some great resources on Sockets:

http://lessons.runrev.com/s/lessons/m/4 ... ng-sockets
http://livecode.byu.edu/internet/IntroToSockets.php
Hi Pink -

Thanks for brainstorming with me. Unfortunately, I don't your first idea will work because how will the client-side application running on the end user machines know where to go and look for the settings file without me hard coding a location in the client-side application?

After the "administrator" launches the server-side version of the application and makes all of his selections, I want a configuration file to be generated on his network share which contains the settings he defines which will then be looked at by all of the client-side versions of the app running on various machines across the network.

My other thought (and I'm not sure how this would be done in LC) was that after the server-side version of the application was run and the settings were committed, the administrator could "generate/compile" the client-side app with the settings embedded into an array. However, I don't know of anyway to make my application capable of compiling an application itself.

There must be an easier way! I really don't want to rely on a web server. This needs be an autonomous solution that can use the local network to run. There are a ton of plugins out there that accomplish this sort of thing, I just don't know how they do it!

Re: Client / Server Application

Posted: Fri Oct 31, 2014 12:47 am
by stoavio
Maybe I'll make both the client and server into one application that can somehow heuristically detect whether it is running on an end-users machine in "client mode" or running on an administrator's machine in "server-mode". In server-mode the configuration GUI would be present and in client-mode the GUI would be hidden and it would simply run in the background. Any thoughts on how I might accomplish this approach?

Re: Client / Server Application

Posted: Fri Oct 31, 2014 8:19 am
by SparkOut
When you deploy the client by (for instance) login script, you could put the destination of the config file as a parameter, as part of that script, couldn't you?

Re: Client / Server Application

Posted: Fri Oct 31, 2014 11:33 am
by stoavio
SparkOut wrote:When you deploy the client by (for instance) login script, you could put the destination of the config file as a parameter, as part of that script, couldn't you?
Hi SparkOut. That is an interesting idea. For what it's worth, I am trying to put together an application that I can distribute for others to use and want to build as much of the functionality into the core of the tool itself, rather than asking the end user to takes any additional steps in order to wire it up and get it working. You're right, I can think of a couple of different ways similar to your method that would work, but if I were to provide this tool to less technical folks and only wanted them to have to fill out the GUI on the server-side version of the app and then worry about getting the client-side version of it installed on end-user machines, asking them to define parameters in a login script might be asking a bit too much. It's a thought though and I'll certainly keep it in mind. Thank you!