-
-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathwindows-bundle.bat
More file actions
57 lines (50 loc) · 1.93 KB
/
windows-bundle.bat
File metadata and controls
57 lines (50 loc) · 1.93 KB
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
set "ROOT=%~dp0"
set "dirName=gpshell-bundle"
del /F /S /Q %dirName% > NUL
rmdir /S /Q %dirName%
mkdir %dirName%
set "gpshellZip="
set "gpshellZipName="
for /f %%f in ('dir /a /b gpshell-*.zip 2^>NUL') do (
set "gpshellZip=%%f"
set "gpshellZipName=%%f"
)
if not defined gpshellZip (
for /f %%f in ('dir /a /b "%ROOT%gpshell-*.zip" 2^>NUL') do (
set "gpshellZip=%ROOT%%%f"
set "gpshellZipName=%%f"
)
)
if not defined gpshellZip (
echo No gpshell-*.zip found in current directory or %ROOT%
exit /b 1
)
tar -xf "%gpshellZip%" -C %dirName%
tar -xf "%ROOT%zlib-1.2.8\zlib-1.2.8.zip" -C %dirName%
rem get gpshell directory
set dirNamegpshell=""
for /f %%d in ('dir /ad /b %dirName%\gpshell-*') do set "dirNamegpshell=%dirName%\%%d"
copy "%dirNamegpshell%\lib\globalplatform.dll" "%dirNamegpshell%\bin"
copy "%dirNamegpshell%\lib\gppcscconnectionplugin.dll" "%dirNamegpshell%\bin"
copy "C:\Program Files (x86)\OpenSSL-Win32\libcrypto*.dll" "%dirNamegpshell%\bin"
copy "C:\Program Files (x86)\OpenSSL-Win32\libssl*.dll" "%dirNamegpshell%\bin"
copy "C:\Program Files (x86)\OpenSSL-Win32\libeay*.dll" "%dirNamegpshell%\bin"
copy "C:\Program Files (x86)\OpenSSL-Win32\bin\legacy*.dll" "%dirNamegpshell%\bin"
copy "%ROOT%zlib-1.2.8\win32-build\zlibwapi.dll" "%dirNamegpshell%\bin"
rem copy redistributable runtime files
set curDir=%CD%
pushd "%VCToolsRedistDir%%VSCMD_ARG_TGT_ARCH%"
for /r %%a in (vcruntime*.dll) do copy "%%a" "%curDir%\%dirNamegpshell%\bin"
popd
del /F "%dirNamegpshell%\doc\CMakeLists.txt" > NUL
del /F "%dirNamegpshell%\doc\README.md" > NUL
del /F /S /Q "%dirNamegpshell%\doc\html" > NUL
rmdir /s /Q "%dirNamegpshell%\doc\html"
del /F /S /Q "%dirNamegpshell%\include" > NUL
rmdir /s /Q "%dirNamegpshell%\include"
del /F /S /Q "%dirNamegpshell%\lib" > NUL
rmdir /s /Q "%dirNamegpshell%\lib"
del /F /S /Q "%dirName%\zlib-1.2.8" > NUL
rmdir /s /Q "%dirName%\zlib-1.2.8"
tar -a -c -C "%dirNamegpshell%" -f "%dirName%\%gpshellZipName%" *