|
||
Despite the complex work that it does, First Deploy technology is fairly easy to setup in your application.
Note that before you configure the template, you need to create and export your file deployment container with the ProPathLoader application.
Enabling First Deploy
The first step in enabling the First Deploy technology is to check the box on the global extension template.
Enable deployment BEFORE the login procedure
Select this option if you want the option of deploying selected file groups BEFORE the login procedure is called.
This gives you the ability to do things like distribute a security file with default login values to be used the first time your program is ran.
A note on "Default" values
The ProPath template lets you specify "defaults" for the name/owner of the deployment container as well as rules for when then files will be deployed. These values get populated automatically to the entries for the individual file groups (to save you a lot of typing). However you can override the default values for any export group as needed.
The Default Storage Filename ( a.k.a Deployment Container Name)
The next step is to specify the name of the default storage filename. This is the name of the deployment container file that was exported by the ProPathLoader application.
NOTE: If you specified an OWNER STRING when you created the export file, you should enter it here (be sure spelling and case are exactly the same).
If you did not specify an OWNER STRING when you created the export file, be sure to leave it blank here.
The Default First Deploy Rules
ProPath allows you to specify when the files in your export groups are deployed. Your options are:
"Always Deploy Files on Startup"
As the name implies, ProPath will deploy files set with this deployment rule every time the program starts.
"On Startup If Files Don't Exist"
With this setting ProPath checks to see if the files exist in the target folders, then deploys them if they do not.
"On Only At Startup"
For this selection ProPath will deploy the files and then store an entry in the Registry or an INI control file. Then the next time the program starts it will check the entry to see if the files have been deployed and ignore the deployment directive if the deployment flag is set.
"On Demand Only"
In this mode, ProPath does NOT deploy the files on startup. Instead you use the #CODE templates provided to deploy them "on demand".
First Deploy Settings
The First Deploy Settings control how ProPath will determine if the First Deploy action has taken place.
The proof of deployment can be stored in the Windows Registry, or in an INI file.
Settings for both are covered below.
Proof Stored in the Registry
Root
The Root setting controls the base Registry key. Your program should always use CURRENT_USER to conform with Microsoft guidelines.
Base Key
The Base Key setting controls the second level of the Registry key. Your program should always use SOFTWARE to conform with Microsoft guidelines.
Company
The Company node is the third level of the Registry key. Your company name would go here to conform with Microsoft guidelines.
Product
The Product node is the fourth level of the Registry key. Your product name would go here to conform with Microsoft guidelines.
SubKey
The SubKey node is the fifth level of the Registry key. The word "Settings" is used here.
Note that you could store other settings for this same product under the same key in a different NAME/VALUE pair - thus making proper use of the Registry in accordance to industry standards.
Value
The Value is the NAME portion of the NAME/VALUE pair of the Registry key. The default label ( NAME ) is "First Deploy Completed"
After the template code deploys the files, it will update the Registry and set this to TRUE.
Then the next time the program runs it will check this NAME/VALUE pair to determine if file deployment is needed.
Proof Stored in an INI file
When storing the proof in an INI file, ProPath can either store it in the default application.INI file (if it is controlled by ProPath as it should be), or an another named INI file.
Note that the INI file is expected to be in the FOLDER:SYSTEMData path.
The INI Control is where you specify the NAME of the file ( no quotes and no path - just the name and extension ).
The Section and Entry portions are typical Clarion INI syntax used to produce the following ( by default )
First Deploy Reset
ProPath has another nice feature called First Deploy Reset.
This feature makes it possible for you to simulate the First Deploy condition at any time with a command line option to your application.
Enabling First Run Reset
To enable this feature simply check the box as shown above. The default command line parameter is /FIRSTDEPLOY, but you can change that if needed.
When your program is started with this parameter on the command line, then the class checks for the First Deploy condition will be bypassed and the file deployment will be executed.
This can be a very useful feature during development or situations such as when a user may have deleted files and you do not have First Deploy monitoring for such conditions.
Testing First Run with SETCOMMAND
In order to be able to test your First Run code, ProPath has a developer option that you can check that uses the Clarion SETCOMMAND option to simulate a parameter on the command line.
All you need to do is check the box, recompile and run your program.
When the program starts with this option enabled you will see this message:
This message is put in place by the template to help prevent your accidentally shipping your program with the SETCOMMAND test enabled.
Managing the First Deploy Files ( by Export Group )
After you have the other settings on this template tab configured, click this button to add your deployment groups to the template. Remember that the default values you set on this tab will be populated on the export group form automatically for you.
Because you can specify a group to be treated as a normal export group, or as an entire data set, the next section of the help has been split into two parts to keep it simple for you.