Skip to content

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).

  1. Check: At a fixed interval the updater asks enio for a new version. Alternatively it checks a local folder for a provided update file.
  2. 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.
  3. 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.
  4. Finish: It writes the file .version with 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.

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=auto
sc.exe start "InvoiceR-Updater Backend Prod"

The updater reads the file appsettings.json in its folder.

KeyMeaning
SecretKeyKey with which the installation identifies itself to enio. You receive it from enio.
SoftwareId1 = frontend, 2 = backend.
BackendApiUrlAddress from which new versions are obtained. You receive it from enio.
KeyDefaultMeaning
CheckEveryXSeconds60Interval for checking for new versions.
MaxInstallationAttempts5Number of attempts per version.
WorkingDirectoryWorking folder; relative paths start from here.
ApplicationDirectory../AppinvoiceR program folder (frontend or backend).
ConfigurationDirectoryAppConfigFolder with your configuration files that are copied into every new version.
ArchiveDirectoryArchiveFolder for archives of old versions.
KeepArchivesMax10Number of archives to keep. Negative: never delete.
StartStopWebServertrue: stop and start website and application pool during the update.
WebsiteName, WebsitePoolNameName of the website and application pool in IIS.
ForceWebServerStarttrue: start the website after the update even if it was not running before.
RunMigrationstrue: run the migrator during the update (backend only).
MigratorEnvironmentProductionValue for ASPNETCORE_ENVIRONMENT during migration.
MigratorCustomAppSettingsValue for INVOICER_CUSTOM_APPSETTINGS during migration.
MigratorTimeoutSeconds1800Maximum duration of the migration.
TempDirectoryFolder for temporary files. Must be on the same drive as the website.
ProxyAddress, ProxyUser, ProxyPasswordProxy server for internet access.
UpdateFromDirectoryfalsetrue: take the update file from a local folder instead of the internet.
ApplicationUpdateDirectoryFolder with the update file if UpdateFromDirectory is set.
ApplicationUpdateFilenameFile name of the update file in that folder.