forked from Maplespe/ExplorerBlurMica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cmd
57 lines (48 loc) · 1.4 KB
/
build.cmd
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
49
50
51
52
53
54
55
56
57
@echo off
echo Building Mica4U...
:: Create compile directory if it doesn't exist
if not exist "compiled" (
mkdir "compiled"
:: Move or copy necessary files to compile directory if they don't exist there
if exist "Mica4U.spec" copy "Mica4U.spec" "compiled\"
if exist "installer.iss" copy "installer.iss" "compiled\"
)
:: Set working directory to compile
cd compiled
:: Ask about cleanup
set /p CLEANUP="Do you want to clean up previous builds? (Y/N): "
if /i "%CLEANUP%"=="Y" (
echo Cleaning up previous builds...
:: Clean dist folder
if exist "dist" rd /s /q "dist"
:: Clean build folder
if exist "build" rd /s /q "build"
:: Clean installer folder
if exist "installer" rd /s /q "installer"
)
:: Create PyInstaller build using spec file
echo Creating executable with PyInstaller...
pyinstaller Mica4U.spec
:: Check if PyInstaller succeeded
if %errorlevel% neq 0 (
echo PyInstaller build failed!
cd ..
pause
exit /b 1
)
:: Create installer directory
if not exist "installer" mkdir "installer"
:: Compile Inno Setup
echo Creating installer with Inno Setup...
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "installer.iss"
:: Check if Inno Setup succeeded
if %errorlevel% neq 0 (
echo Inno Setup compilation failed!
cd ..
pause
exit /b 1
)
echo Build completed successfully!
echo Installer can be found in the 'compiled\installer' directory.
cd ..
pause