Update WelsonJS.Service and related files

This commit is contained in:
Namhyeon Go 2024-07-23 13:13:33 +09:00
parent 7ef118955d
commit f60f99fc73
4 changed files with 26 additions and 16 deletions

View File

@ -92,7 +92,7 @@ namespace WelsonJS.Service
// set script name
if (string.IsNullOrEmpty(scriptName))
{
scriptName = "helloworld";
scriptName = "defaultService";
Log("Script name not provided. Using default value: " + scriptName);
}

View File

@ -1,4 +1,6 @@
@echo off
rem bootstrap.bat
rem WelsonJS 0.2.7
rem https://github.com/gnh1201/welsonjs
pushd %~dp0
@ -20,6 +22,9 @@ echo [*] Registering WelsonJS Toolkit component...
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase bin\x86\WelsonJS.Toolkit.dll
%WINDIR%\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase bin\x64\WelsonJS.Toolkit.dll
rem echo [*] Registering WelsonJS Service component...
rem %WINDIR%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe bin\x86\WelsonJS.Service.exe
echo [*] Done.
cscript app.js bootstrap

20
defaultService.js Normal file
View File

@ -0,0 +1,20 @@
function main(args) {
console.log("WelsonJS.Service required.");
}
function onServiceStart() {
return "onServiceStart recevied";
}
function onServiceStop() {
return "onServiceStop recevied";
}
function onServiceElapsedTime() {
return "onServiceElapsedTime recevied";
}
exports.main = main;
exports.onServiceStart = onServiceStart;
exports.onServiceStop = onServiceStop;
exports.onServiceElapsedTime = onServiceElapsedTime;

View File

@ -18,19 +18,4 @@ function main(args) {
//Toolkit.create();
}
function onServiceStart() {
return "onServiceStart recevied";
}
function onServiceStop() {
return "onServiceStop recevied";
}
function onServiceElapsedTime() {
return "onServiceElapsedTime recevied";
}
exports.main = main;
exports.onServiceStart = onServiceStart;
exports.onServiceStop = onServiceStop;
exports.onServiceElapsedTime = onServiceElapsedTime;