License Key Script Example
Previous Top Next

'THINSTALL_RUNTIME_SCRIPT
' Declaring a function named "OnEndProcess" will cause Thinstall to execute this function when the program quits

Function OnEndProcess
max_days=GetEnvironmentVariable("TS_MAXDAYS")
expired=GetEnvironmentVariable("TS_EXPIRED")

dim browser_page

if (StrComp(expired, "1")=0) then
msgbox "Your evaluation license has expired!", vbOK, "Evaluation Warning"
browser_page = "http://thinstall.com/expired"
elseif (StrComp(max_days, "")<>0) then
msgbox "This is evaluation copy, you have " + max_days + " days remaining until you must purchase", vbOK, "Evaluation Warning"
browser_page = "http://thinstall.com/purchase"
else
msgbox "Your software license does not expire", vbOK, "Thank you for purchasing!"
browser_page = "http://thinstall.com/thankyou"
end if

set objShell = CreateObject("Shell.Application")
objShell.ShellExecute(browser_page)

end function


' This sample will check at the end of the program to see if the
' user is using a license key which has a limited number of days
'remaining. If the license key has such a limit, a dialog box will
'be displayed ' telling the user how many days left they have
'before their license expires. After the user click "Ok", a browser
' window is opened to a web purchase page.