win32: Make installation packages configurable

This commit is contained in:
doyle 2021-07-30 12:03:01 +10:00
parent 413766ab4c
commit 623ab68174
2 changed files with 184 additions and 120 deletions

View File

@ -1,6 +1,8 @@
@echo off @echo off
setlocal EnableDelayedExpansion setlocal EnableDelayedExpansion
call win32_install_config.bat
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM Setup Folder Locations REM Setup Folder Locations
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
@ -77,16 +79,19 @@ REM Download & verify the tools we want for development
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM Cmder REM Cmder
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
if !install_cmder! == 1 (
set cmder_version=v1.3.16 set cmder_version=v1.3.16
set cmder_zip=!downloads_dir!\win32_cmder_!cmder_version!.7z set cmder_zip=!downloads_dir!\win32_cmder_!cmder_version!.7z
if not exist !cmder_dir! ( if not exist !cmder_dir! (
call :DownloadFile https://github.com/cmderdev/cmder/releases/download/!cmder_version!/cmder.7z "!cmder_zip!" || exit /B call :DownloadFile https://github.com/cmderdev/cmder/releases/download/!cmder_version!/cmder.7z "!cmder_zip!" || exit /B
call :Unzip "!cmder_zip!" "!cmder_dir!" || exit /B call :Unzip "!cmder_zip!" "!cmder_dir!" || exit /B
) )
)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM Dependencies (Walker) - For DLL dependency management REM Dependencies (Walker) - For DLL dependency management
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
if !install_dependency_walker! == 1 (
set dependencies_sha256=44df956dbe267e0a705224c3b85d515fee2adc87509861e24fb6c6b0ea1b86d6 set dependencies_sha256=44df956dbe267e0a705224c3b85d515fee2adc87509861e24fb6c6b0ea1b86d6
set dependencies_version=v1.10 set dependencies_version=v1.10
set dependencies_zip=!downloads_dir!\win32_dependencies_!dependencies_version!.zip set dependencies_zip=!downloads_dir!\win32_dependencies_!dependencies_version!.zip
@ -96,10 +101,12 @@ if not exist "!dependencies_dir!\DependenciesGui.exe" (
call :VerifyFileSHA256 "!dependencies_zip!" "!dependencies_sha256!" || exit /B call :VerifyFileSHA256 "!dependencies_zip!" "!dependencies_sha256!" || exit /B
call :Unzip "!dependencies_zip!" "!dependencies_dir!" || exit /B call :Unzip "!dependencies_zip!" "!dependencies_dir!" || exit /B
) )
)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM everything (void tools search program) REM everything (void tools search program)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
if !install_everything_void_tools! == 1 (
set everything_sha256=f61b601acba59d61fb0631a654e48a564db34e279b6f2cc45e20a42ce9d9c466 set everything_sha256=f61b601acba59d61fb0631a654e48a564db34e279b6f2cc45e20a42ce9d9c466
set everything_version=1.4.1.1009 set everything_version=1.4.1.1009
set everything_zip=!downloads_dir!\win32_everything_v!everything_version!.7z set everything_zip=!downloads_dir!\win32_everything_v!everything_version!.7z
@ -109,10 +116,12 @@ if not exist "!everything_dir!\everything.exe" (
call :VerifyFileSHA256 "!everything_zip!" "!everything_sha256!" || exit /B call :VerifyFileSHA256 "!everything_zip!" "!everything_sha256!" || exit /B
call :Unzip "!everything_zip!" "!everything_dir!" || exit /B call :Unzip "!everything_zip!" "!everything_dir!" || exit /B
) )
)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM GVim, Vim Plug, Vim Config REM GVim, Vim Plug, Vim Config
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
if !install_gvim! == 1 (
set gvim_zip=!downloads_dir!\win32_gvim_x64.7z set gvim_zip=!downloads_dir!\win32_gvim_x64.7z
set gvim_dir=!tools_dir!\GVim set gvim_dir=!tools_dir!\GVim
if not exist "!gvim_dir!\gvim.exe" ( if not exist "!gvim_dir!\gvim.exe" (
@ -130,10 +139,27 @@ call :DownloadFile "https://raw.githubusercontent.com/junegunn/vim-plug/master/p
set vim_clang_format=!vim_dir!\clang-format.py set vim_clang_format=!vim_dir!\clang-format.py
call :DownloadFile "https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/clang-format.py" "!vim_clang_format!" || exit /B call :DownloadFile "https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/clang-format.py" "!vim_clang_format!" || exit /B
)
REM ----------------------------------------------------------------------------
REM Joplin
REM ----------------------------------------------------------------------------
if !install_joplin! == 1 (
set joplin_sha256=1048da869657a889e27fc6c320161b806cc6e48de2d0ddaa602e92c6734f1c8c
set joplin_version=2.1.9
set joplin_dir=!tools_dir!\joplin-x64-!joplin_version!
set joplin_exe=!joplin_dir!\JoplinPortable.exe
if not exist "!joplin_exe!" (
if not exist "!joplin_dir!" mkdir "!joplin_dir!"
call :DownloadFile "https://github.com/laurent22/joplin/releases/download/v!joplin_version!/JoplinPortable.exe" "!joplin_exe!" || exit /B
)
call :VerifyFileSHA256 "!joplin_exe!" "!joplin_sha256!" || exit /B
)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM Keypirinha REM Keypirinha
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
if !install_keypirinha! == 1 (
set keypirinha_sha256=d109a16e6a5cf311abf6d06bbe5b1be3b9ba323b79c32a168628189e10f102a5 set keypirinha_sha256=d109a16e6a5cf311abf6d06bbe5b1be3b9ba323b79c32a168628189e10f102a5
set keypirinha_version=2.26 set keypirinha_version=2.26
set keypirinha_zip=!downloads_dir!\win32_keypirinha-x64-!keypirinha_version!.7z set keypirinha_zip=!downloads_dir!\win32_keypirinha-x64-!keypirinha_version!.7z
@ -144,10 +170,12 @@ if not exist "!keypirinha_dir!\keypirinha.exe" (
call :Unzip "!keypirinha_zip!" "!keypirinha_dir!" || exit /B call :Unzip "!keypirinha_zip!" "!keypirinha_dir!" || exit /B
call :Move "!keypirinha_dir!\keypirinha" "!keypirinha_dir!" || exit /B call :Move "!keypirinha_dir!\keypirinha" "!keypirinha_dir!" || exit /B
) )
)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM LLVM/Clang REM LLVM/Clang
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
if !install_llvm_clang! == 1 (
set llvm_version=12.0.1 set llvm_version=12.0.1
set llvm_zip=!downloads_dir!\win32_llvm_x64_v!llvm_version!.exe set llvm_zip=!downloads_dir!\win32_llvm_x64_v!llvm_version!.exe
set llvm_dir=!tools_dir!\llvm-!llvm_version! set llvm_dir=!tools_dir!\llvm-!llvm_version!
@ -164,6 +192,8 @@ if not exist "!llvm_dir!\bin\clang.exe" (
) )
set llvm_bin_dir=!llvm_dir!\bin set llvm_bin_dir=!llvm_dir!\bin
)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM Misc Tools REM Misc Tools
@ -179,6 +209,7 @@ call :CopyFile "!install_dir!\clang-format-style-file" "!home_dir!\_clang-format
REM ------------------------------------------------------------------------ REM ------------------------------------------------------------------------
REM MinGW64 REM MinGW64
REM ------------------------------------------------------------------------ REM ------------------------------------------------------------------------
if !install_mingw64! == 1 (
set mingw_sha256=853970527b5de4a55ec8ca4d3fd732c00ae1c69974cc930c82604396d43e79f8 set mingw_sha256=853970527b5de4a55ec8ca4d3fd732c00ae1c69974cc930c82604396d43e79f8
set mingw_version=8.1.0 set mingw_version=8.1.0
set mingw_zip=!downloads_dir!\mingw64-posix-seg-rt_v6-rev0!mingw_version!.7z set mingw_zip=!downloads_dir!\mingw64-posix-seg-rt_v6-rev0!mingw_version!.7z
@ -190,11 +221,12 @@ if not exist "!mingw_bin_dir!\gcc.exe" (
call :Unzip !mingw_zip! !mingw_dir! || exit /B call :Unzip !mingw_zip! !mingw_dir! || exit /B
call :Move !mingw_dir!\mingw64 !mingw_dir! || exit /B call :Move !mingw_dir!\mingw64 !mingw_dir! || exit /B
) )
set PATH=!working_dir!\!mingw_bin_dir!;!PATH! )
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM ProcessHacker REM ProcessHacker
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
if !install_process_hacker! == 1 (
set process_hacker_sha256=e8836365abab7478d8e4c2d3fb3bb1fce82048cd4da54bab41cacbae1f45b1ff set process_hacker_sha256=e8836365abab7478d8e4c2d3fb3bb1fce82048cd4da54bab41cacbae1f45b1ff
set process_hacker_version=3.0.4212 set process_hacker_version=3.0.4212
set process_hacker_zip=!downloads_dir!\win32_process_hacker-!process_hacker_version!.zip set process_hacker_zip=!downloads_dir!\win32_process_hacker-!process_hacker_version!.zip
@ -204,10 +236,12 @@ if not exist "!process_hacker_dir!\64bit\ProcessHacker.exe" (
call :VerifyFileSHA256 "!process_hacker_zip!" "!process_hacker_sha256!" || exit /B call :VerifyFileSHA256 "!process_hacker_zip!" "!process_hacker_sha256!" || exit /B
call :Unzip "!process_hacker_zip!" "!process_hacker_dir!" || exit /B call :Unzip "!process_hacker_zip!" "!process_hacker_dir!" || exit /B
) )
)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM Python REM Python
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
if !install_python3! == 1 (
set python_sha256=93cc3db75dffb4d56b9f64af43294f130f2c222a66de7a1325d0ce8f1ed62e26 set python_sha256=93cc3db75dffb4d56b9f64af43294f130f2c222a66de7a1325d0ce8f1ed62e26
set python_version=3.9.0.2dot set python_version=3.9.0.2dot
set python_version_nodot=3902 set python_version_nodot=3902
@ -223,10 +257,12 @@ if not exist !python_dir! (
set python_bin_dir=!python_dir!\python-!python_version_dot!.amd64 set python_bin_dir=!python_dir!\python-!python_version_dot!.amd64
set python_scripts_bin_dir=!python_bin_dir!\Scripts set python_scripts_bin_dir=!python_bin_dir!\Scripts
)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM ripgrep REM ripgrep
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
if !install_ripgrep! == 1 (
set rg_sha256=a47ace6f654c5ffa236792fc3ee3fefd9c7e88e026928b44da801acb72124aa8 set rg_sha256=a47ace6f654c5ffa236792fc3ee3fefd9c7e88e026928b44da801acb72124aa8
set rg_version=13.0.0 set rg_version=13.0.0
set rg_zip=!downloads_dir!\win32_rg_v!rg_version!.zip set rg_zip=!downloads_dir!\win32_rg_v!rg_version!.zip
@ -237,10 +273,12 @@ if not exist "!rg_dir!\rg.exe" (
call :Unzip "!rg_zip!" "!rg_dir!" || exit /B call :Unzip "!rg_zip!" "!rg_dir!" || exit /B
call :Move "!rg_dir!\ripgrep-!rg_version!-x86_64-pc-windows-msvc" "!rg_dir!" || exit /B call :Move "!rg_dir!\ripgrep-!rg_version!-x86_64-pc-windows-msvc" "!rg_dir!" || exit /B
) )
)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM Zig REM Zig
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
if !install_zig! == 1 (
set zig_sha256=8580fbbf3afb72e9b495c7f8aeac752a03475ae0bbcf5d787f3775c7e1f4f807 set zig_sha256=8580fbbf3afb72e9b495c7f8aeac752a03475ae0bbcf5d787f3775c7e1f4f807
set zig_version=0.8.0 set zig_version=0.8.0
set zig_file=zig-windows-x86_64-!zig_version!.zip set zig_file=zig-windows-x86_64-!zig_version!.zip
@ -251,6 +289,7 @@ if not exist "!zig_dir!\zig.exe" (
call :VerifyFileSHA256 "!zig_zip!" "!zig_sha256!" || exit /B call :VerifyFileSHA256 "!zig_zip!" "!zig_sha256!" || exit /B
call :Unzip "!zig_zip!" "!zig_dir!" || exit /B call :Unzip "!zig_zip!" "!zig_dir!" || exit /B
) )
)
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM Super Terminal REM Super Terminal
@ -260,28 +299,35 @@ set msvc_script=!tools_dir!\MSVC-2019-v16.9.2-VC-v14.28.29910-Win10-SDK-v10.0.19
echo @echo off> "!terminal_script!" echo @echo off> "!terminal_script!"
echo set PATH=%%~dp0!gpg_w32_bin_dir!;%%PATH%%>> "!terminal_script!" echo set PATH=%%~dp0!gpg_w32_bin_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!gvim_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!llvm_bin_dir!;%%PATH%%>> "!terminal_script!" if !install_gvim! == 1 ( echo set PATH=%%~dp0!gvim_dir!;%%PATH%%>> "!terminal_script!" )
echo set PATH=%%~dp0!mingw_bin_dir!;%%PATH%%>> "!terminal_script!" if !install_llvm_clang! == 1 ( echo set PATH=%%~dp0!llvm_bin_dir!;%%PATH%%>> "!terminal_script!" )
if !install_mingw64! == 1 ( echo set PATH=%%~dp0!mingw_bin_dir!;%%PATH%%>> "!terminal_script!" )
if !install_python3! == 1 (
echo set PATH=%%~dp0!python_bin_dir!;%%PATH%%>> "!terminal_script!" echo set PATH=%%~dp0!python_bin_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!python_scripts_bin_dir!;%%PATH%%>> "!terminal_script!" echo set PATH=%%~dp0!python_scripts_bin_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!rg_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!zig_dir!;%%PATH%%>> "!terminal_script!"
echo set PATH=%%~dp0!zip7_dir!;%%PATH%%>> "!terminal_script!"
echo set PYTHONHOME=%%~dp0!python_bin_dir!>> "!terminal_script!" echo set PYTHONHOME=%%~dp0!python_bin_dir!>> "!terminal_script!"
)
if !install_ripgrep! == 1 ( echo set PATH=%%~dp0!rg_dir!;%%PATH%%>> "!terminal_script!" )
if !install_zig! == 1 ( echo set PATH=%%~dp0!zig_dir!;%%PATH%%>> "!terminal_script!" )
echo set PATH=%%~dp0!zip7_dir!;%%PATH%%>> "!terminal_script!"
echo set HOME=%%~dp0!home_dir!>> "!terminal_script!" echo set HOME=%%~dp0!home_dir!>> "!terminal_script!"
echo set HOMEPATH=%%~dp0!home_dir!>> "!terminal_script!" echo set HOMEPATH=%%~dp0!home_dir!>> "!terminal_script!"
echo set USERPROFILE=%%~dp0!home_dir!>> "!terminal_script!" echo set USERPROFILE=%%~dp0!home_dir!>> "!terminal_script!"
echo if exist "%%~dp0!msvc_script!" call "%%~dp0!msvc_script!">> "!terminal_script!" echo if exist "%%~dp0!msvc_script!" call "%%~dp0!msvc_script!">> "!terminal_script!"
echo call "%%~dp0!cmder_dir!\cmder.exe" %%*>> "!terminal_script!"
if !install_cmder! == 1 ( echo call "%%~dp0!cmder_dir!\cmder.exe" %%*>> "!terminal_script!" )
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM Background Application Scripts REM Background Application Scripts
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
set terminal_script=!root_dir!\win32_start_background_apps.bat set terminal_script=!root_dir!\win32_start_background_apps.bat
echo @echo off> "!terminal_script!" echo @echo off> "!terminal_script!"
echo "%%~dp0!everything_dir!\everything.exe">> "!terminal_script!" if !install_everything_void_tools! == 1 echo "%%~dp0!everything_dir!\everything.exe">> "!terminal_script!"
echo "%%~dp0!keypirinha_dir!\keypirinha.exe">> "!terminal_script!" if !install_keypirinha! == 1 echo "%%~dp0!keypirinha_dir!\keypirinha.exe">> "!terminal_script!"
REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------
REM CTags Helper Script REM CTags Helper Script

18
win32_install_config.bat Normal file
View File

@ -0,0 +1,18 @@
@echo off
REM ----------------------------------------------------------------------------
REM Installation Configuration
REM ----------------------------------------------------------------------------
REM Set the 0 or 1 to enable or disable installation of a package
set install_cmder=1
set install_dependency_walker=1
set install_everything_void_tools=1
set install_gvim=1
set install_joplin=1
set install_keypirinha=1
set install_llvm_clang=1
set install_mingw64=1
set install_process_hacker=1
set install_python3=1
set install_ripgrep=1
set install_zig=1