1@ECHO OFF
2
3SETLOCAL
4
5SET MYDIR=%~dp0
6SET EXITCODE=0
7
8ECHO. * creating EventGhost plugin
9SET EGSOURCES=%MYDIR%..\build\EventGhost\egplugin_sources
10RMDIR /s /q "%MYDIR%..\build\EventGhost" >nul 2>&1
11MKDIR "%MYDIR%..\build\EventGhost"
12
13XCOPY /E /I "%MYDIR%..\src\eventghost\egplugin_sources" "%EGSOURCES%" >nul
14
15COPY "%MYDIR%..\build\x86\python\cec\_cec.pyd" "%EGSOURCES%\PulseEight" >nul
16COPY "%MYDIR%..\build\x86\cec.dll" "%EGSOURCES%\PulseEight" >nul
17
18COPY "%MYDIR%..\build\x86\python\cec\__init__.py" "%EGSOURCES%\PulseEight\cec" >nul
19
20PowerShell -ExecutionPolicy ByPass -Command "Add-Type -Assembly System.IO.Compression.FileSystem;[System.IO.Compression.ZipFile]::CreateFromDirectory('%EGSOURCES%\', '%EGSOURCES%\..\pulse_eight.egplugin', [System.IO.Compression.CompressionLevel]::Optimal, $false)"
21
22DEL /q /f "%EGSOURCES%" >nul 2>&1
23
24IF NOT EXIST "%EGSOURCES%\..\pulse_eight.egplugin" (
25  ECHO. *** failed to create EventGhost plugin ***
26  SET EXITCODE=1
27  GOTO EXIT
28)
29
30exit /b %EXITCODE%
31