iInstall Reborn Creator – License Code

On this page you enter details about requesting a License Code from the user that installs the package you are building.

At time of installation, the user is requested to enter a License Code, that you must provide. When the user have entered the code and clicks on the button ‘Next’, the command you have entered in the field ‘License Code program’ will be executed. How the License Code is build and what characters that are needed, is entirely up to you.

Meaning of the fields:

Field Description
Length of the License Code This is the actual number of characters/digits that the user must enter.
License Code command In this field you must enter the command to be called after the user have entered the License Code. The field support two replacement values:

 

  • %LICCODE%
    At run-time this replacement value will be replaced by the actual code entered by the user.
  • %INSTLIB%
    At run-time this replacement value will be replaced by the latest /QSYS.LIB library used for installation.
    If you have created a package that first installs into the library ‘MYLIB1’ and then installs into the library ‘MYLIB2’, then this replacement value will contain ‘MYLIB2’.
Type of License Code Install Reborn Installer will allow the user to type a License Code of the following types:

 

  • Hex
    The License Code that the user must enter consist of the following characters:
    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, FPlease note, that lower case a, b, c, d, e, f is not supported in this type.
  • Numbers
    The License Code that the user must enter consist of the following characters:
    0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • Alphanumeric
    The License Code can consist of any character.

Please note.
The License Code must not contain the character ‘ as it is the character to start and end constants.

Example of a License Code command:

CALL %instlib%/MyLicInst Parm(‘%liccode%’)

This command will send a message to QSYSOPR with the license code entered and the library that will be used.

You can enter the two replacement markers in upper or lower case.

Please note, that if the package will only contain IFS folders and objects, a library will never be found, and in this case the command must not refer to the replacement variable %instlib%.

Added in V1.40.

Example of a License Code installation program:

/*                                                                  */
/* LICCDECL                                                         */
/* --------                                                         */
/* Example of a program to be called from iInstall to verify and    */
/* install a License Code.                                          */
/*                                                                  */
/*                                                                  */
/* We take the two parameters. The first '&LICCODE' contains the    */
/* License code that the user entered in iInstall's prompt. The     */
/* second '&INSTLIB' is the name of the library that was installed. */
/* This is infact a trick that allows that the user re-name the     */
/* library during the installation. The field 'Command to run' on   */
/* the 'License' page in iInstall, contains the value               */
/* 'CALL %INSLIB%/LICCODECL PARM('%LICCODE%' '%INSTLIB%')'.        */
/*                                                                  */
            PGM        PARM(&LICCODE &INSTLIB)

             DCL        VAR(&LICCODE) TYPE(*CHAR) LEN(10)
            DCL        VAR(&INSTLIB) TYPE(*CHAR) LEN(10)

            DCL        VAR(&MSGDTA) TYPE(*CHAR) LEN(80)
            DCL        VAR(&MSGID) TYPE(*CHAR) LEN(7)
            DCL        VAR(&MSGF) TYPE(*CHAR) LEN(10)
            DCL        VAR(&MSGFLIB) TYPE(*CHAR) LEN(10)
            DCL        VAR(&ERRORFL) TYPE(*LGL)
/*                                                                  */
/* Set-up a global error handler.                                   */
/*                                                                  */
            MONMSG     MSGID(CPF0000 MCH0000) EXEC(GOTO CMDLBL(ERROR))
/*                                                                  */
/* Verify the License Code entered by the user. In a 'real world'   */
/* program, the code should be more complex and (of cause) contain  */
/* information about the machine serial number and possibly the     */
/* model number too.                                                */
/*                                                                  */
            IF         COND(&LICCODE *EQ '1122334455') THEN(DO)
/*                                                                  */
/* We try to delete the dataarea before re-creating it.             */
/*                                                                  */
            DLTDTAARA  DTAARA(&INSTLIB/SUPERDTA)
            MONMSG     MSGID(CPF2105)
/*                                                                  */
/* Create the dataarea with the License Code.                       */
/*                                                                  */
            CRTDTAARA  DTAARA(&INSTLIB/SUPERDTA) TYPE(*CHAR) +
                         LEN(10) VALUE(&LICCODE) TEXT('License Code')
/*                                                                  */
/* Everything went fine, let iInstall Continue.                     */
/*                                                                  */
            RETURN
            ENDDO
/*                                                                  */
/* The License Code was not correct. Let the user know.              */
/*                                                                  */
/* Note that sending a '*ESCAPE' message is what results in, that   */
/* iInstall is aware that something went wrong during the           */
/* installation of the License Code.                                */
/*                                                                  */
/* The message that you send, is the actual message displayed to    */
/* the user.                                                        */
/*                                                                  */
            SNDPGMMSG  MSGID(CPF9898) MSGF(QSYS/QCPFMSG) +
                         MSGDTA('The License Code is not valid. +
                         Please re-type it.') MSGTYPE(*ESCAPE)
/*                                                                  */
/* Global error handler.                                            */
/*                                                                  */
ERROR:      IF         COND(&ERRORFL) THEN(SNDPGMMSG MSGID(CPF9999) +
                         MSGF(QSYS/QCPFMSG))
            CHGVAR     VAR(&ERRORFL) VALUE('1')

MSG:        RCVMSG     MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) +
                         MSGF(&MSGF) SNDMSGFLIB(&MSGFLIB)
            IF         COND(&MSGID *NE ' ') THEN(DO)
            SNDPGMMSG  MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +
                         MSGDTA(&MSGDTA) MSGTYPE(*ESCAPE)
            ENDDO
            ENDPGM