Creating Installers For Multiple Versions of Clarion

By Dave Beggs

Posted September 25 2008

Printer-friendly version

Recently there were several newsgroup threads asking about creating Clarion third party product installers for both C6 and C7. There have been several suggested ways of doing this, and all seem quite complicated. As a veterinarian, I'm well aware that here is more than one way to skin most species, and I thought it worth reporting a way which seems fairly simple.

Basically, the third party directory structure is the same for C5-C6.3 and different for C7. Also, at the moment, no one is publishing templates for C7, but hopefully that need will come soon!

The way I'm going about creating SetupBuilder installers for my Smart-Type template (shameless plug!) is as follows:

First, create two Features, one called Clarion6 and one called Clarion7 (Figure 1).

Figure 1. Creating the install features (view full size image)

Next, create a Setup Type for Clarion6 that includes the Clarion6 feature, and one called Clarion7 that includes the Clarion7 Feature (Figure 2).

Figure 2. Creating the setup types (view full size image)

Add a wizard dialog to check the Clarion version (Figure 3).

Figure 3. Adding a wizard dialog (view full size image)

You create the wizard dialog in the script editor (Figure 4) by choosing Wizard - Define Dialog and then Clarion Environment Detection (if this option is not present, go to Tools | Options and Enable Clarion Support).

Figure 4. Creating the wizard dialog (view full size image)

Make sure the installation folder is set to %_SB_INSTALLDIR%, which is the default (Figure 5).

Figure 5. Verifying the installation folder

Put the following code in the wizard dialog (Figure 6):

If %_SB_DIALOGID% Equals "3" Then

  If %_SB_RETURN% Contains "7." Then

    Set Active Setup Type to "Clarion7"

  Else

    Set Active Setup Type to "Clarion6"

  End

End
Figure 6. Adding the dialog code (view full size image)

In the above example the Clarion Detection Dialog was #3; you may need to change this number.Basically the code says:

If this is the Clarion Detection Dialog
  If return value includes a 7
     Set the Active Setup Type to Clarion7
  Else
     Set it to Clarion6  ! which has the same folder structure for C5 - C6.3
  End
End

This works okay since all versions less than 7 have the same folder structure. You can add salt to taste.

Now, in the Files and Folders section of the visualiser you will see a Clarion6 and a Clarion7 folder stub that you can use to install different files depending on which version of clarion was chosen (Figure 7).

Figure 7. The C7 stub folder (view full size image)

That's all there is to it. Creating installs for multiple Clarion versions is easy!

Article comments

Post a comment

You must be logged on to post comments.

Clarion Roadmap

Try the roadmap (beta)

Search ClarionMag

 

Advanced search

From the archives

Agile, Test-Driven Development In Clarion#, Part 2

5/12/2008 12:00:00 AM

In this second of two articles on Test Driven Development, Dave Harms walks through the process of creating tests cases and then writing the Clarion# code to satisfy the tests.