I try to execute a batch file after setup finishes.
Filename: "{cmd}"; Parameters: "/C ""{app}\Start.bat"""; \
Description: {cm:LaunchAfterInstallQuest_lbl}; \
Flags: nowait postinstall skipifsilent shellexec;
The batch file start.bat
is requesting administrative privileges and starts two services.
@if (1==1) @if(1==0) @ELSE
@echo off&SETLOCAL ENABLEEXTENSIONS
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"||(
cscript //E:JScript //nologo "%~f0"
@goto :EOF
)
REM --> start services
set error=0
set date=%date%_%time:~0,2%-%time:~3,2%-%time:~6,2%
net start "SMC Integrationsserver" 2>>"%~dp0logfile_start_%date%.txt"
IF ERRORLEVEL 1 ( set error=1 )
net start "Wildfly" 2>>"%~dp0logfile_start_%date%.txt"
IF ERRORLEVEL 1 ( set error=1 )
if %error%==1 (
echo Ein Fehler trat auf, bitte pruefen Sie die Logdatei "%~dp0logfile_start_%date%.txt"
pause
@goto :EOF
)
if %error%==0 (
del /s /q "%~dp0logfile_*.txt"
)
@goto :EOF
@end @ELSE
ShA=new ActiveXObject("Shell.Application")
ShA.ShellExecute("cmd.exe","/c \""+WScript.ScriptFullName+"\"","","runas",1);
@end
When I click Finish in the setup installer, the start.bat
file is executing in a infinite loop.
Any ideas what's wrong with it?