How to: Deliver a private .NET runtime
Users' PCs have no .NET 10 Desktop Runtime, and the IT does not install it; the application - for example an Access application with WKL Forms Object Library - should still run.
Requires WKL Bootstrapper 2.0 (project file format 2).
Solution overview
- The delivery brings a .NET runtime per bitness in
dotnet\x86anddotnet\x64of the source. - A
filesentry per bitness copies it to[WklRoot]\Dotnet\<release>\<bitness>, that is%LOCALAPPDATA%\WKL\Dotnet\<release>\<bitness>.<release>is the product version of itsdotnet.exewithout a build id. start.environmenthands the folder to the started program:DOTNET_ROOT(x86)for 32 bit,DOTNET_ROOTfor 64 bit. The .NET host of the program, and of the WKL components loaded into Access, then finds the runtime there.- The template
dotnetof/new-projectwrites both entries; see How to: Create a project from templates.
Implementation
Fill the delivery. Copy a .NET 10 runtime of each bitness into the source: the content of an installed .NET folder (
%ProgramFiles(x86)%\dotnetfor 32 bit,%ProgramFiles%\dotnetfor 64 bit) -dotnet.exeand the foldershostandshared- intodotnet\x86anddotnet\x64:<delivery> app-manifest.json, Customers.accde components\x86, components\x64 dotnet\x86\dotnet.exe, host\..., shared\... dotnet\x64\dotnet.exe, host\..., shared\...
Write the project file, or let
/new-project ... /template access,components,dotnetwrite it. The entries for the runtime are:{ "files": [ { "id": "dotnet-x86", "source": "dotnet\\x86", "target": "[WklRoot]\\Dotnet\\[ItemVersion]\\x86", "bitness": "x86", "versionOf": "dotnet.exe" }, { "id": "dotnet-x64", "source": "dotnet\\x64", "target": "[WklRoot]\\Dotnet\\[ItemVersion]\\x64", "bitness": "x64", "versionOf": "dotnet.exe" } ], "start": { "environment": [ { "name": "DOTNET_ROOT(x86)", "value": "[Dir:dotnet-x86]", "bitness": "x86" }, { "name": "DOTNET_ROOT", "value": "[Dir:dotnet-x64]", "bitness": "x64" } ] } }With a private runtime the project needs no condition of kind
dotnet; remove one that asks for an installedMicrosoft.WindowsDesktop.App 10.0.- Check and try it:
Wkl.Bootstrapper.exe /check bootstrapper.json, then/whatif bootstrapper.json.
Remarks
- Only the runtime of the project's bitness is installed (
bitnessof the project; by default that of Microsoft Access, and of Windows when no Access is installed). - The runtime folder is shared and counted: every product delivering the same release uses one copy, which stays until the last product version using it is removed. A newer release goes into a folder of its own beside it.
- Limitation: the variables reach only programs the starter starts. Access opened in any other way - from the database file, from the start menu, by automation - and Office UserForms that use the WKL components do not find the private runtime; they need a runtime installed for the computer.
- The installed version keeps the variables, so a start without the source sets them too.
- A private runtime is supported for 32-bit and 64-bit Access on 64-bit Windows; 32-bit Windows is not supported.