Browse Source

add NSIS script for gta5view Installer

Syping 10 months ago
parent
commit
10b6222ae8
5 changed files with 273 additions and 0 deletions
  1. 1
    0
      .gitattributes
  2. 3
    0
      .travis.yml
  3. 241
    0
      .travis/gta5view.nsi
  4. 16
    0
      .travis/wininstall_build.sh
  5. 12
    0
      .travis/wininstall_travis.sh

+ 1
- 0
.gitattributes View File

@@ -15,6 +15,7 @@
15 15
 
16 16
 # Windows development files
17 17
 *.rc text eol=crlf
18
+*.nsi text eol=crlf
18 19
 *.exe.manifest text eol=crlf
19 20
 
20 21
 # Binary files

+ 3
- 0
.travis.yml View File

@@ -26,6 +26,9 @@ matrix:
26 26
     - BUILD_SCRIPT=windows_travis.sh
27 27
     - QT_SELECT=qt5-x86_64-w64-mingw32
28 28
     - EXECUTABLE_ARCH=_x64
29
+  - env:
30
+    - BUILD_SCRIPT=wininstall_travis.sh
31
+    - QT_SELECT=qt5-x86_64-w64-mingw32
29 32
   - os: osx
30 33
     env: BUILD_SCRIPT=osx_travis.sh
31 34
     

+ 241
- 0
.travis/gta5view.nsi View File

@@ -0,0 +1,241 @@
1
+######################################################################
2
+
3
+!define APP_NAME "gta5view"
4
+!define COMP_NAME "Syping"
5
+!define WEB_SITE "https://gta5view.syping.de/"
6
+!define VERSION "1.5.0.0"
7
+!define COPYRIGHT "Copyright © 2016-2018 Syping"
8
+!define DESCRIPTION "Grand Theft Auto V Savegame and Snapmatic Viewer/Editor"
9
+!define INSTALLER_NAME "gta5view_setup.exe"
10
+!define MAIN_APP_EXE "gta5view.exe"
11
+!define INSTALL_TYPE "SetShellVarContext all"
12
+!define REG_ROOT "HKLM"
13
+!define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_EXE}"
14
+!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
15
+
16
+######################################################################
17
+
18
+VIProductVersion  "${VERSION}"
19
+VIAddVersionKey "ProductName"  "${APP_NAME}"
20
+VIAddVersionKey "ProductVersion"  "${VERSION}"
21
+VIAddVersionKey "CompanyName"  "${COMP_NAME}"
22
+VIAddVersionKey "LegalCopyright"  "${COPYRIGHT}"
23
+VIAddVersionKey "FileDescription"  "${DESCRIPTION}"
24
+VIAddVersionKey "FileVersion"  "${VERSION}"
25
+
26
+######################################################################
27
+
28
+!include "x64.nsh"
29
+SetCompressor LZMA
30
+Name "${APP_NAME}"
31
+Caption "${APP_NAME}"
32
+OutFile "${INSTALLER_NAME}"
33
+#BrandingText "${APP_NAME}"
34
+XPStyle on
35
+InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
36
+InstallDir "$PROGRAMFILES64\Syping\gta5view"
37
+
38
+######################################################################
39
+
40
+!include "MUI2.nsh"
41
+
42
+!define MUI_ABORTWARNING
43
+!define MUI_UNABORTWARNING
44
+
45
+!define MUI_LANGDLL_REGISTRY_ROOT "${REG_ROOT}"
46
+!define MUI_LANGDLL_REGISTRY_KEY "${UNINSTALL_PATH}"
47
+!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
48
+
49
+!insertmacro MUI_PAGE_WELCOME
50
+
51
+!ifdef LICENSE_TXT
52
+!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
53
+!endif
54
+
55
+!insertmacro MUI_PAGE_DIRECTORY
56
+
57
+!ifdef REG_START_MENU
58
+!define MUI_STARTMENUPAGE_NODISABLE
59
+!define MUI_STARTMENUPAGE_DEFAULTFOLDER "gta5view"
60
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}"
61
+!define MUI_STARTMENUPAGE_REGISTRY_KEY "${UNINSTALL_PATH}"
62
+!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${REG_START_MENU}"
63
+!insertmacro MUI_PAGE_STARTMENU Application $SM_Folder
64
+!endif
65
+
66
+!insertmacro MUI_PAGE_INSTFILES
67
+
68
+!define MUI_FINISHPAGE_RUN "$INSTDIR\${MAIN_APP_EXE}"
69
+!insertmacro MUI_PAGE_FINISH
70
+
71
+!insertmacro MUI_UNPAGE_CONFIRM
72
+
73
+!insertmacro MUI_UNPAGE_INSTFILES
74
+
75
+!insertmacro MUI_UNPAGE_FINISH
76
+
77
+!insertmacro MUI_LANGUAGE "English"
78
+!insertmacro MUI_LANGUAGE "French"
79
+!insertmacro MUI_LANGUAGE "German"
80
+!insertmacro MUI_LANGUAGE "Russian"
81
+!insertmacro MUI_LANGUAGE "TradChinese"
82
+
83
+!insertmacro MUI_RESERVEFILE_LANGDLL
84
+
85
+######################################################################
86
+
87
+Function .onInit
88
+!insertmacro MUI_LANGDLL_DISPLAY
89
+!ifdef WIN32
90
+	MessageBox MB_OK|MB_ICONSTOP "Can't install the 64bit version on a 32bit system, please download the 32bit version!"
91
+	Quit
92
+!endif
93
+SetRegView 64
94
+FunctionEnd
95
+
96
+######################################################################
97
+
98
+Section -MainProgram
99
+${INSTALL_TYPE}
100
+SetOverwrite ifnewer
101
+SetOutPath "$INSTDIR"
102
+File "../build/release/gta5view.exe"
103
+File "/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/libgcc_s_seh-1.dll"
104
+File "/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/libstdc++-6.dll"
105
+File "/opt/windev/libressl-latest_qt64d/bin/libcrypto-42.dll"
106
+File "/opt/windev/libressl-latest_qt64d/bin/libssl-44.dll"
107
+File "/opt/windev/libjpeg-turbo-latest_qt64d/bin/libjpeg-62.dll"
108
+File "/opt/windev/qt64d-latest/bin/Qt5Core.dll"
109
+File "/opt/windev/qt64d-latest/bin/Qt5Gui.dll"
110
+File "/opt/windev/qt64d-latest/bin/Qt5Network.dll"
111
+File "/opt/windev/qt64d-latest/bin/Qt5Widgets.dll"
112
+File "/opt/windev/qt64d-latest/bin/Qt5WinExtras.dll"
113
+SetOutPath "$INSTDIR\lang"
114
+File "../res/gta5sync_en_US.qm"
115
+File "../res/gta5sync_de.qm"
116
+File "../res/gta5sync_fr.qm"
117
+File "../res/gta5sync_ru.qm"
118
+File "../res/gta5sync_zh_TW.qm"
119
+File "../res/qtbase_en_GB.qm"
120
+File "../res/qtbase_de.qm"
121
+File "../res/qtbase_fr.qm"
122
+File "../res/qtbase_ru.qm"
123
+File "../res/qtbase_zh_TW.qm"
124
+SetOutPath "$INSTDIR\platforms"
125
+File "/opt/windev/qt64d-latest/plugins/platforms/qwindows.dll"
126
+SetOutPath "$INSTDIR\imageformats"
127
+File "/opt/windev/qt64d-latest/plugins/imageformats/qjpeg.dll"
128
+SectionEnd
129
+
130
+######################################################################
131
+
132
+Section -Icons_Reg
133
+SetOutPath "$INSTDIR"
134
+WriteUninstaller "$INSTDIR\uninstall.exe"
135
+
136
+!ifdef REG_START_MENU
137
+!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
138
+CreateDirectory "$SMPROGRAMS\$SM_Folder"
139
+CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
140
+CreateShortCut "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"
141
+
142
+!ifdef WEB_SITE
143
+WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}"
144
+CreateShortCut "$SMPROGRAMS\$SM_Folder\gta5view Website.lnk" "$INSTDIR\${APP_NAME} website.url"
145
+!endif
146
+!insertmacro MUI_STARTMENU_WRITE_END
147
+!endif
148
+
149
+!ifndef REG_START_MENU
150
+CreateDirectory "$SMPROGRAMS\gta5view"
151
+CreateShortCut "$SMPROGRAMS\gta5view\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
152
+CreateShortCut "$SMPROGRAMS\gta5view\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"
153
+
154
+!ifdef WEB_SITE
155
+WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}"
156
+CreateShortCut "$SMPROGRAMS\gta5view\gta5view Website.lnk" "$INSTDIR\${APP_NAME} website.url"
157
+!endif
158
+!endif
159
+
160
+WriteRegStr ${REG_ROOT} "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
161
+WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "DisplayName" "${APP_NAME}"
162
+WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "UninstallString" "$INSTDIR\uninstall.exe"
163
+WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "DisplayIcon" "$INSTDIR\${MAIN_APP_EXE}"
164
+WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "DisplayVersion" "${VERSION}"
165
+WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "Publisher" "${COMP_NAME}"
166
+
167
+!ifdef WEB_SITE
168
+WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "URLInfoAbout" "${WEB_SITE}"
169
+!endif
170
+SectionEnd
171
+
172
+######################################################################
173
+
174
+Section Uninstall
175
+${INSTALL_TYPE}
176
+Delete "$INSTDIR\gta5view.exe"
177
+Delete "$INSTDIR\libgcc_s_seh-1.dll"
178
+Delete "$INSTDIR\libstdc++-6.dll"
179
+Delete "$INSTDIR\libcrypto-42.dll"
180
+Delete "$INSTDIR\libssl-44.dll"
181
+Delete "$INSTDIR\libjpeg-62.dll"
182
+Delete "$INSTDIR\Qt5Core.dll"
183
+Delete "$INSTDIR\Qt5Gui.dll"
184
+Delete "$INSTDIR\Qt5Network.dll"
185
+Delete "$INSTDIR\Qt5Widgets.dll"
186
+Delete "$INSTDIR\Qt5WinExtras.dll"
187
+Delete "$INSTDIR\lang\gta5sync_en_US.qm"
188
+Delete "$INSTDIR\lang\gta5sync_de.qm"
189
+Delete "$INSTDIR\lang\gta5sync_fr.qm"
190
+Delete "$INSTDIR\lang\gta5sync_ru.qm"
191
+Delete "$INSTDIR\lang\gta5sync_zh_TW.qm"
192
+Delete "$INSTDIR\lang\qtbase_en_GB.qm"
193
+Delete "$INSTDIR\lang\qtbase_de.qm"
194
+Delete "$INSTDIR\lang\qtbase_fr.qm"
195
+Delete "$INSTDIR\lang\qtbase_ru.qm"
196
+Delete "$INSTDIR\lang\qtbase_zh_TW.qm"
197
+Delete "$INSTDIR\platforms\qwindows.dll"
198
+Delete "$INSTDIR\imageformats\qjpeg.dll"
199
+
200
+RmDir "$INSTDIR\lang"
201
+RmDir "$INSTDIR\platforms"
202
+RmDir "$INSTDIR\imageformats"
203
+ 
204
+Delete "$INSTDIR\uninstall.exe"
205
+!ifdef WEB_SITE
206
+Delete "$INSTDIR\${APP_NAME} website.url"
207
+!endif
208
+
209
+RmDir "$INSTDIR"
210
+
211
+!ifdef REG_START_MENU
212
+!insertmacro MUI_STARTMENU_GETFOLDER "Application" $SM_Folder
213
+Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk"
214
+Delete "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk"
215
+!ifdef WEB_SITE
216
+Delete "$SMPROGRAMS\$SM_Folder\gta5view Website.lnk"
217
+!endif
218
+RmDir "$SMPROGRAMS\$SM_Folder"
219
+!endif
220
+
221
+!ifndef REG_START_MENU
222
+Delete "$SMPROGRAMS\gta5view\${APP_NAME}.lnk"
223
+Delete "$SMPROGRAMS\gta5view\Uninstall ${APP_NAME}.lnk"
224
+!ifdef WEB_SITE
225
+Delete "$SMPROGRAMS\gta5view\gta5view Website.lnk"
226
+!endif
227
+RmDir "$SMPROGRAMS\gta5view"
228
+!endif
229
+
230
+DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}"
231
+DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
232
+SectionEnd
233
+
234
+######################################################################
235
+
236
+Function un.onInit
237
+!insertmacro MUI_UNGETLANGUAGE
238
+SetRegView 64
239
+FunctionEnd
240
+
241
+######################################################################

+ 16
- 0
.travis/wininstall_build.sh View File

@@ -0,0 +1,16 @@
1
+#!/bin/bash
2
+
3
+apt-get update && apt-get install -y nsis && \
4
+
5
+# Creating folders
6
+cd ${PROJECT_DIR} && \
7
+echo "gta5view build version is ${APPLICATION_VERSION}" && \
8
+mkdir -p build && \
9
+mkdir -p assets && \
10
+
11
+# Starting build
12
+cd build && \
13
+qmake ${QMAKE_FLAGS} DEFINES+=GTA5SYNC_BUILDTYPE_REL "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" DEFINES+=GTA5SYNC_QCONF DEFINES+=GTA5SYNC_INLANG='\\\"RUNDIR:SEPARATOR:lang\\\"' DEFINES+=GTA5SYNC_LANG='\\\"RUNDIR:SEPARATOR:lang\\\"' DEFINES+=GTA5SYNC_PLUG='\\\"RUNDIR:SEPARATOR:plugins\\\"' ../gta5view.pro && \
14
+make -j 4 && \
15
+cd ${PROJECT_DIR}/assets && \
16
+makensis -NOCD ${PROJECT_DIR}/.travis/gta5view.nsi

+ 12
- 0
.travis/wininstall_travis.sh View File

@@ -0,0 +1,12 @@
1
+#!/bin/bash
2
+
3
+QT_VERSION=5.6.3
4
+DOCKER_IMAGE=syping/qt5-shared-mingw:${QT_VERSION}
5
+PROJECT_DIR_DOCKER=/gta5view
6
+
7
+cd ${PROJECT_DIR} && \
8
+docker pull ${DOCKER_IMAGE} && \
9
+docker run --rm \
10
+	-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
11
+	${DOCKER_IMAGE} \
12
+	/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .travis/wininstall_build.sh"