Jump to content

Recommended Posts

Posted

Autodesk has an Entitlement API if you’re planning on using the app store

See Using Entitlement API with Lisp

https://adndevblog.typepad.com/autocad/2022/05/using-entitlement-api-with-lisp.html

I have a couple of apps there that uses it, it’s pretty cool.

 

Otherwise, it’s not worth spending a lot of time on this, its code that you have to maintain. Keep it simple, something like an XOR cipher and the drive serial is going to be enough. you can store this in the registry or a license file.

 

  • Like 1
Posted
21 hours ago, NanGlase said:

Thank you for all the suggestions — I really appreciate them. I tried using DOS, and it worked quite well. The only issue I'm facing now is when installing the program on another computer. The LISP files saved on the USB seem a bit risky since they haven't been compiled yet. Also, someone is observing the installation process, which adds a bit of pressure.

 

The new suggestion looks good too. I just need some time to try it out and build it. I’ll keep you all updated.

 

USB:

 

I have the below from RJP. Send an e-mail. There are 2 LISPs below, the first c:sendmail describes the process and the second is a function I call to send e-mails via LISP (usually sending PDFs).

 

Create a little LISP that will return to whatever unique number you want, after that use the below to send you an e-mail with the unique code in - this can be done in the background using Outlook ('send' needs to be 'T'). At your leisure you can put that number into your master LISP, compile it and send the LISP back again for the end user to copy where they want.

 

(rjp-OutlookMessage (<<YOUR-E-MAIL>> "Computer Code" "" <<UNIQUE-CODE>> T)

 

T might need to be "T"

 

Removes the need for you to take the USB to the users desk.

 

 

;;http://www.theswamp.org/index.php?topic=26953.msg324794#msg324794
;;email a file
;;Usage
(defun c:sendemail () ; test and example e-mail
  (rjp-OutlookMessage
    ;;email address (multiple separated by semicolon)
    "Some.One@e-mail.com;someone.else@e-mail.com"
    ;;Subject
    "Test Email"
    ;;Attachments as a list of strings
    '("C:\\Users\\SO123456\\Working Drawings\\ADrawing.pdf")
    ;;Text in body of email
    "Nothing to read here :)"
    ;;nil will open email to edit...T will send email in the background
    nil
  )
)

(defun rjp-OutlookMessage (To Subject AttachmentList Body Send / objMail objOL)
  (if (and (setq objOL (vlax-get-or-create-object "Outlook.Application"))
	   (setq objMail (vlax-invoke-method objOL 'CreateItem 0))
      )
    (progn
      (vlax-put objMail 'To To)
      (vlax-put objMail 'Subject Subject)
      (vlax-put objMail 'Body Body)
      (foreach file AttachmentList
	(vl-catch-all-apply
	  'vlax-invoke
	  (list	(vlax-get objMail 'Attachments)
		'Add
		file
	  )
	)
      )
      (if send
	(vlax-invoke objMail 'Send)
	(vlax-invoke objMail 'Display :vlax-true)
      )
      (vlax-release-object objOL)
      (vlax-release-object objMail)
    )
  )
  (princ)
)

 

 

 

 

 

Second thought for today, how much risk is there to send the LISP out without any protection in the form of computer codes ad so on? For example, all of mine are done on company time, their property and happy to freely share within the company. What I post here I put down to 'learning time' (always learning)... a lot of the users of this thread are the same with little commercial or sensitive info in the LISP... so... what is the risk and do you need to do any more than just compile the code (and even compile the code... do you need to do that)?

  • Like 1
Posted

 

AutoCAD licensing AutoCAD, in real time.
Who could resist reading a bit more?

 

Well, yes.

Confirmed: this is possible.
How?

As I said before, through PowerShell (managed from Lisp, of course), but in a more elegant way than using 'sendCommand': with 'setVariable'.
The idea is to have our Lisp write a script (.ps1) that creates a lightweight server to listen on a port.

AutoCAD PC1 sends a request message to AutoCAD PC2, which processes it and sends a reply back to AutoCAD PC1. Receiving this message triggers the loading of a DCL with a textbox (showing the received code) and an Accept button to register that code.
And how do you trigger the DCL upon receiving the message?

Think of a detonator: 'setVariable'... and then think of the explosive: 'vlr-sysvar-reactor'.

 

Sounds good?
"If you can imagine it, you can build it. And improve it."

  • Like 1
Posted

You can via lisp send yourself an email with the code in it. I would scramble the code. Give client a fas file to run.

 

You can send to a remote server a file, likewise can read a file from a remote server, a bit harder and if your pc is off the code will fail. Have tested this.

 

Re Install from a usb, I had a zip file and a install.lsp, The install lisp unzips all the files to a known directory, yes can unzip a file using lisp, it menuloads the menu and adds support paths. Happy to provide an example. I use this method for multiple users at one company they just email the two files to each user and they drag and drop the lisp.

 

(defun pingserver ( / xml str)
(setq server "http://myserver.com.au/TestInfo.txt") ; I would change this to get passed a unique filename
(setq xml (vlax-create-object "MSXML2.XMLHTTP.3.0"))
(vlax-invoke-method xml 'open "POST" server :vlax-false
(vlax-invoke-method xml 'send)
(setq str (vlax-get-property xml 'responsetext))
; got your file !!!!!

;do your bit here

)

 

  • Like 1
Posted (edited)

@NanGlase To further assess the possibilities of the "license server" option in real time from AutoCAD, the following needs to be considered:

 

At the code level, you must:

Check that both the client PC and your own have the same communication port available, and if not, handle this somehow.

Also ensure that the firewall will not block the ports on either the client or the server side.

 

At the infrastructure level, you must:

Have a static IP or a domain name on the server side so that your code, when executed by the client, knows where to send the request.

 

 

In my opinion, although this is an interesting challenge, you should assess whether the effort and investment required are justified by the benefits you may gain.

I believe that, considering all of this, the most reasonable options might be those proposed by @Steven P and @BIGAL.

 

 

 

Edited by GLAVCVS
  • Like 2
Posted

Just a quick comment where I used to work we used a simple check inside say a FAS, no remote check, we had a phone call from a client who said code was not working. Ok the reason he was trying to give the programs to some one else, so our security worked.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...