Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014

    Do not pass GO do not collect $200

    Using the code below I am attempting to keep the end user from messing around with the system clock. When the system clock is changed, The area in RED does show up but does not exit as it should. It continues through to the code in Blue.
    What needs to change?

    B.T.W. This code is not self-reliant (stand alone), it pulls from other pages.




    if Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\741993\\Data") then

    todays_date = String.ToNumber(System.GetDate(DATE_FMT_JULIAN));
    Crypto.Base64DecodeFromString(Registry.GetValue(HK EY_LOCAL_MACHINE, "Software\\741993\\Data", "cj", false), _TempFolder.."741993.tmp");
    current_cj = String.ToNumber(TextFile.ReadToString(_TempFolder. ."741993.tmp"));
    File.Delete(_TempFolder.."741993.tmp",false, true,false,nil);
    if (todays_date < current_cj) then
    --System clock has been turned back before the initial install date
    result = Dialog.Message("ERROR", "There has been an error with your systems clock. This program will now exit.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    File.Run("DATA\\1993ICU2.dll", "", "", SW_SHOWNORMAL, false);
    Application.Exit();

    else
    current_cj = String.ToNumber(System.GetDate(DATE_FMT_JULIAN));
    TextFile.WriteFromString(_TempFolder.."741993.tmp" , current_cj , false);
    encdate = Crypto.Base64EncodeToString(_TempFolder.."741993.t mp", 0);
    File.Delete(_TempFolder.."741993.tmp",false, true,false,nil);
    Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\741993\\Data", "cj",encdate, REG_SZ);
    end

    Crypto.Base64DecodeFromString(Registry.GetValue(HK EY_LOCAL_MACHINE, "Software\\741993\\Data", "sj", false), _TempFolder.."741993.tmp");
    start_sj = String.ToNumber(TextFile.ReadToString(_TempFolder. ."741993.tmp"));
    File.Delete(_TempFolder.."741993.tmp",false, true,false,nil);

    if (current_cj >= (start_sj + 365)) then
    -- product has expired
    result = Dialog.Message("Notice", "Your installation of this product has expired. This program will now exit.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    File.Run("DATA\\1993ICU2.dll", "", "", SW_SHOWNORMAL, false);
    Application.Exit();
    end

    else
    if File.DoesExist(_SystemFolder .. "\\741993.log") then
    encdate = Crypto.Base64EncodeToString(_SystemFolder.."\\7419 93.log", 0);
    Registry.CreateKey(HKEY_LOCAL_MACHINE,"Software\\7 41993\\Data");
    Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\741993\\Data", "sj",encdate, REG_SZ);

    TextFile.WriteFromString(_TempFolder.."741993.tmp" , System.GetDate(DATE_FMT_JULIAN), false);
    encdate = Crypto.Base64EncodeToString(_TempFolder.."741993.t mp", 0);
    File.Delete(_TempFolder.."741993.tmp",false, true,false,nil);
    Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\741993\\Data", "cj",encdate, REG_SZ);
    else
    TextFile.WriteFromString(_SystemFolder.."\\741993. log", System.GetDate(DATE_FMT_JULIAN), false);
    encdate = Crypto.Base64EncodeToString(_SystemFolder.."\\7419 93.log", 0);
    Registry.CreateKey(HKEY_LOCAL_MACHINE,"Software\\7 41993\\Data");
    Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\741993\\Data", "sj",encdate, REG_SZ);
    Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\741993\\Data", "cj",encdate, REG_SZ);
    end
    end

  2. #2
    SUF6NEWBIE Guest
    Bruce...quick suggestion

    break some of your code up into 'smaller' controlled pieces
    (drop some of the "else" controls) this will help you
    diagnose..you could also try breaking it up into smaller
    'globals' that you can call 'conditionally from the First Global
    --are they mucking around with systemclock--registry key exist etc.
    call in your 'Startup' actions
    make separate global funcs. for 'red' and for 'blue' etc

    maybe call your target func from the 'page'-s your using

    If ...... then
    --call the red stuff global func.
    redstuff();
    --the red func can have the App.exit
    end

    if ...then
    --call the blue stuff func.
    bluestuff();
    end

    if (not) ..... then
    ..whatever else here
    end

    using the separate funcs can make it easier to 'tweak' each major
    'control you're after

    very broard I know, hope helps a litttle

    BTW another possibility could be to change from num days
    to total hours of usage regardless of current date...
    Last edited by SUF6NEWBIE; 06-07-2004 at 12:02 PM.

  3. #3
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    Thanks SUF6NEWBIE for your input!

  4. #4
    SUF6NEWBIE Guest
    ..one guy I know wacks the 'install date' & 'file date' info as
    part of the 'registry entry' trial serial number the user enters
    (does some math calc and 'cryptos' for the actual serial in the
    registry..)

  5. #5
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    Yep that's what's going on here using the MAC address.

Similar Threads

  1. Pass Custom Variable to MS-DOS BatchFile?
    By swambast in forum Setup Factory 6.0
    Replies: 4
    Last Post: 06-07-2004, 11:40 AM
  2. Pass URL to Browser
    By Tux in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 04-05-2004, 11:38 PM
  3. Pass string's pointer in CallDLL function
    By sonysys in forum Setup Factory 6.0
    Replies: 1
    Last Post: 09-12-2003, 02:05 PM
  4. Web Object - javascript errors - doesn't pass IE params
    By thesven in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 08-29-2003, 09:48 PM
  5. Enhancement: Pass directory to update..
    By jassing in forum Visual Patch 1.0
    Replies: 0
    Last Post: 02-22-2001, 01:39 PM

Posting Permissions

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