===========================================================================
 Keyright - self-hosted licensing service (Windows)
===========================================================================

This folder contains everything needed to run Keyright on your own Windows
server or PC. You only touch two things in this top folder:

    install.cmd   <- run this to install and start Keyright
    readme.txt    <- this file

Everything else lives in subfolders:

    app\          the Keyright service (and the built-in database, if included)
    scripts\      the PowerShell scripts install.cmd uses


---------------------------------------------------------------------------
 STEP 1 - Install and start Keyright
---------------------------------------------------------------------------

Double-click  install.cmd  (or, in a command prompt, run:  install.cmd )

It will ask how you want to host Keyright:

    [1] Kestrel  - runs as a Windows service. No IIS required.
                   Recommended, and the default. Just press Enter.
    [2] IIS      - hosts Keyright under an IIS website
                   (needs the .NET 8 Hosting Bundle installed first).

Installing a service needs administrator rights. If you started it without
them, it will offer to relaunch as administrator - say Yes.

Works with Windows PowerShell 5.x or PowerShell 7 - whichever you have.


---------------------------------------------------------------------------
 STEP 2 - Finish setup in your browser
---------------------------------------------------------------------------

When Keyright starts, your browser opens the first-run SETUP WIZARD at:

    http://localhost:8080/

You begin on a free 3-day PRE-TRIAL - no key and no sign-up needed. (When you
want to keep going, request a trial key from the link shown in the wizard.)

In the wizard you just choose your database:

    - Quick Start: use the built-in PostgreSQL (only in the "with built-in
      database" download) - one click, nothing else to install, or
    - connect your own PostgreSQL connection string.

Keyright tests the connection, saves it, sets up the database, and opens its
dashboard. That's it - Keyright is running.

Later, from the dashboard, you can enter a trial or license key, and switch
from the built-in database to your own PostgreSQL (convert to production) at
any time - no reinstall.


---------------------------------------------------------------------------
 Just want to try it first (no install)?
---------------------------------------------------------------------------

Open PowerShell in the  scripts\  folder and run:

    .\run-eval.ps1

This runs Keyright in a console window (Ctrl+C to stop) and opens the same
setup wizard - nothing is installed as a service.


---------------------------------------------------------------------------
 Managing the service later
---------------------------------------------------------------------------

    sc.exe stop Keyright       stop it
    sc.exe start Keyright      start it

Your configuration and data stay in:  C:\ProgramData\Keyright


---------------------------------------------------------------------------
 Uninstall
---------------------------------------------------------------------------

Double-click  uninstall.cmd  (in this folder, or in C:\ProgramData\Keyright).

It removes the Keyright service (or IIS site) and keeps your data. To remove
your data too (config, built-in database, license), run:

    uninstall.cmd -Purge

Your data is NOT deleted unless you pass -Purge.


---------------------------------------------------------------------------
 Customizing the install (optional)
---------------------------------------------------------------------------

install.cmd accepts options, for example:

    install.cmd -Port 8090                 use a different port
    install.cmd -HostMode iis              host under IIS (skip the menu)
    install.cmd -ServiceName KeyrightProd  use a different service name

See all options with:   install.cmd /?    (and   uninstall.cmd /?  )


---------------------------------------------------------------------------
 Need help?
---------------------------------------------------------------------------

Run  install.cmd /?  or  uninstall.cmd /?  for options.
Full documentation:  https://delta1labs.com/docs/keyright
