Table of Contents

Interface IAppInstanceSetup

Namespace
VpnHood.AppUi.Hosting.Desktop.Daemon.Platform
Assembly
VpnHood.AppUi.Hosting.Desktop.Daemon.dll

Defines the registering of the instance with the system and its removal, where the app does that itself rather than its package's installer, as on Windows.

public interface IAppInstanceSetup

Remarks

Both print for a person and return only an exit code, and both ask for elevation where this process has none, but for an install folder that is not safe, which is refused before.

Methods

Install(CancellationToken)

Registers the instance; on a registered one, it brings the registration back to what it should be.

Task<int> Install(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<int>

A task whose result is the exit code.

Exceptions

OperationCanceledException

cancellationToken was canceled.

Win32Exception

The service control manager refused.

InvalidOperationException

Elevation could not be asked for or was refused, or a registry key the setup needs is not available.

Uninstall(CancellationToken)

Removes the instance.

Task<int> Uninstall(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<int>

A task whose result is the exit code.

Exceptions

OperationCanceledException

cancellationToken was canceled.

SystemException

The service did not stop in time, as System.ServiceProcess.TimeoutException.

Win32Exception

The service control manager refused.

InvalidOperationException

Elevation could not be asked for or was refused, or a registry key the setup needs is not available.