firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Installation of Firebird (3, 4) with install_service.bat and blanks as servicename on Windows

Open realcolaflasche opened this issue 1 year ago • 3 comments

Hi,

installing with firebird with install_service.bat and blanks as servicename doesen't work: works: install_service.bat "123" does not work: install_service.bat "1 2 3"

Message: "2" cannot be processed syntactically at this point. (Or something like that. I'm using german windows ant translated this by deepl).

Solution: Change the install & uninstall.bat, and change the "%1" to "%~1", only the quoted passages.

install_service.bat @echo off if "%~1"=="" ( instreg install -z ) setlocal set INSTALL_SERVICE=install -z set START_SERVICE=start if not "%~1"=="" ( set INSTALL_SERVICE=%INSTALL_SERVICE% -n %1 set START_SERVICE=%START_SERVICE% -n %1 ) instsvc %INSTALL_SERVICE% instsvc %START_SERVICE% endlocal @echo. @echo Firebird installed and started as a service using @echo architecture specified in firebird.conf. @echo.

uninstall_service.bat: @echo off setlocal set REMOVE_SERVICE=remove -z set STOP_SERVICE=stop if not "%~1"=="" ( set STOP_SERVICE=%STOP_SERVICE% -n %1 set REMOVE_SERVICE=%REMOVE_SERVICE% -n %1 ) instsvc %STOP_SERVICE% instsvc %REMOVE_SERVICE% endlocal

if "%~1"=="" (instreg remove -z)

regards, Jan

realcolaflasche avatar Dec 06 '23 21:12 realcolaflasche

I'm not sure that whitespace in a service name is a good idea. Perhaps it would be better to try and reject any attempt to create such a service name.

reevespaul avatar Dec 07 '23 07:12 reevespaul

They are perfectly valid. What we should do is to deprecate instsvc and use sc instead.

aafemt avatar Dec 07 '23 10:12 aafemt

It works, we use servicenames with space since years. You have only to correct the batch files as in my 1st post discribed.

What is sc?

realcolaflasche avatar Dec 08 '23 20:12 realcolaflasche