forked from baoboa/pyqt5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PyQt5-Qt5.nsi
627 lines (496 loc) · 22.7 KB
/
PyQt5-Qt5.nsi
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
# PyQt5 NSIS installer script.
#
# Copyright (c) 2016 Riverbank Computing Limited <[email protected]>
#
# This file is part of PyQt5.
#
# This file may be used under the terms of the GNU General Public License
# version 3.0 as published by the Free Software Foundation and appearing in
# the file LICENSE included in the packaging of this file. Please review the
# following information to ensure the GNU General Public License version 3.0
# requirements will be met: http://www.gnu.org/copyleft/gpl.html.
#
# If you do not wish to use this file under the terms of the GPL version 3.0
# then you may purchase a commercial license. For more information contact
#
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
# These will change with different releases.
!define PYQT_VERSION "5.6"
!define PYQT_INSTALLER ""
#!define PYQT_INSTALLER "-2"
!define PYQT_LICENSE "GPL"
!define PYQT_LICENSE_LC "gpl"
!define PYQT_PYTHON_MAJOR "3"
!define PYQT_PYTHON_MINOR "5"
!define PYQT_ARCH "64"
!define PYQT_QT_VERS "5.6.0"
!define PYQT_QT_DOC_VERS "5"
# These are all derived from the above.
!define PYQT_PYTHON_DIR "C:\Python${PYQT_PYTHON_MAJOR}${PYQT_PYTHON_MINOR}"
!define PYQT_PYTHON_VERS "${PYQT_PYTHON_MAJOR}.${PYQT_PYTHON_MINOR}"
!define PYQT_PYTHON_HK "Software\Python\PythonCore\${PYQT_PYTHON_VERS}\InstallPath"
!define PYQT_PYTHON_HK_ARCH "Software\Python\PythonCore\${PYQT_PYTHON_VERS}-${PYQT_ARCH}\InstallPath"
!define PYQT_NAME "PyQt ${PYQT_LICENSE} v${PYQT_VERSION} for Python v${PYQT_PYTHON_VERS} (x${PYQT_ARCH})"
!define PYQT_HK_ROOT "Software\PyQt5\Py${PYQT_PYTHON_VERS}"
!define PYQT_HK "${PYQT_HK_ROOT}\InstallPath"
!define PYQT4_HK "Software\PyQt4\Py${PYQT_PYTHON_VERS}\InstallPath"
!define QT_SRC_DIR "C:\Qt\${PYQT_QT_VERS}"
!define ICU_SRC_DIR "C:\icu"
!define OPENSSL_SRC_DIR "C:\OpenSSL"
!define MYSQL_SRC_DIR "C:\MySQL"
!define REDIST_DIR "C:\Redist"
# Include the tools we use.
!include MUI2.nsh
!include LogicLib.nsh
!include AddToPath.nsh
!include StrSlash.nsh
# Tweak some of the standard pages.
!define MUI_WELCOMEPAGE_TEXT \
"This wizard will guide you through the installation of ${PYQT_NAME}.$\r$\n\
$\r$\n\
This copy of PyQt includes a subset of Qt v${PYQT_QT_VERS} Open Source \
Edition needed by PyQt. It also includes MySQL, ODBC, PostgreSQL and SQLite \
drivers and the required OpenSSL DLLs.$\r$\n\
$\r$\n\
Any code you write must be released under a license that is compatible with \
the GPL.$\r$\n\
$\r$\n\
Click Next to continue."
!define MUI_FINISHPAGE_LINK "Get the latest news of PyQt here"
!define MUI_FINISHPAGE_LINK_LOCATION "http://www.riverbankcomputing.com"
# Define the product name and installer executable.
Name "PyQt"
Caption "${PYQT_NAME} Setup"
OutFile "PyQt5-${PYQT_VERSION}-${PYQT_LICENSE_LC}-Py${PYQT_PYTHON_MAJOR}.${PYQT_PYTHON_MINOR}-Qt${PYQT_QT_VERS}-x${PYQT_ARCH}${PYQT_INSTALLER}.exe"
# This is done (along with the use of SetShellVarContext) so that we can remove
# the shortcuts when uninstalling under Vista and Windows 7. Note that we
# don't actually check if it is successful.
RequestExecutionLevel admin
# The different installation types. "Full" is everything. "Minimal" is the
# runtime environment.
InstType "Full"
InstType "Minimal"
# Maximum compression.
SetCompressor /SOLID lzma
# We want the user to confirm they want to cancel.
!define MUI_ABORTWARNING
Function .onInit
${If} ${PYQT_ARCH} == "64"
SetRegView 64
${Endif}
# Check if there is already a version of PyQt4 installed for this version
# of Python.
ReadRegStr $0 HKCU "${PYQT4_HK}" ""
${If} $0 == ""
ReadRegStr $0 HKLM "${PYQT4_HK}" ""
${Endif}
${If} $0 != ""
MessageBox MB_OK \
"A copy of PyQt4 for Python v${PYQT_PYTHON_VERS} is already installed in $0 \
and must be uninstalled first."
Abort
${Endif}
# Check if there is already a version of PyQt5 installed for this version
# of Python.
ReadRegStr $0 HKCU "${PYQT_HK}" ""
${If} $0 == ""
ReadRegStr $0 HKLM "${PYQT_HK}" ""
${Endif}
${If} $0 != ""
MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONQUESTION \
"A copy of PyQt5 for Python v${PYQT_PYTHON_VERS} is already installed in $0 \
and should be uninstalled first.$\r$\n \
$\r$\n\
Do you wish to uninstall it?" IDYES Uninstall
Abort
Uninstall:
ExecWait '"$0\Lib\site-packages\PyQt5\Uninstall.exe" /S'
${Endif}
# Check the right version of Python has been installed. Different versions
# of Python use different formats for the version number.
ReadRegStr $INSTDIR HKCU "${PYQT_PYTHON_HK}" ""
${If} $INSTDIR == ""
ReadRegStr $INSTDIR HKCU "${PYQT_PYTHON_HK_ARCH}" ""
${If} $INSTDIR == ""
ReadRegStr $INSTDIR HKLM "${PYQT_PYTHON_HK}" ""
${If} $INSTDIR == ""
ReadRegStr $INSTDIR HKLM "${PYQT_PYTHON_HK_ARCH}" ""
${Endif}
${Endif}
${Endif}
${If} $INSTDIR == ""
MessageBox MB_YESNO|MB_ICONQUESTION \
"This copy of PyQt has been built against Python v${PYQT_PYTHON_VERS} \
(x${PYQT_ARCH}) which doesn't seem to be installed.$\r$\n\
$\r$\n\
Do you wish to continue with the installation?" IDYES GotPython
Abort
GotPython:
StrCpy $INSTDIR "${PYQT_PYTHON_DIR}"
${Endif}
FunctionEnd
# Define the different pages.
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE ".\LICENSE"
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Python installation folder"
!define MUI_DIRECTORYPAGE_TEXT_TOP \
"PyQt will be installed in the site-packages folder of your Python \
installation."
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Other settings.
!insertmacro MUI_LANGUAGE "English"
# Installer sections.
Section "Extension modules" SecModules
SectionIn 1 2 RO
SetOverwrite on
# We have to take the SIP files from where they should have been installed.
SetOutPath $INSTDIR\Lib\site-packages
File "${PYQT_PYTHON_DIR}\Lib\site-packages\sip.pyd"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File .\LICENSE
File .\__init__.py
File /r .\pyuic\uic
File .\build\Qt\Qt.pyd
File .\build\QtCore\QtCore.pyd
File .\build\QtDesigner\QtDesigner.pyd
File .\build\QtGui\QtGui.pyd
File .\build\QtHelp\QtHelp.pyd
File .\build\QtLocation\QtLocation.pyd
File .\build\QtMultimedia\QtMultimedia.pyd
File .\build\QtMultimediaWidgets\QtMultimediaWidgets.pyd
File .\build\QtNetwork\QtNetwork.pyd
File .\build\QtOpenGL\QtOpenGL.pyd
File .\build\QtPositioning\QtPositioning.pyd
File .\build\QtPrintSupport\QtPrintSupport.pyd
File .\build\QtQml\QtQml.pyd
File .\build\QtQuick\QtQuick.pyd
File .\build\QtQuickWidgets\QtQuickWidgets.pyd
File .\build\QtSensors\QtSensors.pyd
File .\build\QtSerialPort\QtSerialPort.pyd
File .\build\QtSql\QtSql.pyd
File .\build\QtSvg\QtSvg.pyd
File .\build\QtTest\QtTest.pyd
File .\build\QtWebChannel\QtWebChannel.pyd
File .\build\QtWebEngineCore\QtWebEngineCore.pyd
File .\build\QtWebEngineWidgets\QtWebEngineWidgets.pyd
File .\build\QtWebSockets\QtWebSockets.pyd
File .\build\QtWinExtras\QtWinExtras.pyd
File .\build\QtWidgets\QtWidgets.pyd
File .\build\QtXml\QtXml.pyd
File .\build\QtXmlPatterns\QtXmlPatterns.pyd
File .\build\QAxContainer\QAxContainer.pyd
File .\build\_QOpenGLFunctions_2_0\_QOpenGLFunctions_2_0.pyd
File .\build\_QOpenGLFunctions_2_1\_QOpenGLFunctions_2_1.pyd
File .\build\_QOpenGLFunctions_4_1_Core\_QOpenGLFunctions_4_1_Core.pyd
SectionEnd
Section "QScintilla" SecQScintilla
SectionIn 1
SetOverwrite on
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File "${PYQT_PYTHON_DIR}\Lib\site-packages\PyQt5\Qsci.pyd"
File /r "${QT_SRC_DIR}\qsci"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File "${QT_SRC_DIR}\lib\qscintilla2.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\translations
File "${QT_SRC_DIR}\translations\qscintilla*.qm"
SectionEnd
Section "Qt runtime" SecQt
SectionIn 1 2
SetOverwrite on
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\PyQt5
File .\build\qmlscene\release\pyqt5qmlplugin.dll
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File "${QT_SRC_DIR}\bin\qmlscene.exe"
File "${QT_SRC_DIR}\bin\Qt5CLucene.dll"
File "${QT_SRC_DIR}\bin\Qt5Core.dll"
File "${QT_SRC_DIR}\bin\Qt5Designer.dll"
File "${QT_SRC_DIR}\bin\Qt5DesignerComponents.dll"
File "${QT_SRC_DIR}\bin\Qt5Gui.dll"
File "${QT_SRC_DIR}\bin\Qt5Help.dll"
File "${QT_SRC_DIR}\bin\Qt5Location.dll"
File "${QT_SRC_DIR}\bin\Qt5Multimedia.dll"
File "${QT_SRC_DIR}\bin\Qt5MultimediaQuick_p.dll"
File "${QT_SRC_DIR}\bin\Qt5MultimediaWidgets.dll"
File "${QT_SRC_DIR}\bin\Qt5Network.dll"
File "${QT_SRC_DIR}\bin\Qt5OpenGL.dll"
File "${QT_SRC_DIR}\bin\Qt5Positioning.dll"
File "${QT_SRC_DIR}\bin\Qt5PrintSupport.dll"
File "${QT_SRC_DIR}\bin\Qt5Qml.dll"
File "${QT_SRC_DIR}\bin\Qt5Quick.dll"
File "${QT_SRC_DIR}\bin\Qt5QuickParticles.dll"
File "${QT_SRC_DIR}\bin\Qt5QuickWidgets.dll"
File "${QT_SRC_DIR}\bin\Qt5Sensors.dll"
File "${QT_SRC_DIR}\bin\Qt5SerialPort.dll"
File "${QT_SRC_DIR}\bin\Qt5Sql.dll"
File "${QT_SRC_DIR}\bin\Qt5Svg.dll"
File "${QT_SRC_DIR}\bin\Qt5Test.dll"
File "${QT_SRC_DIR}\bin\Qt5WebChannel.dll"
File "${QT_SRC_DIR}\bin\Qt5WebEngineCore.dll"
File "${QT_SRC_DIR}\bin\Qt5WebEngineWidgets.dll"
File "${QT_SRC_DIR}\bin\Qt5WebSockets.dll"
File "${QT_SRC_DIR}\bin\Qt5Widgets.dll"
File "${QT_SRC_DIR}\bin\Qt5WinExtras.dll"
File "${QT_SRC_DIR}\bin\Qt5Xml.dll"
File "${QT_SRC_DIR}\bin\Qt5XmlPatterns.dll"
File "${QT_SRC_DIR}\bin\QtWebEngineProcess.exe"
File "${QT_SRC_DIR}\bin\libEGL.dll"
File "${QT_SRC_DIR}\bin\libGLESv2.dll"
File "${ICU_SRC_DIR}\bin\icudt55.dll"
File "${ICU_SRC_DIR}\bin\icuin55.dll"
File "${ICU_SRC_DIR}\bin\icuuc55.dll"
File "${OPENSSL_SRC_DIR}\bin\libeay32.dll"
File "${OPENSSL_SRC_DIR}\bin\ssleay32.dll"
File "${MYSQL_SRC_DIR}\lib\libmysql.dll"
File "${REDIST_DIR}\msvcp140.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File /r "${QT_SRC_DIR}\qml"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\audio
File "${QT_SRC_DIR}\plugins\audio\qtaudio_windows.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\bearer
File "${QT_SRC_DIR}\plugins\bearer\qgenericbearer.dll"
File "${QT_SRC_DIR}\plugins\bearer\qnativewifibearer.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\geoservices
File "${QT_SRC_DIR}\plugins\geoservices\qtgeoservices_mapbox.dll"
File "${QT_SRC_DIR}\plugins\geoservices\qtgeoservices_nokia.dll"
File "${QT_SRC_DIR}\plugins\geoservices\qtgeoservices_osm.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\iconengines
File "${QT_SRC_DIR}\plugins\iconengines\qsvgicon.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\imageformats
File "${QT_SRC_DIR}\plugins\imageformats\qdds.dll"
File "${QT_SRC_DIR}\plugins\imageformats\qgif.dll"
File "${QT_SRC_DIR}\plugins\imageformats\qicns.dll"
File "${QT_SRC_DIR}\plugins\imageformats\qico.dll"
File "${QT_SRC_DIR}\plugins\imageformats\qjpeg.dll"
File "${QT_SRC_DIR}\plugins\imageformats\qsvg.dll"
File "${QT_SRC_DIR}\plugins\imageformats\qtga.dll"
File "${QT_SRC_DIR}\plugins\imageformats\qtiff.dll"
File "${QT_SRC_DIR}\plugins\imageformats\qwbmp.dll"
File "${QT_SRC_DIR}\plugins\imageformats\qwebp.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\mediaservice
File "${QT_SRC_DIR}\plugins\mediaservice\dsengine.dll"
File "${QT_SRC_DIR}\plugins\mediaservice\qtmedia_audioengine.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\platforms
File "${QT_SRC_DIR}\plugins\platforms\qminimal.dll"
File "${QT_SRC_DIR}\plugins\platforms\qoffscreen.dll"
File "${QT_SRC_DIR}\plugins\platforms\qwindows.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\playlistformats
File "${QT_SRC_DIR}\plugins\playlistformats\qtmultimedia_m3u.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\position
File "${QT_SRC_DIR}\plugins\position\qtposition_geoclue.dll"
File "${QT_SRC_DIR}\plugins\position\qtposition_positionpoll.dll"
File "${QT_SRC_DIR}\plugins\position\qtposition_serialnmea.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\printsupport
File "${QT_SRC_DIR}\plugins\printsupport\windowsprintersupport.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\sensorgestures
File "${QT_SRC_DIR}\plugins\sensorgestures\qtsensorgestures_plugin.dll"
File "${QT_SRC_DIR}\plugins\sensorgestures\qtsensorgestures_shakeplugin.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\sensors
File "${QT_SRC_DIR}\plugins\sensors\qtsensors_generic.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\sqldrivers
File "${QT_SRC_DIR}\plugins\sqldrivers\qsqlite.dll"
File "${QT_SRC_DIR}\plugins\sqldrivers\qsqlmysql.dll"
File "${QT_SRC_DIR}\plugins\sqldrivers\qsqlodbc.dll"
File "${QT_SRC_DIR}\plugins\sqldrivers\qsqlpsql.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\resources
File /r "${QT_SRC_DIR}\resources"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\translations
File "${QT_SRC_DIR}\translations\qt_*.qm"
File "${QT_SRC_DIR}\translations\qtbase_*.qm"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\translations\qtwebengine_locales
File /r "${QT_SRC_DIR}\translations\qtwebengine_locales"
# Tell Python and the Qt tools where to find Qt.
FileOpen $0 $INSTDIR\qt.conf w
FileWrite $0 "[Paths]$\r$\n"
FileWrite $0 "Prefix = Lib/site-packages/PyQt5$\r$\n"
FileWrite $0 "Binaries = Lib/site-packages/PyQt5$\r$\n"
FileClose $0
FileOpen $0 $INSTDIR\Lib\site-packages\PyQt5\qt.conf w
FileWrite $0 "[Paths]$\r$\n"
FileWrite $0 "Prefix = .$\r$\n"
FileWrite $0 "Binaries = .$\r$\n"
FileClose $0
SectionEnd
Section "Developer tools" SecTools
SectionIn 1
SetOverwrite on
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File .\build\pylupdate\release\pylupdate5.exe
File .\build\pyrcc\release\pyrcc5.exe
FileOpen $0 $INSTDIR\Lib\site-packages\PyQt5\pyuic5.bat w
FileWrite $0 "@$\"$INSTDIR\python$\" -m PyQt5.uic.pyuic %1 %2 %3 %4 %5 %6 %7 %8 %9$\r$\n"
FileClose $0
SectionEnd
Section "Qt developer tools" SecQtTools
SectionIn 1
SetOverwrite on
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File "${QT_SRC_DIR}\bin\assistant.exe"
File "${QT_SRC_DIR}\bin\designer.exe"
File "${QT_SRC_DIR}\bin\linguist.exe"
File "${QT_SRC_DIR}\bin\lrelease.exe"
File "${QT_SRC_DIR}\bin\qcollectiongenerator.exe"
File "${QT_SRC_DIR}\bin\qhelpgenerator.exe"
File "${QT_SRC_DIR}\bin\qmake.exe"
File "${QT_SRC_DIR}\bin\xmlpatterns.exe"
File /r "${QT_SRC_DIR}\mkspecs"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\plugins\designer
File "${QT_SRC_DIR}\plugins\designer\qaxwidget.dll"
File "${QT_SRC_DIR}\plugins\designer\qquickwidget.dll"
File .\build\designer\release\pyqt5.dll
File "${QT_SRC_DIR}\plugins\designer\qscintillaplugin.dll"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\translations
File "${QT_SRC_DIR}\translations\assistant_*.qm"
File "${QT_SRC_DIR}\translations\designer_*.qm"
File "${QT_SRC_DIR}\translations\linguist_*.qm"
SectionEnd
Section "SIP developer tools" SecSIPTools
SectionIn 1
SetOverwrite on
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File /r "${PYQT_PYTHON_DIR}\Lib\site-packages\PyQt5\sip"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File "${PYQT_PYTHON_DIR}\Lib\site-packages\PyQt5\sip.exe"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\include
File "${PYQT_PYTHON_DIR}\Lib\site-packages\PyQt5\include\sip.h"
SectionEnd
Section "Documentation" SecDocumentation
SectionIn 1
SetOverwrite on
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File /r .\doc
SectionEnd
Section "Examples" SecExamples
SectionIn 1
SetOverwrite on
SetOutPath $INSTDIR\Lib\site-packages\PyQt5
File /r .\examples
Rename $INSTDIR\Lib\site-packages\PyQt5\examples\qtdemo\qtdemo.py $INSTDIR\Lib\site-packages\PyQt5\examples\qtdemo\qtdemo.pyw
# Tell the QtQuick plugins example to find the plugin.
Push $INSTDIR
Push "\"
Call StrSlash
Pop $R0
FileOpen $0 $INSTDIR\Lib\site-packages\PyQt5\examples\quick\tutorials\extending\chapter6-plugins\Charts\qmldir w
FileWrite $0 "module Charts$\r$\n"
FileWrite $0 "plugin pyqt5qmlplugin $R0/Lib/site-packages/PyQt5/plugins/PyQt5$\r$\n"
FileClose $0
SectionEnd
Section "Start Menu shortcuts" SecShortcuts
SectionIn 1
SetShellVarContext all
# Make sure this is clean and tidy.
RMDir /r "$SMPROGRAMS\${PYQT_NAME}"
CreateDirectory "$SMPROGRAMS\${PYQT_NAME}"
IfFileExists "$INSTDIR\Lib\site-packages\PyQt5\assistant.exe" 0 +4
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Assistant.lnk" "$INSTDIR\Lib\site-packages\PyQt5\assistant.exe"
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Designer.lnk" "$INSTDIR\Lib\site-packages\PyQt5\designer.exe"
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Linguist.lnk" "$INSTDIR\Lib\site-packages\PyQt5\linguist.exe"
IfFileExists "$INSTDIR\Lib\site-packages\PyQt5\doc" 0 +5
CreateDirectory "$SMPROGRAMS\${PYQT_NAME}\Documentation"
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Documentation\PyQt Reference Guide.lnk" "$INSTDIR\Lib\site-packages\PyQt5\doc\html\index.html"
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Documentation\Qt Documentation.lnk" "http://qt-project.org/doc/qt-${PYQT_QT_DOC_VERS}/"
IfFileExists "$INSTDIR\Lib\site-packages\PyQt5\examples" 0 +6
CreateDirectory "$SMPROGRAMS\${PYQT_NAME}\Examples"
SetOutPath $INSTDIR\Lib\site-packages\PyQt5\examples\qtdemo
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Examples\PyQt Examples.lnk" "$INSTDIR\Lib\site-packages\PyQt5\examples\qtdemo\qtdemo.pyw"
SetOutPath $INSTDIR
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Examples\PyQt Examples Source.lnk" "$INSTDIR\Lib\site-packages\PyQt5\examples"
CreateDirectory "$SMPROGRAMS\${PYQT_NAME}\Links"
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Links\PyQt Book.lnk" "http://www.qtrac.eu/pyqtbook.html"
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Links\PyQt Homepage.lnk" "http://www.riverbankcomputing.com/software/pyqt/"
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Links\Qt Homepage.lnk" "http://qt.digia.com"
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Links\QScintilla Homepage.lnk" "http://www.riverbankcomputing.com/software/qscintilla/"
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Links\eric Homepage.lnk" "http://eric-ide.python-projects.org/index.html"
CreateShortCut "$SMPROGRAMS\${PYQT_NAME}\Uninstall PyQt.lnk" "$INSTDIR\Lib\site-packages\PyQt5\Uninstall.exe"
SectionEnd
Section -post
# Add the bin directory to PATH.
Push $INSTDIR\Lib\site-packages\PyQt5
Call AddToPath
# Tell Windows about the package.
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PYQT_NAME}" "UninstallString" '"$INSTDIR\Lib\site-packages\PyQt5\Uninstall.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PYQT_NAME}" "DisplayName" "${PYQT_NAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PYQT_NAME}" "DisplayVersion" "${PYQT_VERSION}${PYQT_INSTALLER}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PYQT_NAME}" "NoModify" "1"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PYQT_NAME}" "NoRepair" "1"
# Save the installation directories for the uninstaller.
ClearErrors
WriteRegStr HKLM "${PYQT_HK}" "" $INSTDIR
IfErrors 0 +2
WriteRegStr HKCU "${PYQT_HK}" "" $INSTDIR
# Create the uninstaller.
WriteUninstaller "$INSTDIR\Lib\site-packages\PyQt5\Uninstall.exe"
SectionEnd
# Section description text.
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecModules} \
"The PyQt and sip extension modules."
!insertmacro MUI_DESCRIPTION_TEXT ${SecQScintilla} \
"QScintilla and its extension module."
!insertmacro MUI_DESCRIPTION_TEXT ${SecQt} \
"The Qt DLLs, plugins and translations."
!insertmacro MUI_DESCRIPTION_TEXT ${SecQtTools} \
"The Qt developer tools: Assistant, Designer, Linguist etc."
!insertmacro MUI_DESCRIPTION_TEXT ${SecTools} \
"The PyQt developer tools: pyuic5, pyrcc5 and pylupdate5."
!insertmacro MUI_DESCRIPTION_TEXT ${SecSIPTools} \
"The SIP developer tools and .sip files."
!insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} \
"The PyQt and related documentation."
!insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} \
"Ports to Python of the standard Qt v5 examples."
!insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} \
"This adds shortcuts to your Start Menu."
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function un.onInit
${If} ${PYQT_ARCH} == "64"
SetRegView 64
${Endif}
# Get the PyQt installation directory.
ReadRegStr $INSTDIR HKCU "${PYQT_HK}" ""
${If} $INSTDIR == ""
ReadRegStr $INSTDIR HKLM "${PYQT_HK}" ""
${If} $INSTDIR == ""
# Try where Python was installed.
ReadRegStr $INSTDIR HKCU "${PYQT_PYTHON_HK}" ""
${If} $INSTDIR == ""
ReadRegStr $INSTDIR HKCU "${PYQT_PYTHON_HK_ARCH}" ""
${If} $INSTDIR == ""
ReadRegStr $INSTDIR HKLM "${PYQT_PYTHON_HK}" ""
${If} $INSTDIR != ""
ReadRegStr $INSTDIR HKLM "${PYQT_PYTHON_HK_ARCH}" ""
${If} $INSTDIR != ""
# Default to where Python should be installed (at
# least prior to v3.5).
StrCpy $INSTDIR "${PYQT_PYTHON_DIR}\"
${Endif}
${Endif}
${Endif}
${Endif}
${Endif}
${Endif}
FunctionEnd
Section "Uninstall"
SetShellVarContext all
# Remove the bin directory from PATH.
Push $INSTDIR\Lib\site-packages\PyQt5
Call un.RemoveFromPath
# The Qt path file.
Delete $INSTDIR\qt.conf
# The modules section.
Delete $INSTDIR\Lib\site-packages\sip.pyd
RMDir /r $INSTDIR\Lib\site-packages\PyQt5
# The shortcuts section.
RMDir /r "$SMPROGRAMS\${PYQT_NAME}"
# Clean the registry.
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PYQT_NAME}"
DeleteRegKey HKLM "${PYQT_HK_ROOT}"
DeleteRegKey HKCU "${PYQT_HK_ROOT}"
SectionEnd