Tutorial: Install LINK2i

Introduction

Overview

This tutorial explains how to install LINK2i from scratch. Follow all the steps to complete the installation of LINK2i in your environment.

Prerequisites

To complete this tutorial, you need:

  • Microsoft Visual Studio (minimum verion: 2017)
  • An IBM i that you can access through TCP/IP
  • A fully installed version of IBM ACS or IBM Client Access
  • The IP address of the targeted IBM i partition
  • Valid SECOFR level credentials to the targeted IBM i partition
  • A valid LINK2i license key, learn more how you can obtain one here
Warning:

If you only have one SECOFR account on the targeted IBM i partition, we recommend you to create a new SECOFR user account dedicated to LINK2i administration.

Step 1: Setup LINK2i

Create a new .NET project

Create a new .NET Framework C# or VB.NET console application in Visual Studio:

new .NET console project A new c# .NET Framework console app named InstallLink2i

Reference LINK2i

In this new console application, reference LINK2i using the NuGet package manager:

  1. Open the NuGet package Manager: Project > Manage NuGet packages...
  2. In the package manager, click on the Browse tab
  3. Search for LINK2i and select "LINK2i by AUMERIAL SAS FRANCE"
  4. Install the latest version of the package
Information:

For more details about NuGet packages, visit Microsoft documentation on NuGet packages installation in Visual Studio.

Register LINK2i license key on the IBM i

The license key can be automatically registered on the IBM i using LINK2i RegisterLicenseKey() function. To perform the registration, add the following code in the main method Program.cs (or Program.vb):


//Code to insert in Main method from Program.cs
Link2i link2i = new Link2i();
string result;
string createOrRenew = Link2i.TypeRegister.CRT; 

//Replace the values in the parameters below
string lparIP = "192.168.2.19"; //IBM i LPAR IP address
string usrName = "QSECOFR"; //SECOFR account username
string usrPassword = "PW1234"; //SECOFR account password
string licenseKey = "...mpoOuLXn3D6WnjAjk=…"; //LINK2i license key


result = link2i.RegisterLicenseKey(lparIP, usrName, usrPassword, licenseKey, createOrRenew);
Console.Writeline(result);
Console.ReadLine();

'Code to insert in Main method from Program.vb
Dim link2i As New Link2i
Dim result As String
Dim createOrRenew As String = Link2i.TypeRegister.CRT

'Replace the values in the parameters below
Dim lparIP As String = "192.168.2.19" 'IBM i LPAR IP address
Dim usrName As String = "QSECOFR" 'SECOFR account username
Dim usrPassword As String = "PW1234" 'SECOFR account password
Dim licenseKey As String = "...mpoOuLXn3D6WnjAjk=…" 'LINK2i license key


result = link2i.RegisterLicenseKey(lparIP, usrName, usrPassword, licenseKey, createOrRenew)
Console.Writeline(result)
Console.ReadLine()

Program.cs (or Program.vb) should look like the code below:


//Program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InstallLink2i
{
    class Program
    {
        static void Main(string[] args)
        {
            Link2i link2i = new Link2i();
            string result;
            string createOrRenew = Link2i.TypeRegister.CRT;
            string lparIP = "192.168.2.19"; //IBM i LPAR IP address
            string usrName = "QSECOFR"; //SECOFR account username
            string usrPassword = "PW1234"; //SECOFR account password
            string licenseKey = "...mpoOuLXn3D6WnjAjk=…"; //LINK2i license key
            result = link2i.RegisterLicenseKey(lparIP, usrName, usrPassword, licenseKey, createOrRenew);
            Console.Writeline(result);
            Console.ReadLine();
        }
    }
}

'Program.vb

Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks

Namespace InstallLink2i
    class Program
        Private Shared Sub Main(ByVal args As String())
            Dim link2i As New Link2i
            Dim result As String
            Dim createOrRenew As String = Link2i.TypeRegister.CRT
            Dim lparIP As String = "192.168.2.19" 'IBM i LPAR IP address
            Dim usrName As String = "QSECOFR" 'SECOFR account username
            Dim usrPassword As String = "PW1234" 'SECOFR account password
            Dim licenseKey As String = "...mpoOuLXn3D6WnjAjk=…" 'LINK2i license key
            result = link2i.RegisterLicenseKey(lparIP, usrName, usrPassword, licenseKey, createOrRenew)
            Console.Writeline(result)
            Console.ReadLine()
        End Sub
    End Class
End Namespace

Run the code. LINK2i is now fully installed, you only have to perform this process once to fully use LINK2i from different clients. When using LINK2i in a new .NET project, only a reference to the NuGet package is required.

Step 2: Check the installation

You can now check the installation by following one of these tutorials: