Skip to content

Commit

Permalink
v1.1. Use the now separate windows-registry-monitor package instead o…
Browse files Browse the repository at this point in the history
…f including it inside this package. Also added a setting to control whether error logging is enabled.
  • Loading branch information
blu3mania committed Sep 28, 2022
1 parent 3ca8a97 commit ae3f858
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 1,364 deletions.
5 changes: 4 additions & 1 deletion README.md
@@ -1,4 +1,4 @@
# Registry-Auto-Updater
# registry-auto-updater
[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-yellow)](https://raw.githubusercontent.com/blu3mania/registry-auto-updater/main/LICENSE)
[![node.js 17+](https://img.shields.io/badge/node.js-17.0.0-blue?logo=node.js)](https://nodejs.org/en/)
[![Latest Release](https://img.shields.io/github/v/release/blu3mania/registry-auto-updater)](https://github.com/blu3mania/registry-auto-updater/releases/latest)
Expand Down Expand Up @@ -34,6 +34,9 @@ It can be run as a standalone application or as a Windows service.
in provider, or domain update is queued (due to update interval).

**Note**, this only works when running in standalone mode instead of a Windows service.
* logging determines whether registry API errors will be logged to console. It helps with initial investigation
but might become too spamming when there are expected errors, especially when other applications delete the
keys/values this app is motioning.
* updateSets defines the registry keys/values to monitor/update. It is an array, and each item has the following
properties:
* id is a string identifier used for display, so it is clear which update set is triggered when event happens
Expand Down
5 changes: 3 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "registry-auto-updater",
"type": "module",
"version": "1.0.0",
"version": "1.1.0",
"description": "Auto update Windows registry based on configuration",
"exports": "src/app.js",
"scripts": {
Expand Down Expand Up @@ -35,7 +35,8 @@
"chalk": "^5.0.1",
"ffi-napi": "^4.0.3",
"node-notifier": "^10.0.1",
"node-windows": "^1.0.0-beta.8"
"node-windows": "^1.0.0-beta.8",
"windows-registry-monitor": "^1.0.1"
},
"devDependencies": {}
}
9 changes: 7 additions & 2 deletions src/app.js
@@ -1,13 +1,14 @@
import * as url from 'url';
import path from 'path';
import url from 'url';

import notifier from 'node-notifier';
import Registry from 'windows-registry-monitor';

import {
error,
warning,
info,
verbose } from './print.js';
import { Registry } from './windows-registry.js';
import settings from './settings.json' assert {type: 'json'};

verbose('Starting...');
Expand All @@ -25,6 +26,10 @@ const monitorTokens = [];
main();

function main() {
if (!settings.logging) {
registry.disableLogging();
}

settings.updateSets.forEach((updateSet) => {
updateSet.values.forEach((value) => {
const updateValue = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/install-service.js
@@ -1,5 +1,6 @@
import * as url from 'url';
import path from 'path';
import url from 'url';

import { Service } from 'node-windows';

import {
Expand Down
1 change: 1 addition & 0 deletions src/settings.json
Expand Up @@ -3,6 +3,7 @@
"name": "Registry Auto Updater"
},
"showNotification": false,
"logging": true,
"updateSets": [
{
"id": "Interactive logon: Do not require CTRL+ALT+DEL",
Expand Down
3 changes: 2 additions & 1 deletion src/uninstall-service.js
@@ -1,5 +1,6 @@
import * as url from 'url';
import path from 'path';
import url from 'url';

import { Service } from 'node-windows';

import {
Expand Down

0 comments on commit ae3f858

Please sign in to comment.