Jump to content

need help for License code


Solitechcadsolutions

Recommended Posts

(defun date ()

 

(vl-load-com)

(setq comp (getenv "COMPUTERNAME"))

(setq comp1 "DESKTOP-L4C5783")

(if (/= comp comp1)

(progn

(Alert "Unauthorised Use Of Copyrighted Application")

(vl-file-delete "xxxxx.lsp")

(vl-exit-with-error "")

))

 

(setq abcd (atoi (rtos (getvar "cdate"))))

(setq abc (findfile "sts_temp.txt"))

 

(if (> abcd 20190526)

(progn

(Alert "Licence has been Expired")

(vl-exit-with-error "")

))

(if (= abc nil)

(progn

(alert "Could not found Temp file")

(vl-exit-with-error "")

))

(setq abctime (vl-file-systime abc))

(setq abctime1 (itoa (nth 0 abctime))) ;year

(setq abctime2 (itoa (nth 1 abctime))) ;month

(setq abctime3 (nth 1 abctime))

(if (

(progn

(setq abctime2 (strcat "0" abctime2))

))

(setq abctime4 (itoa (nth 3 abctime))) ;day

(setq abctime5 (nth 3 abctime))

(if (

(progn

(setq abctime4 (strcat "0" abctime4))

))

(setq abcfinal (atoi (strcat abctime1 abctime2 abctime4)))

(if (

(progn

(Alert "Licence has been expired\nDate has been Modified Manualy")

(vl-exit-with-error "")

))

(close (open abc "w"))

)

 

hello guys need help on license code. basically above code check computer name , date and for more security I have added temp file check date too. which securing from manual date change. and I am happy with code it is working file. only issue is I have to change computer name for each pc. do we have any function which takes computer name automatically and store it but it should run on single pc only. or I welcome any good license code.

 

thanks and regarnds

 

solitechcadsolutions

Link to comment
Share on other sites

(defun date ()

 

(vl-load-com)

(setq comp (getenv "COMPUTERNAME"))

(setq comp1 "DESKTOP-L4C5783")

(if (/= comp comp1)

(progn

(Alert "Unauthorised Use Of Copyrighted Application")

(vl-file-delete "xxxxx.lsp")

(vl-exit-with-error "")

))

 

(setq abcd (atoi (rtos (getvar "cdate"))))

(setq abc (findfile "sts_temp.txt"))

 

(if (> abcd 20190526)

(progn

(Alert "Licence has been Expired")

(vl-exit-with-error "")

))

(if (= abc nil)

(progn

(alert "Could not found Temp file")

(vl-exit-with-error "")

))

(setq abctime (vl-file-systime abc))

(setq abctime1 (itoa (nth 0 abctime))) ;year

(setq abctime2 (itoa (nth 1 abctime))) ;month

(setq abctime3 (nth 1 abctime))

(if (

(progn

(setq abctime2 (strcat "0" abctime2))

))

(setq abctime4 (itoa (nth 3 abctime))) ;day

(setq abctime5 (nth 3 abctime))

(if (

(progn

(setq abctime4 (strcat "0" abctime4))

))

(setq abcfinal (atoi (strcat abctime1 abctime2 abctime4)))

(if (

(progn

(Alert "Licence has been expired\nDate has been Modified Manualy")

(vl-exit-with-error "")

))

(close (open abc "w"))

)

 

hello guys need help on license code. basically above code check computer name , date and for more security I have added temp file check date too. which securing from manual date change. and I am happy with code it is working file. only issue is I have to change computer name for each pc. do we have any function which takes computer name automatically and store it but it should run on single pc only. or I welcome any good license code.

 

thanks and regarnds

 

solitechcadsolutions

 

Look at this code ...

 

(defun Win_IP ()
 (setq WMI (vlax-create-object "WbemScripting.SWbemLocator"))
  (if WMI (setq meth1 (vlax-invoke WMI 'ConnectServer)))
  (if meth1 (setq meth2 (vlax-invoke meth1 'ExecQuery "Select * from Win32_NetworkAdapterConfiguration")))
  (if meth2
   (progn
    (setq IPList nil)
    (vlax-for item meth2 (setq IPList (cons (vlax-get item 'IPAddress) IPList)))
    (foreach item (list WMI meth1  meth2)(vlax-release-object item))
    (setq IPList (vl-remove nil IPList))
    (setq IPList (vl-remove (list "0.0.0.0") IPList))
    (setq IPList (vl-remove (list "255.255.0.0") IPList))
    (if (= (length IPList) 1)
     (progn
      (if (= (type (nth 0 IPlist)) 'LIST)(setq CurrentIPAddress (nth 0 (nth 0 IPList))))
     )
    )
   )
  )
 (cond ((setq wscript (vlax-create-object "WScript.Network"))
      (setq pcname (vlax-get-property wscript "ComputerName")
            pcdom  (vlax-get-property wscript "UserDomain")
            pcuser (vlax-get-property wscript "UserName")
      )
       (mapcar 'princ
              (list "\nComputername: "  pcname
                     "\nUser domain:  "  pcdom
                     "\nUser name:    "  pcuser
                    )
      )
      (vlax-release-object wscript)
     )
)
)

Link to comment
Share on other sites

(defun date ()

hello guys need help on license code. basically above code check computer name , date and for more security I have added temp file check date too. which securing from manual date change. and I am happy with code it is working file. only issue is I have to change computer name for each pc. do we have any function which takes computer name automatically and store it but it should run on single pc only. or I welcome any good license code.

 

thanks and regarnds

 

solitechcadsolutions

I would advise you to register the program not to the user's name, it is better to use the serial number of the BIOS, the serial number of the hard drive or the motherboard.

I think it will be more reliable. The program will work after reinstalling the Windows.

Link to comment
Share on other sites

Binding the program to the hard disk, registers your program to the computer, this is better, since there can be several users on the computer.

It seems to me not absolutely correct to register the program on the user's name, the choice is yours.

Link to comment
Share on other sites

thank you for link would like to go with it. and I have never used the drive serial number (linked code returns int number of drive is it right?). and do you have any future advice on the code? it checks date ... temp file date ... computer name and will be adding drive too. thank you dilan

Link to comment
Share on other sites

(linked code returns int number of drive is it right?)

The program returns the serial number of the hard drive...

How would I do:

The user starts the program, he receives a message stating that it needs to be activated. It also outputs the request code, this code is generated from the serial number of the disk. Now we have a user request code and we can generate the serial number of its hard drive. Using this data, we can generate an activation code for a specific user. We send the activation code to the user. In the program, I would add a function, after which the user is prompted to enter the activation code. If the code is correct, then a file is created in the temp folder (for example .txt) and where some data is written (for example, the same activation code).

The file is created, the program is activated.

Run the program again. Oh yes, I forgot ... Our program after running should access this file from the temp folder (.txt), and if this file does not exist - the program needs to be activated.

But our program is already activated. After the launch, we search our file, find, read from it some data that we wrote there. Also starts to work.

Conclusion: We generate a universal activation code for each user and specific computer. After reinstalling the Windows, user just need to enter activation code once more and the program continues to work.

This is how it seems to me. I would have done just that. To get more experience in programming, I will write this program. When there will be more free time.

Link to comment
Share on other sites

I would also add the work of the program in the trial period. Before she displays a window about the need for activation.

Link to comment
Share on other sites

that's sounds great. I will also try to write the code in my free time. and if you do please share it.

Link to comment
Share on other sites

An easy is take serial number convert to hex AE-02-A1-.... so it makes no sense return an activation code that takes the HD serial number and writes say HD number to somewhere in the registery, this is a simple location to read when checking code every time. The registery is a bit harder to find stuff in than say a file. 99% of users will have no idea of how to get around the checking.

 

Obviously you make FAS files etc.

Link to comment
Share on other sites

Just a bit extra you have 22 modules that make up the software need check in each one but want to run code while testing un locked so use an old DOS bat file method of copying two files to make 1 new one. This is handy if you want to supply the software pre configured as you write the code lock into the software.

 

copy lisp1.lsp+check.lsp LISP1USER.lsp
copy lisp2.lsp+check.lsp LISP2USER.lsp
copy lisp3.lsp+check.lsp LISP3USER.lsp

 

Just a bit more you could get the serial number and pass it onto a internet server you can save a file to a remote server, where you can read it so no direct user interaction.

Link to comment
Share on other sites

you got nice idea but problem is .. I am from india and here people share internet access only to the sever not to local computers (in the small office from where I get some small automation works). so its hard to go though internet I am hoping to get some local security. code which I have posted its works fine to me and I don't have any issues with it and as written above I will add drive serial number check too. so I think it will work fine. but for doing it I have to check the pc name or now drive serial number manual and then create fas file for the same computer. (point was I want something that reduce my manual work). may be recompiling fas can work after getting drive and pc name/number . thank you for your help

 

 

I am new to this forum and I found to many useful posts from you. thank you for guiding newbies like me and I would also like to be programmer like you (please share some tips for it) :)

Link to comment
Share on other sites

That is the idea behind combining two files to make 1 new 1, have your new user run a lisp and send the code returned even disk serial number they will not know what it is. So make your new lisps by copy lisp1.lps+check.lsp which has the HD number in it and the check hard disk. The next step is to make FAS from the new combined files. You can run a lisp to make multiple fas files if you do not have post here. It should take only minutes to make, I know from personal experience.

 

; check.lsp change disk id number etc then join to other lisps
(if (not hardiskcheck )(Load "lisp22") ; use a name that is not obvious but its actually the hard drive check 
(setq did (#Asmi_Get_Drive_Serial "C:"))
(if (= did "123456")
(princ "passed")
(progn
(alert "Security fail\nPlease contact superman to fix")
(exit)
)
)

 

If your using a date check have a look at Lee-mac's get international time, this will stop the clock turn backers from restarting your software.

Link to comment
Share on other sites

Your error message Alert supports multiple lines

 

(Alert "Licence has been Expired") 

(Alert "Licence has Expired\nPlease call me on\n01 2345678\n\nto get reactivation code")

Link to comment
Share on other sites

@Solitechcadsolutions:

Maybe this is what you are after?:

You can include a list of all computer names (or hard disk serial numbers) in your code and check if found values are in the list.

(if (not (vl-position (getenv "COMPUTERNAME") '("NameA" "NameB" ...)))
 (progn
   (alert "No permission")
   (exit)
 )
)

Link to comment
Share on other sites

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...