mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-11-27 10:00:57 +00:00
Service executable paths in installService.bat and uninstallService.bat now use %APPDATA% for improved portability. The setup.iss installer script updates registry keys to use the application name macro, adjusts file and icon paths to user appdata, and changes PowerShell execution flags. afterInstall.ps1 now downloads and extracts WelsonJS binary artifacts from a remote URL.
33 lines
1022 B
Batchfile
33 lines
1022 B
Batchfile
REM installService.bat
|
|
REM WelsonJS 0.2.7
|
|
REM https://github.com/gnh1201/welsonjs
|
|
@echo off
|
|
|
|
REM Set the service name
|
|
set SERVICE_NAME=WelsonJS.Service
|
|
|
|
REM Set the paths
|
|
set EXE_PATH=%APPDATA%\WelsonJS\bin\WelsonJS.Service.exe
|
|
set INSTALL_UTIL_PATH=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe
|
|
|
|
REM Uninstall the service
|
|
sc stop "%SERVICE_NAME%"
|
|
"%INSTALL_UTIL_PATH%" /u "%EXE_PATH%"
|
|
|
|
REM Install the service
|
|
"%INSTALL_UTIL_PATH%" "%EXE_PATH%"
|
|
|
|
REM Set service to auto start and add the required arguments
|
|
REM sc config "%SERVICE_NAME%" start= auto
|
|
REM sc description "%SERVICE_NAME%" "Service installed via InstallUtil.exe"
|
|
|
|
REM Add parameters to the ImagePath registry key
|
|
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\%SERVICE_NAME%" /v ImagePath /t REG_EXPAND_SZ /d "\"%EXE_PATH%\" --working-directory=\"%CURRENT_DIR%\" --script-name=defaultService" /f
|
|
|
|
echo Service "%SERVICE_NAME%" installed and configured successfully.
|
|
|
|
sc start "%SERVICE_NAME%"
|
|
echo Service "%SERVICE_NAME%" started.
|
|
|
|
pause
|