transformer.bat 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. @call "%~dp0config.bat" 0 > nul
  2. if [%1]==[] (
  3. echo Aufruf: call transformer.bat Modell[.pyi] [Anz]
  4. echo.
  5. echo Anz Anzahl der Wiederholungen
  6. goto :eof
  7. )
  8. :setup
  9. set MODELL=%~n1
  10. if [%2]==[] ( set /a MAX=2 ) else ( set /a MAX=%2+0 )
  11. set ANZAHL=0
  12. set CUBE=
  13. call teste_verzeichnis.bat %COGNOS% & if errorlevel 42 goto :eof
  14. call teste_verzeichnis.bat %PORTAL%\System\Models\%MODELL%.pyi & if errorlevel 42 goto :eof
  15. for /F "usebackq delims=" %%i in (`cubename.bat %MODELL%`) do set CUBE=%%i>nul
  16. echo.
  17. echo == Modell "%MODELL%" ==
  18. :loop
  19. if [%CUBE%]==[""] (
  20. call unlocker.bat %PORTAL%\System\Models\%MODELL%.pyi
  21. rem taskkill.exe /F /IM trnsfrmr.exe 2> nul
  22. taskkill.exe /F /IM autoexe.exe 2> nul
  23. sleep 10
  24. for /F "usebackq delims=" %%i in (`cubename.bat %MODELL%`) do set CUBE=%%i>nul
  25. )
  26. if [%CUBE%]==[""] goto error
  27. :cubefile
  28. set CUBE_TEMP="%PORTAL:~1,-1%\System\Cube_out\tasks\%CUBE:~1,-1%.mdc"
  29. set CUBE_FILE="%PORTAL:~1,-1%\System\Cube_out\%CUBE:~1,-1%.mdc"
  30. :duration
  31. %PHP%\php Tools\run.php transformer duration %TASKS%\logs\%MODELL%.log
  32. echo.
  33. set /a ANZAHL=%ANZAHL%+1
  34. if [%MAX%]==[0] (
  35. echo Erstelle Kopie, ohne Original zu ersetzen
  36. ) else (
  37. echo Aufruf %ANZAHL% von max. %MAX%
  38. )
  39. call unlocker.bat %CUBE_TEMP%
  40. del /F /S /Q %PORTAL%\System\temp\ 1> nul 2> nul
  41. :create
  42. echo * Erstelle Cube %CUBE%
  43. %PHP%\php Tools\run.php transformer create %PORTAL%\System\Models\%MODELL%.pyi
  44. if errorlevel 110 goto error
  45. if [%MAX%]==[0] (
  46. echo Cube %CUBE% in Kopie erstellt.
  47. goto end
  48. )
  49. if exist %CUBE_TEMP% goto replace
  50. echo Neue Cube-Datei nicht gefunden.
  51. :error
  52. echo !! FEHLER bei der Erstellung !!
  53. if %ANZAHL% geq %MAX% (
  54. echo Cube %CUBE% zurueckgesetzt.
  55. goto end2
  56. )
  57. :retry
  58. move /Y %PROT%\%MODELL%.log %TASKS%\logs\%MODELL%.%ANZAHL%.log 1> nul 2> nul
  59. echo Warte 60 Sekunden...
  60. sleep 60
  61. goto loop
  62. :replace
  63. call unlocker.bat %CUBE_FILE%
  64. del /F /Q %CUBE_FILE% 1> nul 2> nul
  65. if exist %CUBE_FILE% (
  66. taskkill.exe /F /IM pwrplay.exe 2> nul
  67. del /F /Q %CUBE_FILE% 1> nul 2> nul
  68. )
  69. if exist %CUBE_FILE% (
  70. echo !! Alte Cube-Datei kann nicht geloescht werden !!
  71. goto end2
  72. )
  73. move /Y %CUBE_TEMP% %CUBE_FILE% 1> nul 2> nul && echo * Alte Cube-Datei %CUBE% ersetzt.
  74. :end
  75. echo Fertiggestellt: %TIME:~0,5%
  76. :end2
  77. copy /Y %PROT%\%MODELL%.log %TASKS%\logs\%MODELL%.log 1> nul 2> nul
  78. echo.