How to: Create a project from templates
Begin a new project file with the entries an Access application, the WKL components, an ODBC driver, WKL Office JSON or a private .NET runtime need, instead of writing them by hand.
Requires WKL Bootstrapper 2.0.
Solution overview
/new-project <file> /template <names> writes a project file of format 2 from one or more templates and prints what is left
to do. The templates fill in ordinary entries - files, registry values, conditions, the start - which can be changed
afterwards like any other entry.
| Template | Adds |
|---|---|
access | The application file named by app-manifest.json of the build tool of WKL Forms Object Library, copied to [VersionDir]; the version from that manifest; the start of the database, with /runtime as the manifest says (start.runtime auto); the condition Microsoft Access. |
components | WKL Forms Object Library from components\x86 and components\x64 of the delivery, copied per release to [WklRoot]\Components\<release>\<bitness> and registered for the user (registerCom); the condition .NET 10 Desktop Runtime (Microsoft.WindowsDesktop.App 10.0), unless dotnet is chosen too. |
odbc | An example ODBC driver (Wkl OData from odbc\Wkl OData, DLL Wkl.Data.OData.Odbc.dll), copied per release to [WklRoot]\Drivers\<driver>\<release>\<bitness>, and a data source of the user (WklGateway) whose Driver is the path of the copied DLL, in the registry view of each bitness. Replace it with the delivered driver. |
json | WKL Office JSON from json\x86 and json\x64 of the delivery, copied per release to [WklRoot]\Json\<release>\<bitness> and registered for the user. The template names Wkl.Office.JSON.dll; the starter also finds Wkl.Access.JSON.dll of releases up to 1.0.3 (then WKL Access JSON). |
dotnet | A private .NET runtime from dotnet\x86 and dotnet\x64, copied per release to [WklRoot]\Dotnet\<release>\<bitness>, and the variables DOTNET_ROOT(x86) and DOTNET_ROOT for the started program; see How to: Deliver a private .NET runtime. |
<release> is the product version of the entry's main file without a build id. Every entry with a bitness is installed only
for the bitness of the project.
Implementation
- Create the folder the starter will run from, named after the product - the product key is taken from the name of the file's folder (letters, digits,
.,-,_;Productwhen nothing is left). Write the project:
Wkl.Bootstrapper.exe /new-project Customers\bootstrapper.json /template access,components,odbc
The output names the file and the steps left, one line each:
```text …\Customers\bootstrapper.json written.
- source: 'deploy' beside the starter; set the delivery folder (a share such as \server\apps\Customers) when it lies elsewhere.
- access: the delivery folder needs the application and its app-manifest.json (build tool of WKL Forms Object Library, target deploy).
- components: copy the folders x86 and x64 of the release package into 'components' of the delivery folder.
odbc: replace the example driver 'Wkl OData' (folder, DLL, data source 'WklGateway') with the delivered one. ```
A line starting with
!names a rule the written file still breaks, for example a missing version whenaccessis not chosen.
- Work through the lines: set
source, place the named folders in the delivery, replace the example driver. - Check the result with
Wkl.Bootstrapper.exe /check Customers\bootstrapper.json.
Remarks
sourceisdeploy, a folder beside the starter, until it is set.- Without
access, the project starts nothing yet: setversion(valueorfrom) andstart.file; see How to: Start any program with the starter. - No template means a project with the product key and the source only.
- Template names are separated by commas and may be given in any order and case.
- An existing file is never overwritten.
/jsonprints an object withwritten,notesandproblemsinstead of the lines, every character outside ASCII escaped.- Exit codes: 0 written; 10 no file named; 11 an unknown template, or the file exists.
componentsandjsonneed aregistration.jsonbeside each COM server of the delivery; the release package of WKL Forms Object Library brings it from 1.57.- Choose
componentsonly when the delivery brings the components: its entries copy them from the delivery, so a delivery withoutcomponents\x86andcomponents\x64ends with code 12 even when a sufficient release is registered on the computer. When the computer has them already (installed by the IT, or for every application from one place), chooseaccessalone; a sufficient registration found at the start is used either way.