IR
irwinrodriguez.dev
Back to docs

Licensing

The FoxCore license is a JWT and it is activated in code: you pass it to Activate() when your application starts. There is no file to copy anywhere.

Activating the license

This is the whole of it, and it is the same inside the IDE and in the .exe you distribute:

Activate the license when the application starts
LOCAL loRt, lcJwt

* Tu licencia de FoxCore, tal cual sale del portal. Una sola linea.
lcJwt = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9." + ;
        "eyJzdWIiOiJGb3hDb3JlIiwia2luZCI6IkRldmVsb3BlciIsLi4ufQ." + ;
        "TU-FIRMA-AQUI"

loRt = CREATEOBJECT("FoxCore.Runtime")

IF !loRt.Activate(lcJwt)
    MESSAGEBOX("La licencia de FoxCore no es valida.", 16, "FoxCore")
    RETURN
ENDIF

loRt.Attach(_VFP)
? loRt.IsLicensed                 && .T.
Activate() takes the contents of the JWT, never a path. The usual thing is to keep it as a constant in your code, because it travels inside the executable you hand your customer.

Where the JWT comes from

  1. Sign in to your customer portal and open the Licenses section.
  2. Find your FoxCore license. If you already had the classic engine, it is the same one: there is nothing new to buy.
  3. Copy the whole string. It is long, it has three blocks separated by dots, and it carries no line breaks.
  4. Paste it into your code as a constant and pass it to Activate() at startup.
  5. Check that it took: Activate() returns .T., and so does IsLicensed.

What changed in 3.4.0

Up to 3.3.0 the license was only validated with the host inside the Visual FoxPro IDE (_VFP.StartMode = 0), and the product was royalty-free at run time. Since 3.4.0 it is required in the .exe or .dll you distribute as well.

If you are coming from 3.3.0, this is the only thing you have to do: add the call to Activate() to your application's startup. Nothing else about the COM surface or the engine changes.

The model

RuleWhat it means
€299, one-time paymentA single price. There are no 1, 4 or 8 seat tiers any more: they were withdrawn on 12-09-2026. Licenses issued earlier keep working exactly as they did.
One license per companySeats are not counted, nor installations. The same JWT is valid on every machine your application runs on, and on every machine in your team.
Offline validationThere is no network call. Signature, product and expiry are checked, and the public key is embedded in Nexum.dll.
PerpetualThe version you buy works forever. Maintenance gives access to new versions; when it lapses, the one you have keeps working.
Shared with the classic engineThe product is FoxCore, the same as WinFx.FoxCore. One license covers both lines.

What happens without a license

It depends on which of the two you are missing, and they are not the same. If you call Activate() with an invalid or expired JWT, it returns .F., the lifecycle keeps working (Attach, Ping, Shutdown) and tasks are born Failed saying why: there is no silent degraded mode and nothing breaks halfway through, the task is rejected as it is queued. If you never call Activate() at all, you never reach the tasks: Attach() throws RUNTIME_BAD_STATE right there. It fails at that point on purpose: skipping a lifecycle step is your mistake, not a verdict on your license, and it is said on the line that caused it rather than half an hour later.

A task launched without a valid license
lcId = loRt.RunScript("RETURN 1", "una tarea")

? loRt.GetState(lcId)             && Failed
? loRt.GetError(lcId)

The error code is RUNTIME_LICENSE_INVALID, and GetError() returns:

The error of the rejected task
FoxCore.Runtime: no hay una licencia valida para el producto 'FoxCore', asi que la tarea no se ejecuta. Activala por codigo al arrancar: loRt.Activate(<tu JWT>). Se consigue en https://irwinrodriguez.dev/products/foxcore

Checking it from the IDE

Four lines in VFP's command window:

Check the license from the command window
loRt = CREATEOBJECT("FoxCore.Runtime")
? loRt.Ping()                     && FoxCore.Runtime 3.4.2
? loRt.Activate(lcJwt)            && .T.
? loRt.IsLicensed                 && .T.

What no longer exists

If you are coming from the 3.3.0 documentation or earlier, this is no longer true:

  • There is no foxcore.lic file to copy into bin\ or anywhere else.
  • Setup no longer has a license page, and unattended installs no longer accept /LIC=.
  • verify.cmd no longer looks for a license: it checks the registration, which is an installation's job.
  • The product is no longer royalty-free at run time.
The demo and the samples in the package do read a foxcore.lic from disk. That is a convenience of theirs: they are loose .prg files you run by hand from the IDE and they have to get the JWT from somewhere. In your application it lives in the code.

If something does not add up

SymptomCauseFix
Activate() returns .F.The JWT is incomplete; most often it was copied with a line break in the middle, or the last block is missingCopy it whole from the portal again. Three blocks separated by dots, no spaces
Activate() returns .F. with a complete JWTIt is another product's license, or it is a trial license that has already expiredCheck in the portal that it is the FoxCore one and that it is current
Tasks are born Failed talking about a licenseThe engine started with an Activate() that returned .F.Check what Activate() returns instead of calling it and moving on
Attach() throws RUNTIME_BAD_STATEActivate() was never called, or was called after Attach()Activate() comes first, always. With the JWT as a string: there is no file to read
It worked on 3.3.0 and stopped after upgradingThat is the 3.4.0 change: the license is required outside the IDE tooAdd Activate() to your application's startup
Buy for €299 →

Next: Quick Start ->