How to: Start any program with the starter
Deliver a program that is no Access application - or a document that opens with its file type - so that users start it with one click, always in the current version, installed for them without administrator rights.
Requires WKL Bootstrapper 2.0 (project file format 2). Microsoft Access is not needed.
Solution overview
filescopies the program from the source into a folder per version,[VersionDir].versiontakes the delivered version from a fixed value (value) or from the product version of a file of the delivery (from).startnames what the starter starts:file,arguments,folder(the working folder) andenvironment(variables the started program gets).bitnessdecides which entries markedx86orx64are installed. Its defaultaccessfollows the bitness of Microsoft Access, and Windows when no Access is installed; for a program of its own setos,x86orx64.
Implementation
- Put the delivery on the share, for example
\\server\share\lagerwith the program inbin. Write the project file
bootstrapper.jsonnext toWkl.Bootstrapper.exe:{ "format": 2, "product": "Inventory", "display": { "name": "Inventory Management", "publisher": "Contoso" }, "version": { "from": "bin\\Inventory.exe" }, "source": "\\\\server\\share\\lager", "bitness": "os", "files": [ { "id": "bin", "source": "bin", "target": "[VersionDir]" } ], "shortcuts": [ { "folder": "[Programs]\\Contoso", "name": "Inventory", "target": "[Starter]", "arguments": "[RunConfig]" } ], "start": { "file": "[VersionDir]\\Inventory.exe", "arguments": "/user \"[Product]\" /data \"[AppDir]\\Data\"", "folder": "[VersionDir]", "environment": [ { "name": "INVENTORY_HOME", "value": "[Dir:bin]" } ] } }The shortcut starts the starter, not the program, so every start checks for a new version first.
Check the file and try a start without changing anything:
Wkl.Bootstrapper.exe /check bootstrapper.json Wkl.Bootstrapper.exe /whatif bootstrapper.json
/checkends with 0 when the file breaks no rule; it does not read the delivery./whatifends with 0 when a start would succeed (delivery included) and lists the plan.- Start it.
Wkl.Bootstrapper.exeinstalls the version (or uses the installed one) and startsInventory.exein[VersionDir]with the arguments and the variable.
To open a document instead of a program, name it in start.file (for example [VersionDir]\Handbuch.pdf); the program
registered for its file type opens it.
Remarks
- A file whose extension is
.exe,.com,.bator.cmdis started directly by its path; any other file is opened through its file type. A file type may hand the file to a program that is already running; that still counts as started. - A program that ends at once is no failure (a launcher, a script, a program handing over to a running instance). A program that cannot be started at all ends the starter with code 60.
start.folderdefaults to the folder ofstart.file.start.environmentsets each variable for the started program only; a name may appear once per bitness, withbitnessx86orx64on an entry to set it for that bitness only. The installed version keeps the variables, so a start without the source sets them too.start.fileusually lies below[VersionDir]. It may also name a program that is installed otherwise, by its full path; the starter then installs only the other entries of the project.start.runtimeandstart.commandapply only whenstart.fileis an Access database (.accdb,.accde,.accdr,.accda,.mdb,.mde,.adp,.ade); for any other file they are ignored, andstart.argumentsis used instead.- An empty
start.fileinstalls and starts nothing; the starter then ends with 0 when the installation is complete. - The trusted location of Access is written only when
start.fileis an Access database.
Related topics
- The project file (format 2) - every entry and placeholder
- How to: Deliver a private .NET runtime - when the program needs .NET