Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shareware protection system for macros
#1
Using these functions, you can easily protect your commercial macros from using beyond the evaluation period.

You and your cutomers must have QM 2.1.5 or later.
_________________

Version 1.0.1.
Fixed bug causing the dialog to stop working when encrypted.

Version 1.0.2.
Computer-specific registration codes.
More clear and secure.

Version 1.0.3.
Can be used in exe too.
Uses registry hive HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE. Using local machine would fail on Vista or when running as a limited (non admin) user. Please review registry variables in your SM_About and SM_CanRun. You probably have to change the value assigned to sm_registry_key_first_run.


Attached Files
.qml   Shareware macros.qml (Size: 18.48 KB / Downloads: 2,674)
#2
I had a fast look through this and looks nice 8)

Now we need a way to retrive and test codes from a webpage and this system will be dynamic :wink:
Im looking forward to your solution to this approach :lol:
Well thats all for now, 3M
#3
How exactly it should work?
#4
Well uhmmm...
How about it accesses a URL with parameters, then captures some portion from the output?

That way it can send the used code to a preconfigured web address and let the website provide feedback about the validity of the code.

If that works the maintainer of the macro can have a script, javascript/CGI/whatever on a website with active codes he gave out.
And also have a posibility to revoke codes that way easyly and on the fly...

You know what i mean?
Well thats all for now, 3M
#5
What if the user is disconnected from the Internet, or the url is temporarily unavailable? Other problem - delay, especially if the url is unavailable. In some cases, there may be delay of 10 - 30 seconds.

Maybe at first validate the regcode locally, then asynchronously access the url, and, if the regcode is invalid, lock later?
#6
Well thats ofcourse up to the shareware writer....
He could also maybe set it to check once a week...
Besides its only checked at startup of the macro, so a small delay wont be a problem i think...

But incase of time-outs there should be a way to notice the user and let it retry...
Well thats all for now, 3M
#7
Version 1.0.2.
Computer-specific registration codes.
More clear and secure.
#8
Version 1.0.3.
Can be used in exe too.
Compatible with Vista.
#9
How do u find the reg code in the clipboard?
thanks this looks like a great file
#10
Can I change this to hours with 0.1 or whatever or do i need to make a new code for mins
#11
never mind I know you cant use 0.1 I have looked through it and I was wondering if i may get a bit of help making it go by hours instead of days or mins instead of day.
#12
never mind i figured it all out thanks for sharing this code it really is what i needed
#13
How to change the code as below to get the network time not local time?
Function SM_CanRun
Code:
Copy      Help
DATE date_first date_now.getclock

Because I change the local time tor first day, the protection will fail and it can use again.

BTW, I want to modify the code to time limited macro, for example, one reg code will only use the macro 30 day(for example, 9/1 ~9/30, not real usage time), and the macro will need new reg code from me after 30 day, did you have any ideas or any macros?
#14
Get time from internet? You can use function IntGetFile to download time from a time server or your website. But it is slow and unreliable, eg user can edit hosts file to disable connection to the webserver.

Instead you can use a counter and date-last-run. Save them in registry. When date-today is not = date-last-run, set date-last-run = date-today and increment counter. When counter is >30, disable your software.

I don't want to develop the shareware protection functions more.
#15
Thanks for your advices. It was useful for me.

Other quesions as below,

1. From the same macro:
Function SM_About
Code:
Copy      Help
if(days_left>0) e11.format("UNREGISTERED. %i days left." days_left-1)

I want to show the time consisted of year, month, day, hour, minute...,how to modify the code?

2. I test code as below
Macro Macro3
Code:
Copy      Help
DATE DAY1.getclock
wait 5
DATE DAY2.getclock
DATE day_diff=DAY1-DAY2
out day_diff

why the result is
am 12:00:05?

3. from QM help:
Macro Macro3
Code:
Copy      Help
DATE d="4/1/2003"
;add 2 days
d=d+2
out d
;subtract 1 hour
SYSTEMTIME st
st.wHour=1
out d.sub(st)
;get difference in hours
out d.diff("4.1.2003" st 1)
out "%i/%i/%i %i:%i:%i" st.wMonth st.wDay st.wYear st.wHour st.wMinute st.wSecond

the results:
2003/4/3
2003/4/2 下午 11:00:00
Error (RT) in Macro3: 0x80020005, 類型不相符。. ?

and fail in

Macro Macro3
Code:
Copy      Help
out d.diff("4.1.2003" st 1)

why?and how to modify?
#16
1. str function timeformat. Or floating toolbar -> Text -> Text with date/time.

2, 3. DATE variables should be used to store date, not date difference. Better use DateTime.
Code:
Copy      Help
DateTime DAY1.FromComputerTime
DateTime DAY2=DAY1; DAY2.AddParts(2) ;;+2 days
long day_diff
DateTime.TimeSpanGetPartsTotal(DAY2-DAY1 day_diff)
out day_diff

3. Probably the time string format is unavailable on your PC.
#17
Thanks again, it is useful for me.
#18
Hello i am trying to understand this but when i make new registry code (i also check it regedit it is created) and press unlock nothing happens it just close about page.
i dont understand where i make mistake
thank you Smile


Forum Jump:


Users browsing this thread: 1 Guest(s)