
			TRIALWARE CORE v1.0
				by
			  Mike Baharmast
                          MB Scientific
			   CC 10-10-93


PRIORI: TRIALWARE CORE IS A TRIALWARE TYPE 1, IT MAY BE TREATED
AS SHAREWARE. MBS ENCOURAGES IT'S COPYING AND DISTRIBUTION ONLY
IF IT IS DONE WHOLLY AND IN AN UNALTERED FORM AND PURSUANT TO
THIS DISCLAIMER. ********* DISCLAIMER:  MB SCIENTIFIC AND
MIKE BAHARMAST HEREBY DISCLAIM ANY RESPONSIBILITY, DIRECT OR
IMPLIED, TOWARDS ANY CLAIM OF DAMAGE CAUSED BY THIS PACKAGE OR
ANY DERIVATIVE OF THIS PACKAGE. ANY ONE CHOOSING TO USE THIS
PACKAGE WILL HEREBY AGREE TO THIS WAIVER, AND THEMSELVES
WAIVE ANY RIGHT TO PURSUE LITIGATION BASED ON COMPENSATORY CLAIMS
AGAINST THIS PACKAGE OR ANY SOFTWARE DERIVED FROM THIS PACKAGE.
ANYONE NOT AGREEING WITH ABOVE WAIVERS IS STRICTLY PROHIBITED
FROM USING AND DISTRIBUTING THIS PACKAGE OR ANY DERIVATIVE OF
THIS PACKAGE. ANY ATTEMPT OF TAMPERING WITH THE TRIAL PERIOD
RESTRICTIONS OF A TRIALWARE SHALL RENDER THE TAMPERED TRIALWARE
AS DAMAGED AND NO LONGER VALID FOR USE. ANY TAMPERED PACKAGE
IS NOT TO BE USED OR DISTRIBUTED IN ANY FORM; FURTHER SUCH A
PACKAGE IS SUBJECT TO THE ABOVE DISCLAIMER.  


Table of Contents:

1.0)  Introduction to Trialware Core
  1.1)  General description of Trialware Core Executables
  1.2)  Initialization of Trialware

2.0)  Trialware Core Internals
  2.1)  TRY_DATE.EXE
  2.2)  TRY_MAST.EXE
  2.3)  TRY_SER.EXE

3.0) Example for setting up, distributing and running Trialware: COMIC
  3.1) Setting up the Trialware COMIC
    3.1.1) Setting up the Main Trialware Executable
    3.1.2) Static Initialization of Trialware COMIC
    3.1.3) Setting up the user installation procedure
  3.2) Running trialware COMIC
  3.3) Issuing a Serial Number
  3.4) Registering the trialware COMIC

4.0) Additional MBS Services for Trialware manufacturers 



						   
1.0- Introduction to Trialware Core

Trialware is hereby defined as any software which has a main executable
that is governed to run over X number of months and up to Y number of
times. Thereafter it will not run unless a serial number is purchased
from the manufacturer and inserted. To get the serial number the user
will query his trialware package for it's initialization value, send
it to the manufacturer and receive a serial number that is uniquely
derived from that initialization value for that trialware.

Trialware Core, consisting of a set of executables, will allow software
manufacturers to create trialware. We define two types of trialware,
the default type is strictly copy-righted and the start of the
trial period is set by the manufacturer upon issuing each copy of the
trialware. The general type or type 1 trialware covers shareware and
any other non-strict copy-rights and the start of the trial period is
when the user sets it up on his machine.

To setup Trialware Core on your machine, create a subdirectory, \TRYWARE,
on a hard disk partition and copy over the \TRYWARE directory from the
distribution media or the TRY_CORE.ZIP contents from the BBSes.
When that is done, from \TRYWARE, run

  INITRY

to initialize trialware core.

WARNING: ANY TRIALWARE, INCLUDING TRIALWARE CORE MAY BE INITIALIZED
ONLY ONCE BY THE USER. ANY ATTEMPT OF REINITIALIZATION OR COPYING
ANOTHER COPY OF A TRIALWARE ON TOP OF AN OLD ONE OR ANY OTHER
ATTEMPT TO GET AROUND THE TRIAL PERIOD RESTRICTIONS IS CONSIDERED
TAMPERING AND SUBJECT TO THE CLAUSES OF THE DISCLAIMERS OF THIS PACKAGE.

We have provided a complete sample trialware with Trialware Core in the
form of TRYSAMPL.ZIP. It is not necessary for running trialware core
and the binding c source files are included in TRY_CORE.ZIP.
TRYSAMPLE.ZIP is not automatically uploaded to all bbses. If you can't
find it, you may get it from MBS for $10 to cover postage and handling
and it will apply toward Trialware Core's registration.

To setup the sample trialware COMIC, xcopy the contents of the \COMIC
subdirectory of the distribution media (or TRYSAMPL.ZIP from BBSes)
to subdirectory \COMIC ON THE SAME PARTITION AS \TRYWARE.


TRIALWARE CORE'S EXECUTABLE TRY_SER.EXE IS ITSELF A TRIALWARE TYPE 1,
CAPABLE OF RUNNING UP TO 30 TIMES OVER A MONTH FROM THE TIME INITRY IS
EXECUTED. THEREAFTER YOU MUST OBTAIN A SERIAL NUMBER FROM MBS TO
CONTINUE USING IT. SERIAL NUMBERS ARE CURRENTLY PRICED AT $100.00.
 
Registration fee's and INITIALIZATION VALUES (detailed further
below) must be sent to:


     MBS
     7432 LAKE WILLIS DR.
     ORLANDO, FLORIDA   32821-9321
     407-238-1451

to obtain a serial number.


1.1- General Description of Trialware Core Executables

TRIALWARE CORE are a set of executables that allow a software developer to
build trialware. They are TRY_DATE.EXE, TRY_MAST.EXE and TRY_SER.EXE.


The main executable of the core is TRY_DATE, the manufacturer will use it
to set the starting point of the trial period (dynamic initialization)
and query for trial status. The users will use it to plug in their serial
number as well as querying their trial status.


TRY_MAST is used by the manufacturer to initialize the master and
distribution copies of the trialware (static initialization), this
is also referred to as tagging software to make it trialware.

TRY_SER is used by the manufacturer to issue a user a serial number.
Typically a user will send in his initialization value and payment
and will receive a serial number. TRY_SER itself is a type 1 trialware.
It may run up to 30 times and/or one month. Before running TRY_SER
the user must initialize it by running INITRY.EXE.
  
1.2 - More on Initialization 

As indicated previously there two types of initializations of trialware.

The manufacturer initializes the whole trialware package via TRY_MAST.
This is called static initialization, because it is sets values that
remain throughout the life of the trialware package, such as the
unique relationship between initialization values and serial numbers for
that trialware.

A user also must initialize his installation of the copy of the
trialware package so it can run. This is called dynamic initialization
because the values are setup at that point in time and although are
unique to an installation, vary from one installation to another.
Dynamic initialization is done via TRY_DATE.  

Initialization, in general, does three things:
 1- it sets the start and end point of the trial time (from present
 to present + X months). Type 1 trialware may do this dynamically, i.e.
 when the user copies the trialware to the harddisk and initializes it,
 setting the start time from that point. Default trialware (type not 1)
 sets the start of trial time to be when the manufacturer cuts the
 release copy. Type 1 is for shareware and non copy restricted software.
 Default type forces the user to get his software directly from the
 manufacturer.
 2- it sets the number of times the trialware may run. This is always
 done dynamically (i.e. via TRY_DATE)
 3- it sets the initialization value, which is required to issue
 a serial number. This is done statically for default trialware
 and dynamically for trialware type 1. The relationship between
 initialization value and the serial number is uniquely set for
 each trialware the first time TRY_MAST is executed.



2.0 Trialware Core Internals
 

2.1- TRY_DATE.EXE 

The main component of the trialware core is TRY_DATE.EXE, it determines
if a trialware is in it's trial limit, if it's limit is expired or
if it has been improperly copied. The manufacturer's main executable code
typically runs TRY_DATE, e.g. by issuing C code:

    system("TRY_DATE /?");

to query for trial period status. The resulting return message
is written to the text file MBTRY.LOG as a single 50 character string
record. The main code will then make an appropriate decision based on
the query returns.

TRY_DATE.EXE produced log messages are:

In Startup and User Initialization:
M101 Can't open tag_file                          >
M102 Can't find trial times information           >
M200 TRIALWARE APPLICATION ALREADY INSTALLED      > 
M201 System Failure; Can't create verifier        >
M202 System Error, can't initialize verifier      >
M210 TRIALWARE APPLICATION ALREADY INSTALLED      > 
M211 Can't open time handler try again            >
M218 Instal_ setup completed normally             >

In Trialware Verification:
M301 System Failure; can't open verifier          >
M302 System Error, can't read from verifier       >
M303 REGISTERED PRODUCT                           >
M304 PACKAGE IN TRIAL PERIOD                      >
M305 Trial allotment has expired                  >
M306 Can't open time handler try again            >

General:
M501 Can't open tag file try again                >


M101,102,M200,M201,M202,210,211,M301,M302,306,M501 are produced when
trialware package is illegally copied or tampered with, the automatic
decision should then be to abort the trialware.

The main messages subject to decision making are 303, 304 and 305.
Typically 303 and 304 should allow the continuation of trialware and
305 should abort the trialware.


Further, TRY_DATE initializes the trialware the first time a user is to
try it (dynamic initialization), it also lets the user know how much is
left in the trial period, and lastly it plugs in the serial number when
obtained.

These options are selected by giving TRY_DATE appropriate run time
switches:

** Initialization switch
   /I01 #_of_trial_times [trialware_type] [trial_months]

  -- #_of_trial_times is an integer, e.g. 30 meaning that the trialware
     may run up to 30 times, this must be present

  -- trial months is an integer, e.g. 2 meaning that the trialware is
     to run up to 2 months from the initialization date; optional, must
     be present if type = 1;

  -- trialware type may be 1, or not present(default). Type=1 initializes
     the trial time from the time /I01 switch is issued, otherwise
     trial time begins from when the manufacturer cuts the trialware
     by running TRY_MAST; optional

		 
  For example, INIT_X.EXE provided with the sample trialware consists
  of the line of code:

  TRY_DATE /I01 30 1 2

  It has to be run before the trialware can be launched. It sets up the
  trialware COMIC (a shareware game) to run up to 30 times and/or up to
  2 months, which ever may come first.

  /I01 switch is only used once, thereafter, TRY_DATE will produce an
  error in MBTRY.ERR.


** Verification switch

  /?

  -- i.e. TRY_DATE /? is issued every time the trialware code is to query
     for the trial status. The results will be returned by TRY_DATE in the
     log file MBTRY.LOG. As shown above the main decision whether to
     load the trialware or to abort should hinge upon the return message
     from this operation. The example code provided in COMIC: LAUNCH.C
     demonstrates the utilization of  TRY_DATE /?


** Serial number switch

  /SER

 -- /SER is issued by the user by running TRY_DATE /SER when
    the serial number is obtained from the manufacturer. TRY_DATE
    will test the validity of the serial number, if
    invalid it issues an error message to that effect on the
    screen. Otherwise it marks the trialware as registered and notifies
    the user. Thereafter the trialware is recognized as registered.

	
** User Query Switch
  
  /INF

 -- /INF is used by the user to get trialware information. It
 is done by issuing TRY_DATE /INF. The user then gets the following on
 the screen:

  Initialization value of this copy is XXXXX
  Deadline date= YYYYYY
  Software ran ZZ times out of total of WW trial limit

If the package is already registered the message will be:

  Trialware is registered, the serial number is XXXXXXXXXX
   

 Note1-the initialization value is created when trialware is cut
       (when TRY_MAST is run), and for type 1 trialware during
       user initialization (when TRY_DATE /I01 is run). It is
       needed to produce a serial number (when TRY_SER is run). 

 Note2-TRY_DATE must be included in the release and must end up in
       the install subdirectory on the user's machine and be accessible
       to the trialware main executable so TRY_DATE /?, etc. may be
       issued.


2.2- TRY_MAST.EXE

TRY_MAST tags a software package as trialware and is necessary for
it's existence as such. Typically a software manufacturer will finish
his package and have it in a releasable form on some subdirectory
on hard disk. In our example, COMIC in it's releasable form will be
in the subdirectory \COMIC; further, the trialware core is in the
subdirectory \TRYWARE. The manufacturer will then issue the command

   \TRYWARE\TRY_MAST 2 COMIC

from the \COMIC SUBDIRECTORY. This will create file TRY_TAG in the COMIC
subdirectory, as well as other things. TRY_TAG has the information
necessary for running the trialware, and it must be copied over to the
distribution disk as well as the install directory of the trialware
on the user's machine, i.e. it must be accessible to TRY_DATE.

TRY_MAST must take the run time form

   TRY_MAST TRIAL_MONTHS TRIALWARE_NAME

where  TRIAL_MONTHS = an integer representing the trial period from
		      initialization, this can be overwritten during
		      dynamic initialization; e.g. 2 = 2 months

       TRIALWARE_NAME = a unique name for this trialware, distinguishing
			it from any other one that may exist. Must not
			be longer than 8 characters; e.g. COMIC                


TRY_MAST may be reissued for default type trialware to set the
start of trial time for each released disk set.

Note: Be sure to run TRY_MAST on the right subdirectory, in case more
than one trialware exists as in \TRIALWARE and \COMIC. TRY_MAST
may be run more than once, e.g. for default trialware, and will over-
write some of the TRY_TAG information. 


2.3- TRY_SER.EXE

The manufacturer will use this to issue serial numbers for users.
When a user decides to register for the software he will send in
his payment and his initialization value. TRY_SER must be run from
the trialware directory for which a serial number is to be issued,
i.e. TRY_SER uses TRY_TAG and other information in the local
subdirectory. For example, in \COMIC type:

   \TRYWARE\TRY_SER 


TRY_SER will ask for the initialization value and issue the serial
number. The relationship between the initialization value and the
serial number is unique for every trialware package and is determined
the first time TRY_MAST is run, and is not subject to change.


TRY_SER itself is a type 1 trialware, and must be initialized by running
INITRY.EXE. Manufacturers may run it up to 30 times and/or 1 month
from initialization, which ever comes first.
Manufacturers that continue with issuing trialware should send in
their initialization value to receive a serial number. To find
out the initialization value run TRY_DATE /? from the TRYWARE
directory. 
TRY_SER will only work for a registered trialware or for one in the
trial period. Trialware manufacturers should issue themselves a serial
number first.



3.0 Example for setting up distributing and running Trialware: COMIC

In this document a shareware example, COMIC, is used to demonstrate how
a software, i.e. COMIC, is turned into a piece of trialware that can run
up to 2 months or 30 times whichever may come first.


There are four parts to this example. In part one you will wear the
manufacturer's hat to set up the trialware for distribution.
In the second part you will play the user, you will initialize and
run the trialware, and get the initialization value. In the third part
you will be the manufacturer again and issue the serial number for the
initialization value. In the fourth and last part you will plug in
the serial number to become a registered user. You may charge yourself
a registration fee to add a sense of reality and profit to this
exercise.


3.1) Setting up the Trialware COMIC

3.1.1) Setting up the Main Trialware Executable

It is assumed that your software package is in it's finished releasable
form, as is COMIC in this case. Next you have to decide how to alter
your main executable to call TRY_DATE/? to query for trialware status and
make decisions appropriate to the return message in MBTRY.LOG. In most
cases the code will be written and compiled in the trialware main
executable, as is the case with TRY_SER. In the case of COMIC however
this can not be done. So the program LAUNCH.C was written (source
included in \COMIC) to demonstrate this logic:

 -TAKE THE TRIALWARE EXECUTABLE ARGUMENT COMIC
 -CALL TRY_DATE /? TO RECEIVE VALIDITY MESSAGE.
   -IF MESSAGE=INVALID GENERATE ERROR & QUIT;
     ELSE CONTINUE
 -CUT COMIC.EXE FROM TRIALWARE COMIC, AND RUN IT
 -DELETE EXECUTABLE AND RESTORE TRIALWARE COMIC

 As shown above COMIC main executable had to be altered to demonstrate
 a method of setting up and running an executable from it's trialware
 form, which shouldn't execute. In this case the main executable,
 COMIC.EXE, was simple renamed to COMIC. LAUNCH simply copies COMIC
 to COMIC.EXE, executes it and upon completion deletes it.

 NOTE: TRY_DATE is a dos executable, it may be called from any
 program/operating system that can run a dos .exe (child process),
 e.g. in dos you may use SYSTEM (used in example LAUNCH.EXE), EXEC,
 SPAWN functions, etc.; in windows use WinExec; in os2/pm use
 DosStartApp, etc.; then simply read in the query result in
 from MBTRY.LOG file and run your decision-making algorithm on it.

3.1.2) Static Initialization of Trialware COMIC

Switch to the COMIC subdirectory. Then type

  \TRYWARE\TRY_MAST 2 COMIC


That Simple. This will now establish COMIC as a trialware on the
manufacturer's machine (his disk partition/directory to be exact),
it creates TRY_TAG file as well as doing other things.
Thereafter we may issue serial numbers from the COMIC subdirectory.
 

3.1.3) Setting up the user installation procedure

The trialware on user's machine needs access to TRY_TAG as created in
3.1.2, and to TRY_DATE.

As previously explained the first thing the user must do is to initialize
the trialware, otherwise TRY_DATE /? query will return an "IMPROPER
INSTALLATION" error message in MBTRY.LOG. So we must provide
a means for users to run an initialization like:

   TRY_DATE /I01 30 1 2

as is the case here in, setting up COMIC to run up to 30 times, over
2 months from the time of user's initialization (type=1).

The above line is simply compiled in INIT_X.C to produce INIT_X.EXE,
and the installation process consists of:

  -- copy *.* from comic distribution disk to /COMIC
  -- run INIT_X

YOU DON'T HAVE TO SETUP ANYTHING. IF YOU NOTICE, TRY_DATE AND INIT_X ARE
ALREADY IN THE COMIC SUBDIRECTORY.   
     
Source for init_x is in \COMIC


NEXT, IN PART 2, YOU WILL PLAY THE USER, PRETENDING TO HAVE ALREADY
OBTAINED COMIC TRIALWARE FROM SOME BBS AND COPIED IT OVER TO \COMIC
SUBDIRECTORY, WHICH IS WHAT YOU ALREADY HAVE.

3.2) Running trialware COMIC

Initialize the trialware by running:

   INIT_X

from that point you may launch COMIC up to 30 times over a two month period.
COMIC will not launch without initialization. To launch comic type:

   LAUNCH COMIC

You can lookup the COMIC doc to learn about the game.

NOTE: source for launch.c is in \COMIC 

You may query the trial status by executing:

  TRY_DAT /INF

When you are ready to go to the next part, write down the serial number
provided by TRY_DAT INF.

NEXT, IN PART 3 YOU WILL BE THE MANUFACTURER, AND USE TRY_SER TO
ISSUE A SERIAL NUMBER FOR THE GIVEN INITIALIZATION VALUE.

3.3) Issuing a Serial Number

From \COMIC subdirectory run:

  \TRYWARE\TRY_SER

This binds TRY_SER to the initialization information that you created in
this partition\directory when you first executed \TRYWARE\TRY_MAST.
As you see then, you may have many trialware packages, each with
their own subdirectory (they may or may not reside on the same partition)
created and used in the above way.

TRY_SER will ask you to enter the initialization value, and will give you
a serial number.

NOTE: TRY_SER IS A TRIALWARE. IT WILL NOT BIND TO EXPIRED TRIALWARE.
I.E. THIS EXERCISE MUST TAKE PLACE WITHIN THE TRIAL PERIOD.
MANUFACTURERS MUST FIRST REGISTER THEIR OWN TRIALWARE MASTER COPY
(GIVE THEMSELVES A SERIAL NUMBER FIRST). THEN THEY MAY RUN TRY_SER
ON THE SUBDIRECTORY TO GENERATE SERIAL NUMBERS FOR USERS.


NEXT, YOU WILL BE THE USER AND PLUG IN THE SERIAL NUMBER.

3.4) Registering the trialware COMIC

From the \COMIC subdirectory run

 TRY_DATE /SER

You are asked for the serial number. Enter it. If it is invalid, due
to a typing mistake, it will tell you. If it is valid, it will tell
you as well as register you. To further verify, you may run

 TRY_DATE /INF

and get the REGISTERED USER screen message or run

 TRY_DATE /?

to get the REGISTERED USER message in MBTRY.LOG.



4.0) Additional MBS Services for Trialware Manufacturers


MBS can be contracted to:

    1) Consult to convert or physically convert software to trialware
       using either established methodology or proprietary methods
       unique to a given software. Trialware code in .c, .obj or
       .dll form may be integrated directly into manufacturer's code.

    2) Manage and distribute trialware and or trialware serial numbers.


For more details write MBS at:

      7432 Lake Willis Dr.
      ORLANDO  Florida   32821-9321

Or call or fax  407-238-1451
	   
