]> sigrok.org Git - sigrok-gtk.git/blame - contrib/sigrok-gtk.nsi.in
nsis: One installer file per frontend.
[sigrok-gtk.git] / contrib / sigrok-gtk.nsi.in
CommitLineData
9fb595e4
UH
1##
2## This file is part of the sigrok project.
3##
4## Copyright (C) 2011-2012 Uwe Hermann <uwe@hermann-uwe.de>
5##
6## This program is free software; you can redistribute it and/or modify
7## it under the terms of the GNU General Public License as published by
8## the Free Software Foundation; either version 2 of the License, or
9## (at your option) any later version.
10##
11## This program is distributed in the hope that it will be useful,
12## but WITHOUT ANY WARRANTY; without even the implied warranty of
13## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14## GNU General Public License for more details.
15##
16## You should have received a copy of the GNU General Public License
17## along with this program; if not, write to the Free Software
18## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19##
20
21#
22# This file is used to create the sigrok-gtk Windows installer via NSIS.
23#
24# NSIS documentation:
25# http://nsis.sourceforge.net/Docs/
26# http://nsis.sourceforge.net/Docs/Modern%20UI%202/Readme.html
27#
28
29# Include the "Modern UI" header, which gives us the usual Windows look-n-feel.
30!include "MUI2.nsh"
31
32
33# --- Global stuff ------------------------------------------------------------
34
35# Installer/product name.
36Name "@PACKAGE_NAME@"
37
38# Filename of the installer executable.
39OutFile "@PACKAGE_NAME@-installer-@PACKAGE_VERSION@.exe"
40
41# Where to install the application.
42InstallDir "$PROGRAMFILES\sigrok\@PACKAGE_NAME@"
43
44# Request application privileges for Windows Vista.
45RequestExecutionLevel user
46
47
48# --- MUI interface configuration ---------------------------------------------
49
50# Use the following icon for the installer EXE file.
51!define MUI_ICON "sigrok-logo-notext.ico"
52
53# Show a nice image at the top of each installer page.
54!define MUI_HEADERIMAGE
55
56# Don't automatically go to the Finish page so the user can check the log.
57!define MUI_FINISHPAGE_NOAUTOCLOSE
58
59# Upon "cancel", ask the user if he really wants to abort the installer.
60!define MUI_ABORTWARNING
61
62# Don't force the user to accept the license, just show it.
63# Details: http://trac.videolan.org/vlc/ticket/3124
64!define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
65!define MUI_LICENSEPAGE_TEXT_BOTTOM "Click Next to continue."
66
67# File name of the Python installer MSI file.
68!define PY_INST "python-3.2.2.msi"
69
70# Standard install path of the Python installer (do not change!).
71!define PY_BIN "c:\Python32"
72
73
74# --- MUI pages ---------------------------------------------------------------
75
76# Show a nice "Welcome to the ... Setup Wizard" page.
77!insertmacro MUI_PAGE_WELCOME
78
79# Show the license of the project.
80!insertmacro MUI_PAGE_LICENSE "..\COPYING"
81
82# Show a screen which allows the user to select which components to install.
83!insertmacro MUI_PAGE_COMPONENTS
84
85# Allow the user to select a different install directory.
86!insertmacro MUI_PAGE_DIRECTORY
87
88# Perform the actual installation, i.e. install the files.
89!insertmacro MUI_PAGE_INSTFILES
90
91# Show a final "We're done, click Finish to close this wizard" message.
92!insertmacro MUI_PAGE_FINISH
93
94# Pages used for the uninstaller.
95!insertmacro MUI_UNPAGE_WELCOME
96!insertmacro MUI_UNPAGE_CONFIRM
97!insertmacro MUI_UNPAGE_INSTFILES
98!insertmacro MUI_UNPAGE_FINISH
99
100
101# --- MUI language files ------------------------------------------------------
102
103# Select an installer language (required!).
104!insertmacro MUI_LANGUAGE "English"
105
106
107# --- Default section ---------------------------------------------------------
108
109Section "@PACKAGE_NAME@ (required)" Section1
110
111 # This section is gray (can't be disabled) in the component list.
112 SectionIn RO
113
114 # Install the file(s) specified below into the specified directory.
115 SetOutPath "$INSTDIR"
116
117 # License file
118 File "..\COPYING"
119
120 # sigrok libs
121 File "c:\MinGW\msys\1.0\local\lib\libsigrok.a"
122 File "c:\MinGW\msys\1.0\local\lib\libsigrokdecode.a"
123
124 # sigrok-gtk
125 File "c:\MinGW\msys\1.0\local\bin\@PACKAGE_NAME@.exe"
126
127 # MinGW libs
128 File "c:\MinGW\bin\mingwm10.dll"
129 File "c:\MinGW\bin\libgcc_s_dw2-1.dll"
130 File "c:\MinGW\bin\intl.dll"
131 File "c:\MinGW\bin\libiconv-2.dll"
132 File "c:\MinGW\bin\libstdc++-6.dll"
133
134 # External libs
135 File "c:\MinGW\msys\1.0\local\bin\libglib-2.0-0.dll"
136 File "c:\MinGW\msys\1.0\local\bin\libgthread-2.0-0.dll"
137 File "c:\MinGW\msys\1.0\local\bin\libusb-1.0.dll"
138 File "c:\MinGW\msys\1.0\local\bin\zlib1.dll"
139 File "c:\MinGW\msys\1.0\local\bin\libzip-2.dll"
140 File "c:\MinGW\msys\1.0\local\bin\libusb0.dll"
141 File "c:\MinGW\msys\1.0\local\bin\libftdi.dll"
142
143 # GTK+ libs
144 File "c:\MinGW\msys\1.0\local\bin\freetype6.dll"
145 File "c:\MinGW\msys\1.0\local\bin\libatk-*.dll"
146 File "c:\MinGW\msys\1.0\local\bin\libcairo-*.dll"
147 File "c:\MinGW\msys\1.0\local\bin\libfontconfig-*.dll"
148 File "c:\MinGW\msys\1.0\local\bin\libgdk_pixbuf-*.dll"
149 File "c:\MinGW\msys\1.0\local\bin\libgdk-win32-*.dll"
150 File "c:\MinGW\msys\1.0\local\bin\libgio-*.dll"
151 File "c:\MinGW\msys\1.0\local\bin\libgmodule-*.dll"
152 File "c:\MinGW\msys\1.0\local\bin\libgobject-*.dll"
153 File "c:\MinGW\msys\1.0\local\bin\libgtk-win32-*.dll"
154 File "c:\MinGW\msys\1.0\local\bin\libpango-*.dll"
155 File "c:\MinGW\msys\1.0\local\bin\libpangocairo-*.dll"
156 File "c:\MinGW\msys\1.0\local\bin\libpangoft2-*.dll"
157 File "c:\MinGW\msys\1.0\local\bin\libpangowin32-*.dll"
158 File "c:\MinGW\msys\1.0\local\bin\libpng*.dll"
159 File "c:\MinGW\msys\1.0\local\bin\libexpat-*.dll"
160
161 # Install the file(s) specified below into the specified directory.
162 SetOutPath "$INSTDIR\decoders"
163
164 # Protocol decoders
165 File /r /x "__pycache__" \
166 "c:\MinGW\msys\1.0\local\share\libsigrokdecode\decoders\*"
167
168 # Generate the uninstaller executable.
169 WriteUninstaller "$INSTDIR\Uninstall.exe"
170
171 # Create a sub-directory in the start menu.
172 CreateDirectory "$SMPROGRAMS\sigrok"
173 CreateDirectory "$SMPROGRAMS\sigrok\@PACKAGE_NAME@"
174
175 # Create a shortcut for the GTK+ GUI application.
176 CreateShortCut \
177 "$SMPROGRAMS\sigrok\@PACKAGE_NAME@\sigrok GTK+ GUI.lnk" \
178 "$INSTDIR\@PACKAGE_NAME@.exe" "" \
179 "$INSTDIR\@PACKAGE_NAME@.exe" 0 SW_SHOWNORMAL \
180 "" "Open-source, portable logic analyzer software"
181
182 # Create a shortcut for the uninstaller.
183 CreateShortCut "$SMPROGRAMS\sigrok\@PACKAGE_NAME@\Uninstall.lnk" \
184 "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 \
185 SW_SHOWNORMAL "" "Uninstall @PACKAGE_NAME@"
186
187SectionEnd
188
189
190# --- Python installer section ------------------------------------------------
191
192Section "Python" Section2
193
194 # Copy the Python installer MSI file into the temporary directory.
195 SetOutPath "$TEMP"
196 File "c:\${PY_INST}"
197
198 # Run the Python installer MSI file from within our installer.
199 ExecWait '"msiexec" /i "$TEMP\${PY_INST}" /QB- /passive ALLUSERS=1'
200
201 # Remove Python installer MSI file again.
202 Delete "$TEMP\${PY_INST}"
203
204SectionEnd
205
206
207# --- Uninstaller section -----------------------------------------------------
208
209Section "Uninstall"
210
211 # Always delete the uninstaller first (yes, this really works).
212 Delete "$INSTDIR\Uninstall.exe"
213
214 # Delete the application, the application data, and related libs.
215 Delete "$INSTDIR\COPYING"
216 Delete "$INSTDIR\libsigrok.a"
217 Delete "$INSTDIR\libsigrokdecode.a"
218 Delete "$INSTDIR\sigrok-gtk.exe"
219 Delete "$INSTDIR\mingwm10.dll"
220 Delete "$INSTDIR\libgcc_s_dw2-1.dll"
221 Delete "$INSTDIR\intl.dll"
222 Delete "$INSTDIR\libiconv-2.dll"
223 Delete "$INSTDIR\libstdc++-6.dll"
224 Delete "$INSTDIR\libglib-2.0-0.dll"
225 Delete "$INSTDIR\libgthread-2.0-0.dll"
226 Delete "$INSTDIR\libusb-1.0.dll"
227 Delete "$INSTDIR\zlib1.dll"
228 Delete "$INSTDIR\libzip-2.dll"
229 Delete "$INSTDIR\libusb0.dll"
230 Delete "$INSTDIR\libftdi.dll"
231 Delete "$INSTDIR\freetype6.dll"
232 Delete "$INSTDIR\libatk-*.dll"
233 Delete "$INSTDIR\libcairo-*.dll"
234 Delete "$INSTDIR\libfontconfig-*.dll"
235 Delete "$INSTDIR\libgdk_pixbuf-*.dll"
236 Delete "$INSTDIR\libgdk-win32-*.dll"
237 Delete "$INSTDIR\libgio-*.dll"
238 Delete "$INSTDIR\libgmodule-*.dll"
239 Delete "$INSTDIR\libgobject-*.dll"
240 Delete "$INSTDIR\libgtk-win32-*.dll"
241 Delete "$INSTDIR\libpango-*.dll"
242 Delete "$INSTDIR\libpangocairo-*.dll"
243 Delete "$INSTDIR\libpangoft2-*.dll"
244 Delete "$INSTDIR\libpangowin32-*.dll"
245 Delete "$INSTDIR\libpng*.dll"
246 Delete "$INSTDIR\libexpat-*.dll"
247
248 # Delete all decoders and everything else in decoders/.
249 # There could be *.pyc files or __pycache__ subdirs and so on.
250 RMDir /r "$INSTDIR\decoders\*"
251
252 # Delete the install directory and its sub-directories.
253 RMDir "$INSTDIR\decoders"
254 RMDir "$INSTDIR"
255
256 # Delete the links from the start menu.
257 Delete "$SMPROGRAMS\sigrok\@PACKAGE_NAME@\sigrok GTK+ GUI.lnk"
258 Delete "$SMPROGRAMS\sigrok\@PACKAGE_NAME@\Uninstall.lnk"
259
260 # Delete the sub-directory in the start menu.
261 RMDir "$SMPROGRAMS\sigrok\@PACKAGE_NAME@"
262 RMDir "$SMPROGRAMS\sigrok"
263
264SectionEnd
265
266
267# --- Component selection section descriptions --------------------------------
268
269LangString DESC_Section1 ${LANG_ENGLISH} "This installs the sigrok GTK+ GUI, the protocol decoders, and all required libraries."
270LangString DESC_Section2 ${LANG_ENGLISH} "This installs Python 3.2 in its default location of c:\Python32. If you already have Python 3.2 installed, you don't need to re-install it."
271
272!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
273!insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
274!insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
275!insertmacro MUI_FUNCTION_DESCRIPTION_END
276