forked from LAB02-Research/HASS.Agent.Staging
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: separate installer for client and satellite (#103)
This PR separates the installer into two different ones (embedded) that allows for non-privileged user installation.
- Loading branch information
1 parent
bd03bf5
commit c63e485
Showing
8 changed files
with
555 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
222 changes: 222 additions & 0 deletions
222
src/HASS.Agent.Installer/AfterInstallNotice-Service.rtf
Large diffs are not rendered by default.
Oops, something went wrong.
218 changes: 218 additions & 0 deletions
218
src/HASS.Agent.Installer/BeforeInstallNotice-Service.rtf
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
; Script generated by the Inno Setup Script Wizard. | ||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! | ||
; Modified to suit HASS.Agent requirements :) | ||
|
||
; InnoDependencyInstaller | ||
; Thanks to https://github.com/DomGries/InnoDependencyInstaller for the amazing work! | ||
#define public Dependency_Path_NetCoreCheck "dependencies\" | ||
#include "CodeDependencies.iss" | ||
|
||
; Standard installation constants | ||
#define MyAppName "HASS.Agent Satellite Service" | ||
#define MyAppVersion "2.1.0-beta2" | ||
#define MyAppPublisher "HASS.Agent Team" | ||
#define MyAppURL "https://hass-agent.io" | ||
#define MyAppExeName "HASS.Agent.Satellite.Service.exe" | ||
#define ServiceName "hass.agent.svc" | ||
#define ServiceDisplayName "HASS.Agent - Satellite Service" | ||
#define ServiceDescription "Satellite service for HASS.Agent: a Windows based Home Assistant client. This service processes commands and sensors without the requirement of a logged-in user." | ||
|
||
[Setup] | ||
ArchitecturesInstallIn64BitMode=x64 | ||
;SetupMutex=Global\HASS.Agent.Setup.Satellite.Mutex,HASS.Agent.Satellite.Setup.Mutex | ||
AppMutex=Global\\HASS.Agent.Service.Mutex | ||
AppId={{4004588E-F411-41C2-ABD8-A898B0A14B93} | ||
AppName={#MyAppName} | ||
AppVersion={#MyAppVersion} | ||
;AppVerName={#MyAppName} {#MyAppVersion} | ||
AppPublisher={#MyAppPublisher} | ||
AppPublisherURL={#MyAppURL} | ||
AppSupportURL={#MyAppURL} | ||
AppUpdatesURL={#MyAppURL} | ||
DefaultDirName={commonpf64}\{#MyAppName}\Service | ||
DisableProgramGroupPage=yes | ||
LicenseFile=..\..\LICENSE.md | ||
InfoBeforeFile=.\BeforeInstallNotice-Service.rtf | ||
InfoAfterFile=.\AfterInstallNotice-Service.rtf | ||
PrivilegesRequired=admin | ||
OutputDir=.\bin | ||
OutputBaseFilename=HASS.Agent.Service.Installer | ||
SetupIconFile=..\HASS.Agent\HASS.Agent.Shared\hassagent.ico | ||
Compression=lzma | ||
SolidCompression=yes | ||
WizardStyle=modern | ||
CloseApplications=force | ||
CloseApplicationsFilter=*.* | ||
UninstallDisplayIcon={app}\{#MyAppExeName} | ||
UninstallDisplayName={#MyAppName} {#MyAppVersion} | ||
|
||
[Languages] | ||
Name: "english"; MessagesFile: "compiler:Default.isl" | ||
|
||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files | ||
[Files] | ||
; Service files | ||
Source: "..\HASS.Agent\HASS.Agent.Satellite.Service\bin\Publish-x64\Release\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs | ||
|
||
[Run] | ||
Filename: "{sys}\sc.exe"; Parameters: "start {#ServiceName}"; Description: "Start Satellite Service"; Flags: postinstall runhidden runascurrentuser | ||
|
||
[Registry] | ||
Root: HKLM; Subkey: "SOFTWARE\HASSAgent\SatelliteService"; ValueType: string; ValueName: "InstallPath"; ValueData: "{commonpf64}\{#MyAppName}\Service"; Flags: createvalueifdoesntexist uninsdeletevalue | ||
|
||
; Service registration and removal | ||
[Run] | ||
Filename: "{sys}\sc.exe"; Parameters: "create {#ServiceName} binpath= ""{commonpf64}\{#MyAppName}\Service\{#MyAppExeName}"""; Flags: runhidden | ||
Filename: "{sys}\sc.exe"; Parameters: "failure {#ServiceName} reset= 86400 actions= restart/60000/restart/60000//1000"; Flags: runhidden | ||
Filename: "{sys}\sc.exe"; Parameters: "description {#ServiceName} ""{#ServiceDescription}"""; Flags: runhidden | ||
Filename: "{sys}\sc.exe"; Parameters: "config {#ServiceName} DisplayName= ""{#ServiceDisplayName}"""; Flags: runhidden | ||
Filename: "{sys}\sc.exe"; Parameters: "config {#ServiceName} start= auto"; Flags: runhidden | ||
[UninstallRun] | ||
Filename: "{sys}\sc.exe"; Parameters: "stop {#ServiceName}"; RunOnceId: StopService; Flags: runhidden | ||
Filename: "{sys}\timeout.exe"; Parameters: "5"; RunOnceId: Delay1; Flags:runhidden | ||
Filename: "{sys}\sc.exe"; Parameters: "delete {#ServiceName}" ; RunOnceId: DeleteService; Flags: runhidden | ||
Filename: "{sys}\timeout.exe"; Parameters: "5"; RunOnceId: Delay2; Flags:runhidden | ||
|
||
[Code] | ||
function InitializeSetup: Boolean; | ||
begin | ||
Dependency_ForceX86 := False; | ||
Dependency_AddDotNet60Desktop; | ||
Result := True; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters