Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: 2.1.0 - PR to main branch #170

Merged
merged 49 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
cc85b8a
Fix: missing audio commands due to improper configuration (#39)
amadeo-alex Jan 13, 2024
01463da
updated VirtualDesktop library version and removed unused one (#40)
amadeo-alex Jan 15, 2024
2ac7574
Development: 2.1.0-beta1 version change (#46)
amadeo-alex Feb 13, 2024
952d8ec
Fix: sensor being updated constantly when value doesn't change (#45)
amadeo-alex Feb 13, 2024
87887aa
Feature: screenshot camera sensor (#42)
amadeo-alex Feb 13, 2024
7f6b3f5
Feature: set audio input command (#41)
amadeo-alex Feb 13, 2024
dd55e18
Fix: Powershell command argument binding (#47)
amadeo-alex Feb 15, 2024
d1af9d6
Fix: active window title encoding (#50)
amadeo-alex Feb 24, 2024
a426aee
Fix: constant MQTT discovery payload publish (#54)
amadeo-alex Mar 1, 2024
b828cf8
Feature: ability to ignore MQTT grace period after waking up from hib…
amadeo-alex Mar 1, 2024
dc6b04e
Feature: modern/transparent tray icon option (#55)
amadeo-alex Mar 1, 2024
113f17b
updated description to better reflect sensor's functionality (#57)
amadeo-alex Mar 1, 2024
3478aa0
dependency bump (#56)
amadeo-alex Mar 1, 2024
2067440
added note regarding HA 255 payload character limit (#58)
amadeo-alex Mar 1, 2024
1f2a409
Feature: NFC tag scanning (#69)
amadeo-alex Apr 8, 2024
5e480f4
Fix: close all subwindows when main one is closed (#70)
amadeo-alex Apr 8, 2024
9e10674
Fix: device rename MQTT messages cleanup (#71)
amadeo-alex Apr 8, 2024
571c8fa
Fix: added additional check for mixed german keyboard layouts (#74)
amadeo-alex May 1, 2024
b2fb3c9
Fix: attributes are now cleared if no process uses the microphone (#76)
amadeo-alex May 2, 2024
07a76e5
Feature: ActiveWindowSensor process name attribute (#77)
amadeo-alex May 2, 2024
d5d84ae
Fix: added additional checks for management object property or its va…
amadeo-alex May 2, 2024
d8dd96a
Feature: advanced sensor settings (device_class, unit_of_measurement,…
amadeo-alex May 2, 2024
255d209
Fix: adjust sensor state_class/device_class (#82)
amadeo-alex May 3, 2024
2ff3696
Fix: screenshot sensor monitor scaling (#84)
amadeo-alex May 4, 2024
eec64de
Fix: CoreAudio library memory leak / redesign (#85)
amadeo-alex May 4, 2024
efa9a32
Fix: name being used instead of friendly name while creating/editing …
amadeo-alex May 7, 2024
dafd930
Fix: windows updates sensor missing uniqueid (#90)
amadeo-alex May 8, 2024
c8cb353
Fix: added lost useAttributes parameter (#92)
amadeo-alex May 16, 2024
8051a8b
Feature: "MultipleKeys" command support for action parameter (#98)
amadeo-alex Jun 2, 2024
8e67272
Fix: audio library/sleep management/playback (#101)
amadeo-alex Jun 16, 2024
bd03bf5
added missing audio device mute attribute assignment; added missing m…
amadeo-alex Jun 16, 2024
c63e485
Feature: separate installer for client and satellite (#103)
amadeo-alex Jun 16, 2024
0bd1904
Fix: advanced settings not being saved for satellite sensors (#104)
amadeo-alex Jun 22, 2024
be6a48c
fixed advanced settings not being saved properly (#105)
amadeo-alex Jun 24, 2024
abec36f
Fix: added ignoreversion parameter (#107)
amadeo-alex Jun 24, 2024
b577482
Fix: satellite service installer not respecting user selected path (#…
amadeo-alex Jul 3, 2024
f30f24a
Fix: audio manager com-thread safety (#122)
amadeo-alex Jul 12, 2024
1027b1f
Fix: satellite service sensors/commands not being properly saved (#123)
amadeo-alex Jul 12, 2024
5161f6f
Feature: tray webview command (#124)
amadeo-alex Jul 12, 2024
6b474c2
Feature: quick action automation trigger (#125)
amadeo-alex Jul 13, 2024
5082f67
Feature: quick action button press (#126)
amadeo-alex Jul 13, 2024
3fd5fda
Fix: readded service stop logic (#133)
amadeo-alex Aug 1, 2024
ee6c38f
Fix: added additional null check for malfunctioning sensors (#134)
amadeo-alex Aug 3, 2024
cdb26c6
Release: 2.1.0-beta3 (#135)
amadeo-alex Aug 4, 2024
0692d6c
Feature: v3 notification features backport (#140)
amadeo-alex Aug 19, 2024
2ff7bd9
Fix: webview not respecting taskbar location (#141)
amadeo-alex Aug 19, 2024
3417aef
Release: 2.1.0-beta4 (#142)
amadeo-alex Aug 19, 2024
91ea787
Release: 2.1.0 (#168)
amadeo-alex Sep 27, 2024
197a2fc
Fix: satellite sensor and command firendly name not saved properly (#…
amadeo-alex Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ jobs:
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent\\HASS.Agent.Satellite.Service"
run: "dotnet publish -c Release -f net6.0-windows10.0.19041.0 -o bin\\Publish-x64\\Release\\ --no-self-contained -r win-x64 -p:Platform=x64"

- name: Compile InnoSetup Installer
- name: Compile InnoSetup Installer - Satellite Service
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent.Installer"
run: |
& "${Env:ProgramFiles(x86)}\\Inno Setup 6\\iscc.exe" InstallerScript-Service.iss

- name: Compile InnoSetup Installer - Client
working-directory: "D:\\a\\HASS.Agent\\HASS.Agent\\src\\HASS.Agent.Installer"
run: |
& "${Env:ProgramFiles(x86)}\\Inno Setup 6\\iscc.exe" InstallerScript.iss
Expand Down
222 changes: 222 additions & 0 deletions src/HASS.Agent.Installer/AfterInstallNotice-Service.rtf

Large diffs are not rendered by default.

218 changes: 218 additions & 0 deletions src/HASS.Agent.Installer/BeforeInstallNotice-Service.rtf

Large diffs are not rendered by default.

25 changes: 14 additions & 11 deletions src/HASS.Agent.Installer/BeforeInstallNotice.rtf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch31506\stshfhich31506\stshfbi31506\deflang2057\deflangfe2057\themelang1045\themelangfe0\themelangcs1025{\fonttbl{\f0\fbidi \froman\fcharset238\fprq2{\*\panose 02020603050405020304}Times New Roman;}
{\f34\fbidi \froman\fcharset238\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f43\fbidi \fswiss\fcharset238\fprq2{\*\panose 00000000000000000000}Tahoma;}
{\f34\fbidi \froman\fcharset238\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f43\fbidi \fswiss\fcharset238\fprq2{\*\panose 020b0604030504040204}Tahoma;}
{\flomajor\f31500\fbidi \froman\fcharset238\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \froman\fcharset238\fprq2{\*\panose 02020603050405020304}Times New Roman;}
{\fhimajor\f31502\fbidi \fswiss\fcharset238\fprq2{\*\panose 020f0302020204030204}Calibri Light;}{\fbimajor\f31503\fbidi \froman\fcharset238\fprq2{\*\panose 02020603050405020304}Times New Roman;}
{\flominor\f31504\fbidi \froman\fcharset238\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \froman\fcharset238\fprq2{\*\panose 02020603050405020304}Times New Roman;}
Expand Down Expand Up @@ -43,12 +43,12 @@
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa160\sl259\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31506\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive
\rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf19 \sbasedon10 \sunhideused \styrsid490208 Hyperlink;}{\*\cs16 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \cf20\chshdng0\chcfpat0\chcbpat21 \sbasedon10 \ssemihidden \sunhideused \styrsid490208 Unresolved Mention;}}}}
{\*\rsidtbl \rsid227266\rsid490208\rsid2324250\rsid3874449\rsid4072052\rsid5209844\rsid7356386\rsid7820567\rsid12408085\rsid16263522}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0
\mnaryLim1}{\info{\author Amadeo}{\operator Amadeo}{\creatim\yr2023\mo11\dy27\hr16\min53}{\revtim\yr2023\mo12\dy4\hr20\min20}{\version8}{\edmins4}{\nofpages1}{\nofwords112}{\nofchars640}{\nofcharsws751}{\vern81}}{\*\xmlnstbl {\xmlns1 http://schemas.micros
oft.com/office/word/2003/wordml}}\paperw11906\paperh16838\margl1417\margr1417\margt1417\margb1417\gutter0\ltrsect
{\*\rsidtbl \rsid227266\rsid490208\rsid1446401\rsid2324250\rsid3874449\rsid4072052\rsid5209844\rsid5534268\rsid7356386\rsid7820567\rsid12408085\rsid16263522}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1
\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author Amadeo}{\operator Amadeo}{\creatim\yr2023\mo11\dy27\hr16\min53}{\revtim\yr2024\mo9\dy27\hr20\min54}{\version10}{\edmins6}{\nofpages1}{\nofwords136}{\nofchars776}{\nofcharsws911}{\vern81}}
{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw11906\paperh16838\margl1417\margr1417\margt1417\margb1417\gutter0\ltrsect
\widowctrl\ftnbj\aenddoc\hyphhotz425\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1
\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1417\dgvorigin1417\dghshow1\dgvshow1
\jexpand\viewkind1\viewscale104\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
\asianbrkrule\rsidroot490208\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0
{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid16263522\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}
{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
Expand All @@ -57,16 +57,19 @@ oft.com/office/word/2003/wordml}}\paperw11906\paperh16838\margl1417\margr1417\ma
\f31506\fs22\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 \af43 \ltrch\fcs0 \f43\fs16\insrsid227266 \line }{\rtlch\fcs1 \af43 \ltrch\fcs0 \f43\fs16\insrsid490208\charrsid4072052 Welcome to HASS.Agent Installer!
\par This version is maintained by the }{\field{\*\fldinst {\rtlch\fcs1 \af43 \ltrch\fcs0 \f43\fs16\insrsid2324250 HYPERLINK "https://github.com/hass-agent/" }{\rtlch\fcs1 \af43 \ltrch\fcs0 \f43\fs16\insrsid2324250 {\*\datafield
00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b56000000680074007400700073003a002f002f006700690074006800750062002e0063006f006d002f0068006100730073002d006100670065006e0074002f000000795881f43b1d7f48af2c825dc485276300000000
a5ab0003}}}{\fldrslt {\rtlch\fcs1 \af43 \ltrch\fcs0 \cs15\f43\fs16\ul\cf19\insrsid490208\charrsid2324250 HASS.Agent Team}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid16263522\sftnbj {\rtlch\fcs1
a5ab000300}}}{\fldrslt {\rtlch\fcs1 \af43 \ltrch\fcs0 \cs15\f43\fs16\ul\cf19\insrsid490208\charrsid2324250 HASS.Agent Team}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid16263522\sftnbj {\rtlch\fcs1
\af43 \ltrch\fcs0 \f43\fs16\insrsid490208\charrsid4072052 and is a fork of the }{\field\flddirty{\*\fldinst {\rtlch\fcs1 \af43 \ltrch\fcs0 \f43\fs16\insrsid490208\charrsid4072052 HYPERLINK "https://github.com/LAB02-Research/HASS.Agent" }{\rtlch\fcs1
\af43 \ltrch\fcs0 \f43\fs16\insrsid490208\charrsid4072052 {\*\datafield
00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b72000000680074007400700073003a002f002f006700690074006800750062002e0063006f006d002f004c0041004200300032002d00520065007300650061007200630068002f0048004100530053002e0041006700
65006e0074000000795881f43b1d7f48af2c825dc485276300000000a5ab00030064d96621af00}}}{\fldrslt {\rtlch\fcs1 \af43 \ltrch\fcs0 \cs15\f43\fs16\ul\cf19\insrsid490208\charrsid4072052 original}}}\sectd \ltrsect
65006e0074000000795881f43b1d7f48af2c825dc485276300000000a5ab00030064d96621af0000}}}{\fldrslt {\rtlch\fcs1 \af43 \ltrch\fcs0 \cs15\f43\fs16\ul\cf19\insrsid490208\charrsid4072052 original}}}\sectd \ltrsect
\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid16263522\sftnbj {\rtlch\fcs1 \af43 \ltrch\fcs0 \f43\fs16\insrsid490208\charrsid4072052 version by LAB02-Research.
\par The intention of this version is to provide bug-fix and feature updated until the development of original version is resumed.
\par We've tried our best to maintain compatibility with the original version but some breaking changes are unavoidable.
\par The installer has an option to migrate current installation configuration for seamless transition, please remembe
r that some settings (like MQTT configuration) may need to be changed if you'd like to run two instances of HASS.Agent - forked and original one.}{\rtlch\fcs1 \af43 \ltrch\fcs0 \f43\fs16\insrsid12408085\charrsid4072052
\par The installer has an option to migrate current installation configuration for seamless transition, please remember that some settings (like MQTT configuration) may need
to be changed if you'd like to run two instances of HASS.Agent - forked and original one.}{\rtlch\fcs1 \af43 \ltrch\fcs0 \f43\fs16\insrsid12408085
\par }{\rtlch\fcs1 \af43 \ltrch\fcs0 \b\f43\fs16\insrsid5534268\charrsid1446401 Please note:}{\rtlch\fcs1 \af43 \ltrch\fcs0 \f43\fs16\insrsid5534268 the }{\rtlch\fcs1 \af43 \ltrch\fcs0 \b\f43\fs16\insrsid5534268\charrsid1446401 migration}{\rtlch\fcs1 \af43
\ltrch\fcs0 \f43\fs16\insrsid5534268 option should be used }{\rtlch\fcs1 \af43 \ltrch\fcs0 \b\f43\fs16\insrsid5534268\charrsid5534268 only once}{\rtlch\fcs1 \af43 \ltrch\fcs0 \b\f43\fs16\insrsid5534268 . }{\rtlch\fcs1 \af43 \ltrch\fcs0
\f43\fs16\insrsid5534268 Using it more than once will once again try to copy the configuration from the original HASS.Agent.}{\rtlch\fcs1 \af43 \ltrch\fcs0 \f43\fs16\insrsid5534268\charrsid5534268
\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
Expand Down Expand Up @@ -211,8 +214,8 @@ fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000304c
b6fce626da01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000503f
ad9e0e11db01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000105000000000000}}
114 changes: 114 additions & 0 deletions src/HASS.Agent.Installer/InstallerScript-Service.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
; 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"
#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: ignoreversion 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: "{app}"; Flags: createvalueifdoesntexist uninsdeletevalue

; Service registration and removal
[Run]
Filename: "{sys}\sc.exe"; Parameters: "create {#ServiceName} binpath= ""{app}\{#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;

procedure CurStepChanged(CurStep: TSetupStep);
var
ProgressPage: TOutputProgressWizardPage;
I, Step, Wait, ResultCode: Integer;
begin
if CurStep = ssInstall then
begin
Exec(ExpandConstant('{sys}') + '\sc.exe', 'stop ' + ExpandConstant('{#ServiceName}'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)

//thanks to https://stackoverflow.com/a/39827761
Wait := 5000;
Step := 100;
ProgressPage :=
CreateOutputProgressPage(
WizardForm.PageNameLabel.Caption,
WizardForm.PageDescriptionLabel.Caption);
ProgressPage.SetText('Making sure the satellite service is stopped...', '');
ProgressPage.SetProgress(0, Wait);
ProgressPage.Show;
try
for I := 0 to Wait div Step do
begin
ProgressPage.SetProgress(I * Step, Wait);
Sleep(Step);
end;
finally
ProgressPage.Hide;
ProgressPage.Free;
end;
end;
end;
Loading
Loading