any installscript ninjas up?

Discussion in 'OT Technology' started by crazybenf, Nov 21, 2007.

  1. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    im dabbling in IS and need some help... I'm no windows coder, so this may be so easy it's not documented. :o

    I'm doing serial number auth based on an algorithm. SN is stored as 3 vars. SN is entered by client during install session.

    I want to export those 3 vars into a new file on the system.

    How the hell do I output to a file in installscript?! :eek4:
     
  2. FLY-FAST

    FLY-FAST OT Supporter

    Joined:
    Sep 30, 2003
    Messages:
    8,713
    Likes Received:
    3
    Location:
    boston, MA
    two words...

    regular expressions
     
  3. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    how about a few more words.

    More details:

    Code:
    function SdCustomRegExValidatePassword( svSerial_1, svSerial_2, svSerial_3 )
        STRING svSub_svSerial_3;
        NUMBER nCalculation;
        begin
           ///////////////////////////////////////////////////////////
           // Place your Serial Number Validation Code here
           // This sample looks for:
           //             szSerial_1 = "PRCODE"
           //             szSerial_2 = "0011"
           //             szSeiral_3: Must be 10 digits long, and the
           //                         last 6 digits must be a multiple
           //                         of 15. For example:
           //                           9900000015
           //                           1000000030
           ///////////////////////////////////////////////////////////
           if (svSerial_1 = "PRCODE") then
                   if (svSerial_2 = "0011") then
                        if ( StrLength(svSerial_3) != 10 ) then
                            return FALSE;
                        endif;
                        StrSub (svSub_svSerial_3, svSerial_3, 4, 6);
                        StrToNum (nCalculation, svSub_svSerial_3);
                        if (nCalculation = 0) then return FALSE;
                            endif;
                        // calculate remainder
                        nCalculation = (nCalculation % 15);
                        if (nCalculation = 0) then return TRUE;
                            endif;
                        endif;
                    endif;
           return FALSE;
        end;
    
    
    Above is the code sample I'm using to learn about matching serials. I want to have it output a single variables value to a text file.


    In PHP I'd just do a fopen/fwrite, or a system-> cat to write to an external file.. I just have no idea how to do it in this intelliscript shit. Any help would be appreciated. :hsd:
     

Share This Page