@dinoxx/dinox-cli 2.18.3 → 2.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -87,5 +87,11 @@ export type DaemonServiceOptions = {
|
|
|
87
87
|
/** Windows: `DOMAIN\\user` the logon task runs as. */
|
|
88
88
|
windowsUserId?: string;
|
|
89
89
|
};
|
|
90
|
+
/**
|
|
91
|
+
* `DOMAIN\\user` for the logon task. Outside an interactive logon (OpenSSH,
|
|
92
|
+
* some service hosts) USERDOMAIN is the workgroup name, which maps to no
|
|
93
|
+
* account; a local account is `COMPUTERNAME\\user`.
|
|
94
|
+
*/
|
|
95
|
+
export declare function windowsTaskUser(env: NodeJS.ProcessEnv, user: string): string;
|
|
90
96
|
/** The service manager for this platform, or null where none is supported. */
|
|
91
97
|
export declare function getDaemonService(options?: DaemonServiceOptions): DaemonService | null;
|
|
@@ -573,6 +573,15 @@ class WindowsTaskService {
|
|
|
573
573
|
return installed;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
+
/**
|
|
577
|
+
* `DOMAIN\\user` for the logon task. Outside an interactive logon (OpenSSH,
|
|
578
|
+
* some service hosts) USERDOMAIN is the workgroup name, which maps to no
|
|
579
|
+
* account; a local account is `COMPUTERNAME\\user`.
|
|
580
|
+
*/
|
|
581
|
+
export function windowsTaskUser(env, user) {
|
|
582
|
+
const domain = env.USERDOMAIN && env.USERDOMAIN.toUpperCase() !== 'WORKGROUP' ? env.USERDOMAIN : env.COMPUTERNAME;
|
|
583
|
+
return domain ? `${domain}\\${user}` : user;
|
|
584
|
+
}
|
|
576
585
|
/** The service manager for this platform, or null where none is supported. */
|
|
577
586
|
export function getDaemonService(options = {}) {
|
|
578
587
|
const platform = options.platform ?? process.platform;
|
|
@@ -589,7 +598,7 @@ export function getDaemonService(options = {}) {
|
|
|
589
598
|
if (platform === 'win32') {
|
|
590
599
|
const systemRoot = env.SystemRoot || env.SYSTEMROOT || 'C:\\Windows';
|
|
591
600
|
const user = env.USERNAME || os.userInfo().username;
|
|
592
|
-
return new WindowsTaskService(label, run, options.launcherDir ?? path.join(getDataDir(), 'daemon'), path.join(systemRoot, 'System32', 'wscript.exe'), options.windowsUserId ?? (env
|
|
601
|
+
return new WindowsTaskService(label, run, options.launcherDir ?? path.join(getDataDir(), 'daemon'), path.join(systemRoot, 'System32', 'wscript.exe'), options.windowsUserId ?? windowsTaskUser(env, user));
|
|
593
602
|
}
|
|
594
603
|
return null;
|
|
595
604
|
}
|