Sie sind auf Seite 1von 11

Installer API

User's guide

Copyright 2008-2011 Neurotechnology. All rights reserved

Installer API

Table of Contents
1 Preface

2 Introduction

3 API Reference

3.1 C/C++ Reference

3.1.1 Functions

3.1.1.1 NActivateOnline Function

3.1.1.2 NGenID Function

3.1.1.3 NRegisterDLL Function

3.1.1.4 NRegisterService Function

3.1.1.5 NSaveLicenseFile Function

3.1.1.6 NServiceExists Function

3.1.1.7 NTestRuntime Function

3.1.1.8 NTestTrialServer Function

3.1.1.9 NUnregisterDLL Function

3.1.1.10 NUnregisterService Function

3.1.2 Macros

3.1.2.1 N_FAILED Macro

3.1.2.2 N_FILE_NOT_FOUND Macro

3.1.2.3 N_OK Macro

3.2 .NET Reference


3.2.1 Neurotec.Installer Namespace
3.2.1.1 Classes
3.2.1.1.1 Installer_API Class
3.2.1.1.1.1 Installer_API Methods

8
8
8
8
8

Installer_API.ActivateOnline Method

Installer_API.RegisterService Method

ii

Installer API

1 Preface
Brief information about this user's guide:
Publish date: 4/11/2011

Version: 1.1.0.0

Installer API

2 Introduction
Installer API is intended to be used by developers using Neurotechnology SDKs. It simplifies installer development process.
API is available as plain C DLL and contains wrapper for .NET.

3.1 C/C++ Reference

Installer API

Functions

3 API Reference
This chapter contains API reference for Installer API.

3.1 C/C++ Reference


These libraries are required by Installer API:
NInstaller.dll

Functions
Name

Description

NActivateOnline (
NGenID (

page 4)

page 4)

NRegisterDLL (

Retrieves license file for a particular machine via internet.


Generates ID for activation from serial number for a particular machine.

page 4)

Registers COM library (DLL).

NRegisterService (

page 5)

Registers licensing service (pg.exe).

NSaveLicenseFile (

page 5)

Saves license to a file and configures protection service to use that


license file.

NServiceExists (
NTestRuntime (

page 6)
page 6)

NTestTrialServer (
NUnregisterDLL (

page 6)
page 6)

NUnregisterService (

page 7)

Checks if the particular service is installed on a system.


Checks if proper version of Microsoft Visual C++ runtime is installed on a
computer.
Tests connection with trial server. This function is by a trial version of
SDK.s
Unregisters COM library.
Removes specified service from system.

Macros
Name

Description

N_FAILED (

page 7)

Defines an error code for N_FAILED. This error code is returned when
function fails.

N_FILE_NOT_FOUND (
N_OK (

page 7)

page 7)

Defines an error code for N_FILE_NOT_FOUND. This error code is


returned when file was not found.
Defines an error code for N_OK. This error code is returned when
function finished its work with no errors.

3.1.1 Functions
3
The following table lists functions in this documentation.
Functions
Name

Description

NActivateOnline (
NGenID (

page 4)

page 4)

NRegisterDLL (

Generates ID for activation from serial number for a particular machine.

page 4)

NRegisterService (

Retrieves license file for a particular machine via internet.

page 5)

Registers COM library (DLL).


Registers licensing service (pg.exe).
3

3.1 C/C++ Reference

Installer API

NSaveLicenseFile (
NServiceExists (
NTestRuntime (

page 6)
page 6)

NTestTrialServer (
NUnregisterDLL (

page 5)

page 6)
page 6)

NUnregisterService (

page 7)

Functions

Saves license to a file and configures protection service to use that


license file.
Checks if the particular service is installed on a system.
Checks if proper version of Microsoft Visual C++ runtime is installed on a
computer.
Tests connection with trial server. This function is by a trial version of
SDK.s
Unregisters COM library.
Removes specified service from system.

3.1.1.1 NActivateOnline Function


Retrieves license file for a particular machine via internet.
C++
INSTALLERDLL_API NActivateOnline(char * id, char * lic);
Parameters
Parameters

Description

char * id

[in] ID generated from serial number.

char * lic

[out] Char buffer that contains activated license data.

Returns
If function returns 1 then license was validated and lic parameter contains license data.
If function returns 0 then license failed to be activated. In this case lic parameter contains error description.

3.1.1.2 NGenID Function


Generates ID for activation from serial number for a particular machine.
C++
INSTALLERDLL_API NGenID(char * serial_no, char * id_gen_path, char * id);
Parameters
Parameters

Description

char * serial_no

[in] Serial number used for generating ID.

char * id_gen_path

[in] Path to ID generator program.

char * id

[out] Generated ID.

Returns
If the function succeeds, the return value is 1. If an error occurs, the return value is 0.
Example
char *serial = "3502-266E-60C6-6738-7D1C-3872-5AD8-3C42";
char id[10240];
NGenID(serial, "d:\\Activation\\id_gen.exe", (char*)id);

3.1.1.3 NRegisterDLL Function


Registers COM library (DLL).
C++
INSTALLERDLL_API NRegisterDLL(char * path);

3.1 C/C++ Reference

Installer API

Functions

Parameters
Parameters

Description

char * path

[in] Full path to COM (DLL) library to register.

Returns
If the function succeeds, the return value is N_OK (

page 7). If an error occurs, an error code is returned.

Example
NRegisterDLL("FPScannerManCom.dll");

3.1.1.4 NRegisterService Function


Registers licensing service (pg.exe).
C++
INSTALLERDLL_API NRegisterService(char * path, char * name);
Parameters
Parameters

Description

char * path

[in] Full path to file pg.exe file.

char * name

[in] Name for service to assign (e.g. Neurotechnology).

Returns
If the function succeeds, the return value is N_OK (

page 7). If an error occurs, an error code is returned.

Example
NRegisterService("SDK_PATH\\SDK_PLATFORM\\Activation\\pg.exe", "Neurotechnology");

3.1.1.5 NSaveLicenseFile Function


Saves license to a file and configures protection service to use that license file.
C++
INSTALLERDLL_API NSaveLicenseFile(char * lic_file_name, char * lic, char * conf_file_name,
char * conf_settings);
Parameters
Parameters

Description

char * lic_file_name

[in] Char buffer that contains full name of a file used for
saving license file.

char * lic

[in] Generated license. This license will be saved to file.

char * conf_file_name

[in] Char buffer that contains path to pgd.conf file. pgd.conf


files contains configuration settings for licensing service. For
more information about the pgd.conf settings read
Activation.pdf.

char * conf_settings

[in] Char buffer that contains configuration settings to be


written to license file.

Returns
If the function succeeds, the return value is 1. If an error occurs, the return value is 0.
Example
save_license_file("c:\\license.lic", lic, "c:\\pgd.conf", "LicenceFile = c:\\license.lic");

3.1 C/C++ Reference

Installer API

Functions

3.1.1.6 NServiceExists Function


Checks if the particular service is installed on a system.
C++
INSTALLERDLL_API NServiceExists(char * name);
Parameters
Parameters

Description

char * name

[in] Char buffer that contains name of the service.

Returns
If the service exists on a system, the return value is 1. If the service do not exists or an error occurs, the return value is 0.

3.1.1.7 NTestRuntime Function


Checks if proper version of Microsoft Visual C++ runtime is installed on a computer.
C++
INSTALLERDLL_API NTestRuntime(char * path);
Parameters
Parameters

Description

char * path

[in] Full path to runtime dependent DLL file.

Returns
If the function succeeds and proper version of runtime is installed, the return value is N_OK (
or version of runtime is not proper, an error code is returned.

page 7). If an error appears

3.1.1.8 NTestTrialServer Function


Tests connection with trial server. This function is by a trial version of SDK.s
C++
INSTALLERDLL_API NTestTrialServer();
Returns
If the function succeeds, the return value is N_OK (

page 7). If an error appears N_FAILED (

page 7) value is returned.

3.1.1.9 NUnregisterDLL Function


Unregisters COM library.
C++

INSTALLERDLL_API NUnregisterDLL(char * path);


Parameters
Parameters

Description

char * path

[in] Full path to COM DLL to unregister.

Returns
If the function succeeds, the return value is N_OK (

page 7). If an error appears N_FAILED (

page 7) value is returned.

3.2 .NET Reference

Installer API

3.1.1.10 NUnregisterService Function


Removes specified service from system.
C++
INSTALLERDLL_API NUnregisterService(char * name);
Parameters
Parameters

Description

char * name

[in] Char buffer that contains name of a service to unregister


(remove).

Returns
If the function succeeds, the return value is N_OK (

page 7). If an error appears N_FAILED (

page 7) value is returned.

3.1.2 Macros
The following table lists macros in this documentation.
Macros
Name

Description

N_FAILED (

page 7)

N_FILE_NOT_FOUND (
N_OK (

Defines an error code for N_FAILED. This error code is returned when
function fails.
page 7)

page 7)

Defines an error code for N_FILE_NOT_FOUND. This error code is


returned when file was not found.
Defines an error code for N_OK. This error code is returned when
function finished its work with no errors.

3.1.2.1 N_FAILED Macro


Defines an error code for N_FAILED. This error code is returned when function fails.
C++
#define N_FAILED -1

3.1.2.2 N_FILE_NOT_FOUND Macro


Defines an error code for N_FILE_NOT_FOUND. This error code is returned when file was not found.
C++
#define N_FILE_NOT_FOUND -2

3.1.2.3 N_OK Macro


Defines an error code for N_OK. This error code is returned when function finished its work with no errors.
C++
#define N_OK 0

3.2 .NET Reference

Installer API

Neurotec.Installer Namespace

3.2 .NET Reference


These libraries are required by Installer API:
Neurotec.Installer.dll

Namespaces
Name

Description

Neurotec.Installer (

page 8)

Generic namespace for all Neurotechnology .NET classes.

3.2.1 Neurotec.Installer Namespace


Generic namespace for all Neurotechnology .NET classes.
Classes
Name
Installer_API (

Description
page 8)

Provides functionality for making installer.

3.2.1.1 Classes
The following table lists classes in this documentation.
Classes
Name
Installer_API (

Description
page 8)

Provides functionality for making installer.

3.2.1.1.1 Installer_API Class


Provides functionality for making installer.
C#
public class Installer_API;
Installer_API Methods
Name
ActivateOnline (
RegisterService (

Description
page 8)
page 9)

if returns false - lic is an error description


Wrappers. All return true on success and false on failure

3.2.1.1.1.1 Installer_API Methods

3.2.1.1.1.1.1 Installer_API.ActivateOnline Method


if returns false - lic is an error description
C#
public static bool ActivateOnline(string id, out string lic);

3.2 .NET Reference

Installer API

Neurotec.Installer Namespace

Parameters
Parameters

Description

string id
out string lic

3.2.1.1.1.1.2 Installer_API.RegisterService Method


C#
public static bool RegisterService(string path, string name);
Description
Wrappers. All return true on success and false on failure

Das könnte Ihnen auch gefallen