summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/platform.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/platform.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
index b1025c5..8f5d484 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
@@ -282,6 +282,27 @@ export const node = {
return bridge.node.autostart('remove');
},
},
+ /**
+ * Windows only: switch INTO or OUT OF service mode after install — the
+ * installer's own choice is effectively one-shot (build/installer.nsh skips
+ * it once the firewall rules exist for any reason, and per-user mode sets
+ * those up on its own with no Scheduled Task), so this is the only way back
+ * in if it was declined, or out if it was chosen and no longer wanted. One
+ * elevation, task + firewall together — same script the installer runs.
+ */
+ serviceMode: {
+ available: Boolean(bridge && bridge.node && bridge.node.serviceMode),
+ async install() {
+ if (!bridge || !bridge.node || !bridge.node.serviceMode)
+ throw new Error('Node bridge not available');
+ return bridge.node.serviceMode('install');
+ },
+ async remove() {
+ if (!bridge || !bridge.node || !bridge.node.serviceMode)
+ throw new Error('Node bridge not available');
+ return bridge.node.serviceMode('remove');
+ },
+ },
};
/**