Files
dvc/build_windows.cmd
T
Ruslan Kuprieiev 5b810fed99 build: create standalone binary with WinPython
Recent changes for building standalone dvc binary on Linux
made it possible to do the same thing on Windows. So now
we are getting rid of WinPython and instead building
standalone dvc binary using PyInstall and packaing it
into an installer with InnoSetup.

One of the benefits is dramatically decreased installer size.
From 125M we got to only 13M!

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-06-02 12:53:25 -07:00

36 lines
1.1 KiB
Batchfile

@echo Off
echo ====== Starting to build dvc installer for Windows... ======
rmdir /Q /S build
rmdir /Q /S dist
del /Q /S dvc.spec
del /Q /S "dvc-*.exe"
where pip
if %errorlevel% neq 0 (echo Error: pip not found && goto :error)
if not exist "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" (echo Error: Couldn't find Inno Setup compiler. Please go to jrsoftware.org/isinfo.php and install Inno Setup 5 && goto :error)
echo ====== Installing requirements... ======
call pip install -r requirements.txt || goto :error
call pip install pyinstaller || goto :error
echo ====== Building dvc binary... ======
call pyinstaller --onefile --additional-hooks-dir hooks dvc/__main__.py --name dvc --specpath build
echo ====== Copying additional files... ======
copy innosetup\addSymLinkPermissions.ps1 dist\ || goto :error
echo ====== Building dvc installer... ======
set PYTHONPATH=%cd%
call python innosetup\config_gen.py || goto :error
call "C:\Program Files (x86)\Inno Setup 5\iscc" innosetup\setup.iss || goto :error
echo ====== DONE ======
goto :EOF
:error
echo ====== FAIL ======
exit /b 1