Skip to main content

VersionManager - Installation Guide

Overview

The Bliksund Update Service is designed to manage and deploy updates for Windows applications and services seamlessly. This document provides detailed instructions on how to install and configure the Bliksund Update Service on a Windows environment.

Prerequisites

Before proceeding with the installation, ensure the following requirements are met:

  • Administrator Privileges: Installation requires administrator permissions to ensure the service has sufficient rights to install packages and perform updates.
  • Windows Service Compatibility: The application is intended to run as a Windows Service under the LocalSystem account for optimal security and access rights.
  • .NET Environment: Ensure the .NET runtime compatible with the service is installed on the target machine.

Installation Steps

  1. Unpack the VersionManager.Client.Installer.zip file and open this directory in the terminal.
  2. Run msi exec with url and api key to install the service: msiexec /i VersionManager.Client.Installer.msi SERVERAPIURL=https://your.versionmanager.api.url/api/device SERVERAPIKEY=youDeviceApiKey

How to use script

  1. Using either Azure Data Studio or Microsoft SQL Management tools connect to the Database
  2. Open new Query and paste the script below
-- Procedure to "truncate" tables with delete command
CREATE PROCEDURE [dbo].[TableTruncate]
@Schema NVARCHAR(128),
@TableName NVARCHAR(128)
AS

-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

BEGIN TRAN

DECLARE @FullTableName NVARCHAR(256) = '[' + @Schema + '].[' + @TableName + ']'
DECLARE @NextId NUMERIC = CASE WHEN (IDENT_CURRENT(@FullTableName) = 1) THEN 1 ELSE 0 END
DECLARE @Sql NVARCHAR(MAX) = 'DELETE FROM ' + @FullTableName
EXECUTE sp_executesql @Sql

IF (@@ERROR = 0) BEGIN
DBCC CHECKIDENT (@FullTableName, RESEED, @NextId)

COMMIT TRAN
END ELSE BEGIN
-- Error
ROLLBACK
END
GO

-- Must use truncate because the chunks are too large to remove with a delete command.
TRUNCATE TABLE [VersionManager].[PackageChunks]
GO

-- Can't use normal truncate on the other tables because of foreign key constraints
DELETE FROM [VersionManager].[DeviceVersions]
EXECUTE [dbo].[TableTruncate] @Schema = N'VersionManager', @TableName = N'Devices';
DELETE FROM [VersionManager].[GroupVersions]
EXECUTE [dbo].[TableTruncate] @Schema = N'VersionManager', @TableName = N'Groups';
EXECUTE [dbo].[TableTruncate] @Schema = N'VersionManager', @TableName = N'Packages';
EXECUTE [dbo].[TableTruncate] @Schema = N'VersionManager', @TableName = N'Versions';
EXECUTE [dbo].[TableTruncate] @Schema = N'VersionManager', @TableName = N'Products';
EXECUTE [dbo].[TableTruncate] @Schema = N'VersionManager', @TableName = N'Companies';
GO

-- Clean up by dropping the helper procedure
DROP PROCEDURE [dbo].[TableTruncate]
GO

SELECT * FROM [VersionManager].[Companies]
SELECT * FROM [VersionManager].[Devices]
SELECT * FROM [VersionManager].[DeviceVersions]
SELECT * FROM [VersionManager].[Groups]
SELECT * FROM [VersionManager].[GroupVersions]
SELECT * FROM [VersionManager].[PackageChunks]
SELECT * FROM [VersionManager].[Packages]
SELECT * FROM [VersionManager].[Products]
SELECT * FROM [VersionManager].[Versions]
  1. Save file name with ResetVersionManager.sql and Press button Execute
note

The SERVERAPIURL and SERVERAPIKEY parameters are required to connect the service to the VersionManager API. The SERVERAPIURL parameter should be the URL of the VersionManager API, and the SERVERAPIKEY parameter should be the API key of the device. The SERVERAPIURL must end with api/device, so if the service is deployed f.ex. at https://your.versionmanager.api.url, the SERVERAPIURL parameter should be https://your.versionmanager.api.url/api/device.

Post-Installation Configuration

  • Event Viewer Logging: Service logs are available in the Windows/Application section of the Event Viewer. Logs are bundled in warning events for each main process execution.

  • Service Updates: To update the service, stop it, delete its directory, and republish using the steps above.

Troubleshooting

  • Permission Issues: Ensure the service is run with administrative privileges.
  • Configuration Changes: Modifications to appsettings.json require a service restart to take effect.