Announcement

Collapse
No announcement yet.

Only allow one instance of my app to run on only one computer in LAN?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • John Petty
    replied
    Wayne
    Appletalk isn't that wierd if somewhat verbose (you can always replace it with LessTak), however it raises a very real issue, which is that you must know the protocol that is running on a network (probably why Adobe stopped the check) however after network protocols going through a stage of considerable divergance it is probably now safe to say that around 80% are running TCP/IP and if they are, the procedure is relatively simple (80% protection is better than none)!

    Your program needs two steps, firstly immediately upon start it should do a UDP SEND to IP address 224.0.0.1 at whatever port you have decided to use, it then should wait for responses from any other running program. This need not be a long period because as Paul pointed out it is restricted to the local subnet which means that all responses should occur within about 20 ms on a normal SOHO net (there are ways to expand the range of the search by tunneling through the local routers, but not normally worth the effort so your protection might only be 70%). If the program receives a response with the same serial number it terminates.

    Secondly if the program has successfully started it does a UDP NOTIFY command to its parent window. If the window receives a UDP NOTIFY message it does a UDP RECV and then a UDP SEND to ip& with it's serial number and the circle is complete.

    I have not included a code example as there are many contributers to this forum who could dash off this type of code more elegantly than me.

    I am a timeshare IT manager with clients who have from 6 location WAN's and over 100 workstations down to clients with 1 server an 2 workstations. Any software that used some of the file locking techniques mentioned by other members would need to demonstrate a remarkable amount of uniqueness and value to the company concerned before they would be allowed on any of these networks. There is nothing more annoying than having to rush to a site to release a resource from an NT server that has a lock on it, and the workstation has crashed (at my rates the clients quickly realise the software had better have a lot of benefits).

    There are far less toublesome methods which are easy to implement for programs which have their data on a server and a restricted number of licences, similar to what Paul pointed out ie-
    When a user logs on then they write their user id and IP or MAC address to a licence file on the server, which file is only locked during the write process, at the same time the program counts from the file the number of logged on users and compares it to the licence. If the user crashes and relogs on from the same machine then the program knows it was a crash and issues whatever warning is felt neccessary (ie avoiding opening the program twice on the same machine). You also have an IT manager happy to promote your software!



    ------------------

    Leave a comment:


  • Wayne Diamond
    replied
    With just about all of my programs I have then open themselves locking read access so that you can't even read from the file while it's running. That will certainly stop multiple workstations using the same copy on the server, but what Im trying to stop is when Workstation A and Workstation B both install a copy of my Program X locally on their workstation drives, even though theyve only paid me to use one. Somehow Computer A needs to recognise that Computer B already has the program installed, so it shouldnt allow an install on Program A. Winsock would be one way of doing it but I really dont want to use sockets just for the purporse of license restriction!
    John - yes, I remember from my old college days that every workstation required its own UNIQUE-licensed version of Adobe Photoshop, but I have a feeling that Photoshop may have been using AppleTalk or some weird protocol to do that? -- but yes, that is exactly what I'm after!



    ------------------

    Leave a comment:


  • Scott Turchin
    replied
    Wayne,
    You could use Python's code to extract itself out, run from a secret location and then lock the original EXE....
    I have that code basically, and what I don't have you could easily figure out.....


    Scott

    ------------------
    Scott

    Leave a comment:


  • Don Dickinson
    replied
    Ron, the way I've ever limited the number of installs is with a program like my cselfx software (it maintains the number of times a program is run and can limit it). The problem with this is that re-installing the software, extracting from a backup, etc is overcomes this problem.

    Greg, if a user locks up (gpf) they have to reboot as they likely left the file open. There is benefit to this, though - if a user GPFs, I want them to reboot. If it happens to them alot, either my program is bad or their windows install is bad or there's something else wrong with their system.

    --Don

    ------------------
    dickinson.basicguru.com

    Leave a comment:


  • Paul Dwyer
    replied
    Due to network segmentation you cn't really use broadcast techniques. after all you don't really know how big a network you are on, most probably larger than your subnet.

    The server ideas are better. make your software "log on" to the server for it's licensing information which has a user limit and log off when done. Have a slow keep alive going so you can timeout a connection that falls off the LAN without logging off properly.
    A simple code will be needed, like a challenge response so that the licensing info can't easily be faked. The NT challenge response is a clever method for this and can be done in a more simplistic way if necessary.



    ------------------
    Paul Dwyer
    Network Engineer
    Aussie in Tokyo

    Leave a comment:


  • Gregery D Engle
    replied
    Don,

    What happens when the program locks up or the computer locks up
    and the person shuts down the program improperly. The LCK file
    is still present. What happens when you run the program again?

    ------------------
    -Greg

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Don, do you have a means of limiting the number of installations of the program to one?

    Ron

    Leave a comment:


  • Don Dickinson
    replied
    The way I do this is to create a "lock" file - leave it opened exclusively (DENY READ WRITE) until the program closes. Then close the file. If someone tries to get in while the first person is in, you'll get an error because the file can't be accessed.
    I also use this in instances where there is a simultaneous limit (5 a time or something).
    Create your lock files in a special "lock" directory. Each user has their own file <username>.lck or something like that. When someone runs the software, delete all of the files in that lock directory. Count the files that remain after the delete (they couldn't be deleted because the file is in use). This is the number of people in the software. If it's too big, kill the program.

    Best Regards,
    Don

    ------------------
    dickinson.basicguru.com

    Leave a comment:


  • John Petty
    replied
    Wayne
    Many years ago either Quarke or Photoshop (can't remember which) used to do this on Mac's.
    When the program started it did a broadcast across the network (same way internet games find servers) and any currently running program returned its serial number. If the serial number of the running program was the same as its own then it terminated.

    ------------------

    Leave a comment:


  • Bruce Singleton
    replied
    Wayne

    I limit runing a single instance of my Nursery program on a lan
    with a file lockout. If interested, send e-mail and I will send you the
    code.

    Bruce
    [email protected]

    ------------------


    [This message has been edited by Bruce Singleton (edited May 12, 2001).]

    Leave a comment:


  • Scott Turchin
    replied
    You'd need a licensing server to install, or use the licensing server on an NT box (Is that possible)....
    Licensing server would know how many licenses are authorized and the app would have to check in before it could be allowed to run...

    Sounds good in theory anyway... Otherwise temp files come to mind (Yuck!)...



    ------------------
    Scott

    Leave a comment:


  • Only allow one instance of my app to run on only one computer in LAN?

    In the near future I'd like to sell a program (ill call it Program X) with two license types - one home/personal license type, and a business one.
    With the home/personal type (which is obviously cheaper), I'd like to possibly make it so that if you're running Program X on one computer in the LAN, you can't run it on any other computers in the LAN - or at least not until shutting down the app on the first computer.
    Does anybody have any ideas about how to implement this? (is it even possible?)


    ------------------
Working...
X