Skip to main content

gSharp Installer

Pre-installation Checklist​

Ensure the following prerequisites are met before starting the installation:

  • Review SQL Server Requirements for gSharp SQL Server database creation.
  • Download the latest gSharp installation kit.
  • Confirm that the installation is being performed by a user with SQL Server sysadmin privileges, or ensure a SQL Server administrator is available.
  • Verify that the required network port is open. By default the gSharp Server listens on TCP port 6750. If the Windows Defender Firewall is running the gSharp installer has the option of creating this rule. If the gSharp Administration app is installed on a different machine, configure firewalls to allow traffic on this port.

Installation Process​

To begin, double-click the downloaded installer. The installation process uses a step-by-step wizard format.

Welcome​

The initial page displays the product name and version.

Welcome Page

License Agreement​

Review the license agreement and accept the terms to proceed with the installation.

License Agreement Page

Component Selection​

Choose the components to install.

Component Selection Page

ComponentDescription
gSharp ServerCore scheduler service that executes and manages calculations in gSharp.
gSharp ManagerAdministration tool for configuring the gSharp server and calculations.
Developer KitTools and files for creating custom gSharp assemblies.
Shared FilesAutomatically selected based on other components and cannot be modified.
note

For upgrades or refresh installations, previously installed components are pre-selected and locked. To remove a component, use uninstall.exe from the installation folder or the Add or Remove Programs feature in Windows.

Install Location​

Specify the installation folder or accept the default location.

Install Location Page

Server Component Setup​

These pages appear if gSharp Server is selected.

Scheduler License​

Provide the license required for the gSharp server using the Select File or From Clipboard buttons.

Scheduler License Page

  • Select File: Use the license file provided by your gHost Technology representative.
  • From Clipboard: If the license data is sent as text rather than provided as a file (for example, in a text message), you can copy it to the Windows clipboard and load it from there.

Once loaded, the details of the license are displayed.

Scheduler License Page with valid license details

The details will indicate if there is an error or warning, such as if the license is invalid or about to expire.

Scheduler License Page with valid license details

The Next button is enabled when a valid license is loaded.

Service Account​

Enter the service account for the gSharp Scheduler. Both local and domain accounts are supported. Using a dedicated service account is recommended.

Service Account Page

A valid account is required and the wizard will not proceed to the next page without one. The user can be a local machine account or a domain account. It is highly recommended that a dedicated service account be used.

note

The wizard will attempt to validate the account when the Next button is clicked, before proceeding to the next page. If the account is not valid or the password is incorrect, the wizard will display the error and not proceed to the next page.

Check the Add Windows Firewall rule check box to automatically create a rule in Windows Defender Firewall for inbound access to the gSharp Server.

Database Configuration​

Specify the SQL Server instance for the gSharp database.

SQL Server Page

Use the format MachineName\InstanceName or ServerIPAddress\InstanceName to define the instance. If SQL Server TCP is enabled you may also use the format MachineName,Port or ServerIPAddress,Port Some examples:

localhost\SQLEXPRESS     or     SVRSS01\PROD     or     10.0.0.123,1433

Database Name​

The default gSharp database name is GSharp. Select the Specify a custom name for the database option to use a different name.

note

The gSharp scheduler creates two databases: one for configuration and one for logging. The logging database is automatically named by appending Logging to the configuration database name. For example, if the configuration database is GSharp2, the logging database will be GSharp2Logging.

SQL Scripts​

The gSharp scheduler stores most of its data in SQL Server, which needs to be set up by a user that has SQL Server sysadmin privileges. Choose one of the three options to run the database setup:

  • Now (Windows auth): Uses the current user’s Windows credentials. The user must have sysadmin privileges.
  • Now (SQL Server auth): Uses the SQL Server User name and Password fields specified in the installer. This user must have sysadmin privileges.
  • Later (Generate scripts): Generates SQL scripts that can be run on another machine (for example, by a DBA). The installer provides instructions at the end of installation.

Test Button​

The Now options include a Test button to verify that the SQL Server instance and user credentials are valid and have the required privileges. A successful test is not required to continue, but a failed test usually indicates that the database setup will also fail.

Data Provider Configuration​

The installer has already determined if the PI Asset Framework SDK is needed and installed. Because connection information is managed by the AF-SDK itself, the installer requires no further configuration.

Manager Component Setup​

These pages appear if gSharp Manager is selected.

Scheduler Connection​

Enter the name or IP address of the server where the gSharp Server is installed. This configures the gSharp Manager to connect to that server.

Scheduler Connection Page

If the gSharp Server is installed on the same machine, the connection is automatically set to localhost.

Developer Kit Setup​

These pages appear if Developer Kit is selected on the Choose Components page.

Developer Templates​

The installer installs Visual Studio templates that have been designed specifically to help you build, test, and debug your calculation assemblies. The templates are compatible with Visual Studio 2022 and later (all editions). The installer automatically detects installed versions of Visual Studio from 2022 onwards and displays the versions for which it will install templates.

Each set of templates is tailored to a data provider type. The types available to you are displayed by the installer and pre-selected. Under most circumstances, you will only see one or two providers; in that case, you most likely do not need to do anything except click Next.

Developer Templates Page

warning

Visual Studio 2019 and Visual Studio 2017 are partially supported, but some projects may need to be set up manually.

Visual Studio 2015 and prior versions are not supported.

Installation​

Click the Install button to begin the installation. Progress and logs are displayed during the process.

The final page confirms that the installation is complete.

Installation Completed

Right-click the log to copy details for troubleshooting.

Developer Template Error​

If the Developer Kit was selected in the Component Selection section of the installer and you are installing an update, it is possible that you will see this page.

Developer template error page

Earlier versions of gSharp had issues working around the Windows Controlled Folder Access security feature because templates were being installed in your Documents folder. While this is no longer the case, the installer still must delete old templates that were previously installed in your Documents folder. If this is the case, it will likely encounter the same CFA issue.

Click the first link to open the gSharp Template Installer, which will likely succeed. Click the second link to navigate to the Troubleshooting Page and read more information about why this problem likely occurred.

Post-installation Database Setup​

Depending on the option selected to set up the gSharp databases, there may be follow-up tasks required after the service is installed.

Database Setup During Installation​

This applies to both the Now (Windows Auth) and Now (SQL Server Auth) options selected on the Database Configuration page. With either option, the installer runs the database setup scripts during installation.

If the databases are created successfully, no further action is required. If an error occurs, it is shown on a follow-up page:

Database setup error page

This page typically displays a general error message (as shown above). More detailed information about the failure can be found in the SQL script log, which can be opened by clicking the first link on the page.

note

Most issues reported on this page are related to insufficient privileges when accessing SQL Server.

If the installer fails while setting up the databases, review the SQL script log to determine the cause and correct the issue before retrying. The error shown by the installer is intentionally generic; detailed information is available in the log file.

Most failures at this stage are caused by insufficient SQL Server privileges. These issues can usually be resolved by correcting permissions and do not typically require further assistance.

To re-run the database scripts, see the Running Database Scripts section below.

Generated Database Scripts​

This applies to the Later (Generate scripts) option selected on the Database Configuration page. With this option, the installer only generates the database setup scripts during installation and the user is required to run them manually after the installer has finished.

Post-installation database setup page

This option is usually selected when the person installing gSharp does not have database access to run the scripts and must hand off the task to a DBA.

To run the database scripts, see the Running Database Scripts section below.

Running Database Scripts​

To run the database setup scripts, you will need a machine that has SQL Server Client Tools installed. Specifically, the sqlcmd utility is required by the scripts.

Consider the following options:

  • Option 1: Determine whether the local machine has the sqlcmd utility installed. The best way to do this is to open a command window, type sqlcmd, and press <Enter>.

    • If the utility is installed, it will start and enter interactive mode (displaying a 1> prompt).
    • If it is not installed, you will receive an error similar to the following:
      'sqlcmd' is not recognized as an internal or external command,
      operable program or batch file.

    If the sqlcmd utility is installed, the scripts can be run without further intervention.

    note

    If SQL Server Management Studio is installed, the sqlcmd utility is included.

  • Option 2: Download and install the sqlcmd utility from the Microsoft SQL Tools website.

    If you would like the full SQL Server management experience, you can download and install SQL Server Management Studio from the Microsoft SSMS Installer website. Note that this is a much heavier installation than installing only the sqlcmd utility.

  • Option 3: Copy the SQL scripts to a machine that already has the sqlcmd utility installed. The second link on the error page opens the folder that contains the database scripts. Copy the entire folder to the machine where the scripts will be executed.

GO.bat​

To run the scripts, execute the GO.bat batch file. The batch file is configured to use Windows Authentication to access SQL Server as a sysadmin by default.

If SQL Server Authentication is required, edit the GO.bat file to provide a user name and (optionally) a password. The file contents are similar to the following:

@REM InstallSqlTables.bat <SQL Instance> <GSharp Service Account> <GSharp Database Name> [<SQL Server User> [<SQL Server Password>]]
@CMD /C InstallSqlTables.bat "SVRSQL01\SQLEXPRESS" "DOMAIN01\gsharpsvcacc" "GSharp"
@PAUSE

The InstallSqlTables.bat command expects three to five arguments. By default, only the three mandatory arguments are used:

  • SQL Instance – SVRSQL01\SQLEXPRESS in the example
  • GSharp Service Account – DOMAIN01\gsharpsvcacc in the example
  • GSharp Database Name – GSharp in the example

To specify a SQL Server user name and password, add the following optional arguments:

  • SQL Server User – The SQL Server login that has sysadmin privileges.
  • SQL Server Password – The password for the SQL Server login. If this argument is omitted, InstallSqlTables.bat will prompt the user for one.

For example, if the previous command is modified to provide only a SQL Server user name of sysadminuser:

@REM    InstallSqlTables.bat <SQL Instance> <GSharp Service Account> <GSharp Database Name> [<SQL Server User> [<SQL Server Password>]]
@CMD /C InstallSqlTables.bat "SVRSQL01\SQLEXPRESS" "DOMAIN01\gsharpsvcacc" "GSharp" "sysadminuser"
@PAUSE

The expected output would be:

D:\repos\GHost.GSharp\Installer\SQLScripts>testgo.bat
Password: notarealpassword
Configuring gSharp Databases
Database Server Name: SVRSQL01\SQLEXPRESS
Windows Service Account: DOMAIN01\gsharpsvcacc
Database Name: GSharp
Login Credentials: User sysadminuser password ********
Validating database name
Checking SQL Server privileges
Configuring databases
Configuring security
Configuring grants
SQL script execution completed successfully
Log file: C:\Users\Someone\AppData\Local\Temp\GSharpSqlScriptLog.txt
Press any key to continue . . .

Post-Installation Notes​

Starting the gSharp Scheduler Service​

The installer configures the gSharp Scheduler service to start automatically, but it must be started manually the first time.

  1. Open the Windows Services applet.
  2. Locate gSharp Scheduler.
  3. Click Start in the toolbar.

Logging​

The gSharp server logs events to both the database specified during installation and a text file in the installation directory.

  • Database Logging: Under normal circumstances, log entries are written to the configured gSharp database.
  • Text File Logging: If the database is unavailable at startup, log messages are written to a text file located in the Logs folder of the installation directory. Each day with log activity generates a separate log file.

If the server fails to start, the text log can help identify issues such as database connection errors.

  • System Event Log: If no messages are found in the text log, the failure may be due to a service startup issue. Check the system event log by opening the Windows Event Viewer and navigating to Windows Logs > Application to review detailed error messages.

Regular monitoring of the text logs and event logs is recommended, especially during setup or troubleshooting.