Saltar para o conteúdo principal
Versão: Próximo

Create deployment license

História
ReleaseMudanças
20 R10New autoLicenseTarget parameter
20Adicionado

Create deployment license ( mergedApp ; autoLicenseTarget ) : Object
Create deployment license ( mergedApp ; buildLicense {; oemLicense} ) : Object

ParâmetroTipoDescrição
mergedApp4D. FolderFolder containing the merged application
autoLicenseTargetIntegerTarget license for automatic license embedding
buildLicense4D. FileLicense required to generate the embedded license
oemLicense4D. File4D OEM XML Key license if server license
ResultadoObjectEstado

Descrição

The Create deployment license command creates an embedded license file in the Licenses folder of the mergedApp built application. If the Licenses folder does not exist in the mergedApp folder, it is created by the command.

In mergedApp, pass a 4D.Folder object containing a reference to the folder containing the built application in which you want to embed a license.

Depending on the second parameter, you let 4D select automatically the license to use for the target or designate the license(s) to use.

Automatic license selection

If you pass the autoLicenseTarget parameter, you let 4D find and use the most appropriate license for the specified target. For more information on the automatic license selection, please refer to the Build application section.

The following constants are supported in the autoLicenseTarget parameter:

ParâmetrosValorDescrição
4D Volume Desktop1Create automatically a license for a 4D single-user application
4D Server5Create automatically a license for a 4D Server application

If no valid license is found, an error is generated.

Designating the license(s) to use

In license, pass a 4D.File object containing a reference to the license file used to generate the embedded license.

In the non-automatic mode, if the build requires a specific OEM license (4D OEM XML Keys) and if no such license is already installed in the Licenses folder of the building machine, you need to pass it using the oemLicense parameter. This parameter is useful if you dedicate a machine to build your applications.

Resultados

The command returns a status object containing the following properties:

PropriedadeTipoDescription
successParâmetrosTrue if the license file has been generated
file4D.FileThe generated license file
statusTextTextDescription of the error if any
errorsCollectionCollection of error objects
[].messageTextMensagem de erro
[].errCodeNumberNúmero de erro
standaloneObject(only in automatic mode Description attributes for 4D Volume Desktop license
oemServerObject(only in automatic mode Description attributes for 4D Server OEM license
oemXMLKeyObject(only in automatic mode Description attributes for 4D Server XML Key license

Description attributes are:

PropriedadeTipoDescription
absolutePlatformPathTextPath to the original license file retained
offerNameTextCommercial name of the license retained
productNumberNumberSerial number of the license retained
Notas
  • The generated license must be used only with the application referenced by mergedApp.
  • It is necessary to regenerate the license each time the application is rebuilt.

Exemplo 1

Use the automatic syntax to create a single-user 4D application:

 var $status : Object
 var $application : 4D.File
 $application:=Folder(fk desktop folder).folder("myApp.app")
 $status:=Create deployment license($application;4D Volume Desktop)

Exemplo 2

Designate a license to use:

 var $status : Object
 var $application : 4D.File
 var $license : 4D.File
 $license:=Folder(fk licenses folder).file("4UUD200-xxx.license4D")
 $application:=Folder(fk desktop folder).folder("myApp.app")
 $status:=Create deployment license($application;$license)

Veja também

Blog post - Finalize an application with 4D commands

Propriedades

Número de comando1811
Thread safe