]> git.street.me.uk Git - andy/viking.git/blame - win32/installer.bat
Some spelling fixes in a comment
[andy/viking.git] / win32 / installer.bat
CommitLineData
26edf476 1@echo OFF\r
ba3695b5 2:: License: CC0\r
59a4fc6d
RN
3::\r
4:: TODO return an error code when not completed as expected\r
5::\r
26edf476
RN
6echo STARTING INSTALLER PROCESS...\r
7\r
d07deb3f 8:: For strip\r
59a4fc6d
RN
9set PATH=%PATH%;%SystemDrive%\MinGW\bin\r
10\r
26edf476
RN
11echo Remove debugging symbols\r
12pushd ..\src\r
13strip.exe -g viking.exe\r
14popd\r
15\r
16set MYCOPY=copy /y\r
17set DESTINATION=installer\bin\r
18echo Copying locale files into layout required by NSIS\r
19dir ..\po\*.gmo /B > gmolist.txt\r
20:: Create directories like de\LC_MESSAGES\r
59a4fc6d
RN
21for /f %%i in (gmolist.txt) do mkdir %DESTINATION%\locale\%%~ni\LC_MESSAGES\r
22for /f %%i in (gmolist.txt) do %MYCOPY% ..\po\%%i %DESTINATION%\locale\%%~ni\LC_MESSAGES\viking.mo\r
26edf476
RN
23del gmolist.txt\r
24\r
ae6e6631 25echo Copying Viking\r
26edf476
RN
26%MYCOPY% ..\src\viking.exe %DESTINATION%\r
27%MYCOPY% installer\pixmaps\viking_icon.ico %DESTINATION%\r
28%MYCOPY% ..\COPYING %DESTINATION%\COPYING_GPL.txt\r
59a4fc6d
RN
29%MYCOPY% ..\AUTHORS %DESTINATION%\AUTHORS.txt\r
30%MYCOPY% ..\NEWS %DESTINATION%\NEWS.txt\r
31%MYCOPY% ..\README %DESTINATION%\README.txt\r
32:: ATM this relies on being generated by an external system\r
33%MYCOPY% cache\ChangeLog.txt %DESTINATION%\r
34:: ATM this relies on being generated by an external system\r
35%MYCOPY% ..\help\C\viking.pdf %DESTINATION%\r
be33ea12
RN
36:: Python cache converter tool\r
37%MYCOPY% ..\tools\viking-cache.py %DESTINATION%\r
59a4fc6d 38\r
ab2d70a6
RN
39echo Copying Extension Configuration Data\r
40mkdir %DESTINATION%\data\r
41%MYCOPY% ..\data\*.xml %DESTINATION%\data\r
fe559ece 42%MYCOPY% ..\data\latlontz.txt %DESTINATION%\data\r
59a4fc6d 43\r
ae6e6631 44echo Copying Libraries\r
c5d5f114 45set MINGW=%SystemDrive%\MinGW
59a4fc6d
RN
46if not exist "%MINGW%" (\r
47 echo Required %MINGW% does not exist\r
48 goto Tidy\r
49)\r
50\r
51set MINGW_BIN=%MINGW%\Bin\r
52\r
7097c6b4 53REM Curl 7.17+ has quite a few dependencies for SSL support
59a4fc6d
RN
54set LIBCURL=%MINGW_BIN%\libcurl.dll\r
55if exist "%LIBCURL%" (\r
56 %MYCOPY% "%LIBCURL%" %DESTINATION%\r
7097c6b4
RN
57 %MYCOPY% "%MINGW_BIN%\libeay32.dll" %DESTINATION%
58 %MYCOPY% "%MINGW_BIN%\librtmp.dll" %DESTINATION%
59 %MYCOPY% "%MINGW_BIN%\libssh2.dll" %DESTINATION%
60 %MYCOPY% "%MINGW_BIN%\libidn-11.dll" %DESTINATION%
61 %MYCOPY% "%MINGW_BIN%\ssleay32.dll" %DESTINATION%
62:: %MYCOPY% "%MINGW_BIN%\zlib1.dll" %DESTINATION%
59a4fc6d 63 %MYCOPY% "%MINGW%\COPYING_curl.txt" %DESTINATION%\r
ae6e6631
RN
64) else (\r
65 echo %LIBCURL% does not exist\r
66 goto Tidy\r
67)\r
59a4fc6d
RN
68set LIBEXIF=%MINGW_BIN%\libexif-12.dll\r
69if exist "%LIBEXIF%" (\r
70 %MYCOPY% "%LIBEXIF%" %DESTINATION%\r
ae6e6631 71) else (\r
59a4fc6d 72 echo Required %LIBEXIF% does not exist\r
ae6e6631
RN
73 goto Tidy\r
74)\r
003cc4e3
RN
75set LIBBZ2=%MINGW_BIN%\libbz2-2.dll\r
76if exist "%LIBBZ2%" (\r
77 %MYCOPY% "%LIBBZ2%" %DESTINATION%\r
78 %MYCOPY% "%MINGW_BIN%\libgcc_s_dw2-1.dll" %DESTINATION%\r
79) else (\r
80 echo Required %LIBBZ2% does not exist\r
81 goto Tidy\r
82)\r
498efdef
RN
83set LIBMAGIC=%MINGW_BIN%\magic1.dll\r
84if exist "%LIBMAGIC%" (\r
85 %MYCOPY% "%LIBMAGIC%" %DESTINATION%\r
86 %MYCOPY% "%MINGW_BIN%\regex2.dll" %DESTINATION%\r
87 %MYCOPY% "%MINGW%\share\misc\magic.mgc" %DESTINATION%\r
88) else (\r
89 echo Required %LIBMAGIC% does not exist\r
90 goto Tidy\r
91)\r
9412daf4
RN
92set LIBSQL3=%MINGW_BIN%\sqlite3.dll\r
93if exist "%LIBSQL3%" (\r
94 %MYCOPY% "%LIBSQL3%" %DESTINATION%\r
95) else (\r
96 echo Required %LIBSQL3% does not exist\r
97 goto Tidy\r
98)\r
7bcf4720
RN
99set LIBZIP=%MINGW_BIN%\libzip.dll\r
100if exist "%LIBZIP%" (\r
101 %MYCOPY% "%LIBZIP%" %DESTINATION%\r
102) else (\r
103 echo Required %LIBZIP% does not exist\r
104 goto Tidy\r
105)\r
59a4fc6d
RN
106\r
107:: TODO Maybe embed http://gtk-win.sourceforge.net/home/index.php/Main/EmbeddingGTK directly in NSIS?\r
108:: Best to use the same GTK version as we built against in prepare.bat!!\r
109echo =+=+=\r
110echo Checking gtk runtime\r
111echo =+=+=\r
112set GTK_RUNTIME=gtk2-runtime-2.24.10-2012-10-10-ash.exe\r
113pushd cache\r
114if not exist %GTK_RUNTIME% (\r
115 set PATH=%PATH%;%ProgramFiles%\GnuWin32\bin\r
116 wget http://downloads.sourceforge.net/gtk-win/%GTK_RUNTIME%\r
117)\r
118if not exist %GTK_RUNTIME% (\r
119 echo Required GTK Runtime does not exist\r
120 goto Tidy\r
121)\r
122:: Install GTK into temporary location so we can repackage it\r
123:: Destination path appears to have to be an absolute kind\r
124popd\r
125cd > tmp.tmp\r
126set /p PWD=<tmp.tmp\r
127del tmp.tmp\r
128cache\%GTK_RUNTIME% /sideeffects=no /setpath=no /dllpath=root /translations=no /compatdlls=yes /S /D=%PWD%\%DESTINATION%\r
129\r
f570ee2b
RN
130echo Copying GPSBabel Installer
131mkdir %DESTINATION%\Optional
c1b746db 132%MYCOPY% cache\GPSBabel-1.5.2-Setup.exe %DESTINATION%\Optional
f570ee2b
RN
133if ERRORLEVEL 1 goto Error
134
26edf476 135::\r
ae6e6631 136echo Copying Translations\r
26edf476 137%MYCOPY% installer\translations\*nsh %DESTINATION%\r
f570ee2b 138if ERRORLEVEL 1 goto Error
59a4fc6d 139\r
ae6e6631 140echo Running NSIS (command line version)\r
26edf476 141pushd installer\r
ae6e6631 142if exist "%ProgramFiles%\NSIS" (\r
0edf62b8 143 "%ProgramFiles%\NSIS\makensis.exe" /X"SetCompressor /SOLID lzma" viking-installer.nsi\r
ae6e6631
RN
144) else (\r
145 echo NSIS Not installed in known location\r
146)\r
26edf476
RN
147popd\r
148\r
f570ee2b
RN
149goto Tidy
150
151:Error
152echo Exitting due to error: %ERRORLEVEL%
153
ae6e6631 154:Tidy\r
f570ee2b 155echo Tidy Up
ae6e6631 156rmdir /S /Q %DESTINATION%\r