Updater
The updater is a Windows service on the invoiceR server. It regularly checks whether a new version is available and installs it on its own. Frontend and backend each have their own updater, with one per environment (test, production).
How an update runs
Section titled “How an update runs”- Check: At a fixed interval the updater asks enio for a new version. Alternatively it checks a local folder for a provided update file.
- Prepare: It downloads the ZIP archive, extracts it, copies your configuration files into it and, for the backend, runs the migrator. If the migration fails, the running version stays unchanged; the next attempt tries again.
- Replace: It stops the website, moves the program folder, replaces it with the new version and starts the website again. The website is only started if it was running before.
- Finish: It writes the file
.versionwith the installed version to the program folder, packs the old version into a ZIP archive and deletes the oldest archives.
The updater no longer tries a version whose installation has failed several times.
Installing
Section titled “Installing”The updater folder contains scripts that register and start the service: Install-BE.bat for the backend,
Install-FE.bat for the frontend (run as administrator). They detect the environment from the folder name
(Test or Prod) and create a service such as InvoiceR-Updater Backend Prod. Uninstall-BE.bat and
Uninstall-FE.bat remove it again.
By hand:
sc.exe create "InvoiceR-Updater Backend Prod" binPath= D:\invoiceR\Prod\Updater-BE\InvoiceR_Update_Service.exe start=autosc.exe start "InvoiceR-Updater Backend Prod"Configuration
Section titled “Configuration”The updater reads the file appsettings.json in its folder.
RemoteSettings
Section titled “RemoteSettings”| Key | Meaning |
|---|---|
SecretKey | Key with which the installation identifies itself to enio. You receive it from enio. |
SoftwareId | 1 = frontend, 2 = backend. |
BackendApiUrl | Address from which new versions are obtained. You receive it from enio. |
LocalSettings
Section titled “LocalSettings”| Key | Default | Meaning |
|---|---|---|
CheckEveryXSeconds | 60 | Interval for checking for new versions. |
MaxInstallationAttempts | 5 | Number of attempts per version. |
WorkingDirectory | Working folder; relative paths start from here. | |
ApplicationDirectory | ../App | invoiceR program folder (frontend or backend). |
ConfigurationDirectory | AppConfig | Folder with your configuration files that are copied into every new version. |
ArchiveDirectory | Archive | Folder for archives of old versions. |
KeepArchivesMax | 10 | Number of archives to keep. Negative: never delete. |
StartStopWebServer | true: stop and start website and application pool during the update. | |
WebsiteName, WebsitePoolName | Name of the website and application pool in IIS. | |
ForceWebServerStart | true: start the website after the update even if it was not running before. | |
RunMigrations | true: run the migrator during the update (backend only). | |
MigratorEnvironment | Production | Value for ASPNETCORE_ENVIRONMENT during migration. |
MigratorCustomAppSettings | Value for INVOICER_CUSTOM_APPSETTINGS during migration. | |
MigratorTimeoutSeconds | 1800 | Maximum duration of the migration. |
TempDirectory | Folder for temporary files. Must be on the same drive as the website. | |
ProxyAddress, ProxyUser, ProxyPassword | Proxy server for internet access. | |
UpdateFromDirectory | false | true: take the update file from a local folder instead of the internet. |
ApplicationUpdateDirectory | Folder with the update file if UpdateFromDirectory is set. | |
ApplicationUpdateFilename | File name of the update file in that folder. |
