File size: 1,383 Bytes
a79f199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
REM This is intended to be run with the .bat file directory as the working dir
if not exist make_tk_exe.bat (
    echo Missing make_tk_exe.bat in working directory
    pause
    exit
)
if not exist text2qti_tk.pyw (
    echo Missing text2qti_tk.pyw in working directory
    pause
    exit
)

REM Create and activate a conda env for packaging the .exe
call conda create -y --name make_text2qti_gui_exe python=3.9 --no-default-packages
call conda activate make_text2qti_gui_exe
REM List conda envs -- useful for debugging
call conda info --envs
REM Install dependencies
pip install bespon
pip install markdown
pip install pyinstaller
if exist ..\setup.py (
    if exist ..\text2qti (
        cd ..
        pip install .
        cd make_gui_exe
    ) else (
        pip install text2qti
    )
) else (
    pip install text2qti
)
REM Build .exe
FOR /F "tokens=* USEBACKQ" %%g IN (`python -c "import text2qti; print(text2qti.__version__)"`) do (SET "TEXT2QTI_VERSION=%%g")
pyinstaller -F --name text2qti_tk_%TEXT2QTI_VERSION% text2qti_tk.pyw
REM Deactivate and delete conda env
call conda deactivate
call conda remove -y --name make_text2qti_gui_exe --all
REM List conda envs -- useful for debugging
call conda info --envs
REM Cleanup
move dist\text2qti_tk_%TEXT2QTI_VERSION%.exe text2qti_tk_%TEXT2QTI_VERSION%.exe
rd /s /q "__pycache__"
rd /s /q "build"
rd /s /q "dist"
del *.spec
pause