Results 1 to 8 of 8

Thread: Trial versions

  1. #1
    Guest

    Question

    How do you create a limeted time demo version for an exe. eg I have created a functional HTML code generator and i want to give out free demo versions of the product that last 10 days. Is there any way to do this through vb?

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Time limited demos with full functionality are very easy to crack.
    I recommend you create an unlimited demo, that doesn't have full functionality. For example, some very important functions won't work in the demo.

    You can do it easily with directives.
    Code:
    #Const DemoVersion = 1
    
    ' ....
    #If DemoVersion = 1 Then
    Call MsgBox("This function is not available in the demo version of " & App.Title & "!", vbCritical)
    #Else
    DoSomething
    #End If
    The #If, #Else and #End If directives tell the compiler what to compile. In that case, only this will be compiled:
    Code:
    Call MsgBox("This function is not available in the demo version of " & App.Title & "!", vbCritical)
    If you change the #Const to 0, only the DoSomething will be compiled.

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4
    Lively Member
    Join Date
    Nov 2000
    Posts
    82
    This will work (sorry it's so long). The one nice thing about this extended code is that it allows you to ship a full-featured demo. If you change the "GetSetting" and "SaveSetting" references to a value other than the product name, you can make this pretty much uncrackable, except for very good registry hacks.

    Public Function DEMO_Check(sProduct As String, iDays as Integer)

    '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    ' this function tests for a Demo version - it specifically will allow the
    ' programmer to abort the app if either one of 2 conditions is true:
    ' 1. The current system date is more than 30 days after installation date
    ' 2. The current system date is earlier than the installation date (this
    ' prevents someone from pushing the install date and then running on a
    ' true date.
    ' if DEMO_Check returns True, then the app can be run.
    ' if DEMO_Check returns False, then the app should not be run
    ' it's up to the app to actually end the app
    ' The True/False returned by this routine signals the app whether or not to end
    ' Example use (inside the app):
    ' bThis_is_a_demo = True <--- this has to be set manually for a demo copy
    ' bOk_to_run = True
    ' If bThis_is_a_demo then
    ' bOk_to_run = DEMO_Check "App.ProductName, 30
    ' End If
    ' If Not bOk_to_run then
    ' MsgBox "This is a demo copy. You have exceeded the time " _
    ' & "period allowed for evaluation. Please contact YourName " _
    ' & "for further information.", vbOKOnly + vbCritical, g_sMsg
    ' End
    ' End If
    '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

    Dim sDate As String

    ' Is there a date listed in the Registry for this app (sProduct)?
    sDate = GetSetting(sProduct, "Install", "System", "")

    ' If not, this is the first run...we have to insert today's system date
    If sDate = "" Then
    SaveSetting sProduct, "Install", "System", Format(Now, "m/d/yyyy")
    DEMO_Check = True
    Exit Function
    End If

    ' if we got here, then this is NOT the first run. must perform 2 checks
    ' to ensure that app can be run.

    ' 1. is 'sDate" more than iDays days ago? If so, then 30 day test period has expired.
    If Date - CDate(sDate) > iDays Then
    MsgBox "This is a demo that was installed more than 30 days ago. Please contact " _
    & "DrillVue at http://www.drillvue.com for upgrading instructions.", _
    vbOKOnly + vbCritical, sProduct & " Message"
    DEMO_Check = False
    End If

    ' 2. is 'sDate" (the install date) later than today? Cute try!
    If CDate(sDate) > Date Then
    MsgBox "This is a demo that was installed on a date later than today. Please contact " _
    & "Our name for upgrading instructions.", _
    vbOKOnly + vbCritical, sProduct & " Message"
    DEMO_Check = False
    End If

    End Function

  5. #5
    Guest

    Unhappy Wow

    you were right Jeff. This is a hefty bit of code. Thanks i will check it out with my utility, get it registered and try to send you a copy of the application. do you know any sites that register your app's so people dont rob your software?

  6. #6
    Lively Member
    Join Date
    Nov 2000
    Posts
    82
    Yeah, I know it's long, but we use it in a module of routines that are added to every app we produce. We then call the routine(s) as needed. If nothing else, it gives you a good idea as to how to use the registry.

    As far as copying our software is concerned, there's not much you can do about it. Heck, even MS has to endure pirating. They've even tried to force the user to have the CD in the drive in order for the app to run. Once CD burners came out, that protection scheme went out the window.

  7. #7
    Guest
    Go to http://www.activelock.com for a free control for creating trial versions.

  8. #8
    Lively Member
    Join Date
    Nov 2000
    Posts
    82
    Megatron - Thanks for the tip. Downloaded ActiveLock and it looks great. However, do you know what the impact is on a Server-based app. Can just one user "unlock" the app or does every user have to do it, etc? Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width