SetupBuilder: Time limited install

I had the need to create an install with Setup Builder 7 that would be time limited so that it would not run after a certain date. Obviously this is no foolprof method since it can easily be bypassed by changing the date in the computer, but for what I wanted it was perfect!

Set Variable %IT_TODAY% to FUNCTION:Get System Info
  (Current Date) -- Format "12"
If %IT_TODAY% Greater Than "20100228" Then
   Display Message Box "This time limited Beta build 
     install expired on Fe..." -- 
     "Time limited Beta install has expired"
   Exit Installation(99)
Else
   Display Message Box "Note that this is a time limited 
    Beta build instal..." -- 
    "Time limited Beta install"
End

Note that the lines wrap and in the actual script this is only 7 lines, which start out bold in the box above.

The first line get's the current date from the computer where the install is running in a "YYYYMMDD" format. The IF statement compares the value with "20100228" - February 28, 2010, and if the current date is greater, then it displays an error message and exits the install. If it is equal or less, then it displays a warning message about this being a time limited install and continues.

Arnor Baldvinsson

Leave a Reply