Creating a PI Client Installer with predefined AF and PI Servers

Blog Post created by ksward on Jan 30, 2018

The installation and use of PI System Explorer (PSE) is primarily targeted toward the administration of PI/AF; however, for some of us PSE is also a user application which gives owners/operators the ability to make entries into static attributes and/or Manual Entry Data tags, these can be used for many different purposes, but not discussed in this write up.


The installation of PSE is fairly simple but requires the installer to know two basic things for a fully operational application, those are the AF Server and the PI Server names.  OSIsoft offers a silent installer function for those who can coordinate with your desktop management team to push PSE out to those needing. But that may not fit with your organization and you may start getting tired of writing specialized installation instructions only to end up working alongside the user installing PSE to get a successful install.  This is time consuming and takes you away from other PI/AF management tasks.


The solution is to leverage several components to create an installation package that will self-extract and install with the AF and PI Servers predefined.  For convenience purposes this package can be placed in a shared drive and the pulled down by the user and installed with the user only having to answer one question: "Do you want to install PI System Explorer Y/N?", I'll dub this the "Pull Method".


Now the user can be emailed with the shared drive location and a couple simple instruction on how to install: Drag the installer to your desktop and right click then select run as administrator.  A few minutes later its done.


The following is the procedure for creating this Self-Extracting/Execution Installer:

Assumption, this is based on 7Zip compression software and a reference document located at https://stackoverflow.com/questions/27904532/how-do-i-make-a-self-extract-and-running-installer


First, you need to assemble components.
OSIsoft PI System Explorer
1. Download the installation package to your computer.
2. Uncompress the installation package.
3. Navigate into the package folders until you see all the files.
4. Edit the file called "silent.ini"
5. Go to the section where is says:
      10 = /qn REBOOT=Suppress ALLUSERS=1 ADDLOCAL=FD_AFSDK,FD_AFExplorer,FD_AFBuilder,FD_AFDocs
      11 = /qn REBOOT=Suppress  ALLUSERS=1 ADDLOCAL=FD_AFSDK,FD_AFExplorer,FD_AFBuilder,FD_AFDocs
6. Add the AF_SERVER=your AF servername and PI_SERVER=your PI servername
7. Save and exit the edit of the file “silent.ini”
8. Select all the files in this folder and recompress them into a .7z archive file.
9. Move this .7z archive file to a new folder for the installer package assembly.


7Zip Software
1. Download the 7Zip self extracting software.
2. For this version of 7Zip (16.04) the LZMA SDK is needed.
3. Uncompress the LZMA SDK and navigate into the folder and locate the file called: 7zSD.sfx
4. Move “7zSD.sfx” file to the new folder for the installer package assembly.


Create the installer package
Navigate to the folder you created for the installer package assembly


Create a configuration text file.
1. Create a configuration text file .txt, use a name that is simple but unique.
2. In this text file put the following:
      Title="PI Client Version XX"
      BeginPrompt="Do you want to install PI Client Version XX"
      RunProgram="setup.exe -f silent.ini"
3. Where the PI Client Version XX is you may change to provide information for reuse and tracking. 
4. The question in the quotes on the "BeginPrompt" line is also for you to reword as needed.
5. The line "RunProgram" runs the setup program using the silent installation feature. No change needed as of this version of PI Client.
6. Save and exit this text file.


Assemble the Installer Package
In the folder for the installer package assembly you should have three files:
- The .7z compressed file of the AF Client software, for example purposes this file is called “AF-Client-XX.7z”
- The 7Zip file called “7zSD.sfx”
- The configuration text file, for example purposes this file is called “config.txt”


To assemble the installer package:
1. Open a command prompt window, CMD
2. Change directory to the installer package assembly folder.
3. Execute the command:
      Copy /b AF-Client-XX.7z + 7zSD.sfx + config.txt INSTALLER-PACKAGE.exe
4. This will create an executable file called INSTALLER-PACKAGE.exe


- The INSTALLER-PACKAGE is a name of your choice.
- Notice the “+” symbols and spaces between.


You are done.  The INSTALLER-PACKAGE.exe is now ready to use.