File: PyQwt3D.nsi.in

package info (click to toggle)
pyqwt3d 0.1.8-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 984 kB
  • sloc: python: 3,932; cpp: 328; makefile: 113; sh: 7
file content (233 lines) | stat: -rw-r--r-- 8,186 bytes parent folder | download | duplicates (5)
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
# PyQwt3D5 NSIS installer script.
#
# Copyright (C) 2004-2007 Gerard Vermeulen
# 
# This file is part of PyQwt3D.
# 
# PyQwt3D is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# PyQwt3D is supplied in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with PyQwt3D; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
#
# In addition, as a special exception, Gerard Vermeulen give permission
# to link PyQwt3D dynamically with non-free versions of Qt and PyQt,
# and to distribute PyQwt3D in this form, provided that equally powerful
# versions of Qt and PyQt have been released under the terms of the GNU
# General Public License.
#
# If PyQwt3D is dynamically linked with non-free versions of Qt and PyQt,
# PyQwt3D becomes a free plug-in for a non-free program.


# These will change with different releases.
!define PYQWT3D_VERSION        "0.1.6"
!define PYQWT3D_PYQT_VERSION   "%(PYQT_VERSION)s"
!define PYQWT3D_PYTHON_VERSION "%(PYTHON_VERSION)s"
!define PYQWT3D_QT_VERSION     "%(QT_VERSION)s"
!define PYQWT3D_NUMPY_VERSION  "%(NUMPY_VERSION)s"

# These are all derived from the above.
!define PYQWT3D_NAME           "PyQwt3D-${PYQWT3D_VERSION}"
!define PYQWT3D_INSTALLDIR     "C:\Python${PYQWT3D_PYTHON_VERSION}\"
!define PYQWT3D_PYTHON_HKLM    "Software\Python\PythonCore\${PYQWT3D_PYTHON_VERSION}\InstallPath"


# Tweak some of the standard pages.
!define MUI_WELCOMEPAGE_TEXT \
"This wizard will guide you through the installation of ${PYQWT3D_NAME} \
built with the MinGW compiler against:\r\n\
- Python-${PYQWT3D_PYTHON_VERSION}.x\r\n\
- Qt-${PYQWT3D_QT_VERSION}\r\n\
- PyQt-${PYQWT3D_PYQT_VERSION}\r\n\
- NumPy-${PYQWT3D_NUMPY_VERSION}.\r\n\
\r\n\
The license of the distribution of any of your software using PyQwt3D has to \
be compatible with the GPL licence.  Assure your licensees 4 freedoms to \
comply with the GPL:\r\n\
0 - to run your software, for any purpose\r\n\
1 - to study your software, and adapt it to his needs\r\n\
2 - to redistribute copies so he can help his neighbor\r\n\
3 - to improve your software, and release his improvements.\r\n\
Access to the source code is a precondition for this.\r\n\
\r\n\
Click Next to continue."

!define MUI_FINISHPAGE_LINK "Get the latest news of PyQwt3D here"
!define MUI_FINISHPAGE_LINK_LOCATION "http://pyqwt.sourceforge.net"


# Include the tools we use.
!include MUI.nsh
!include LogicLib.nsh


# Define the product name and installer executable.
Name "PyQwt3D"
Caption "${PYQWT3D_NAME} Setup"
OutFile "PyQwt3D-${PYQWT3D_VERSION}-Python${PYQWT3D_PYTHON_VERSION}-Qt${PYQWT3D_QT_VERSION}-PyQt${PYQWT3D_PYQT_VERSION}-NumPy${PYQWT3D_NUMPY_VERSION}.exe"


# Set the install directory, from the registry if possible.
InstallDir "${PYQWT3D_INSTALLDIR}"
InstallDirRegKey HKLM "${PYQWT3D_PYTHON_HKLM}" ""


# 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
    # Check the right version of Python has been installed.
    ReadRegStr $0 HKLM "${PYQWT3D_PYTHON_HKLM}" ""

    ${If} $0 == ""
        MessageBox MB_YESNO|MB_ICONQUESTION \
"This copy of PyQwt3D has been built against Python-${PYQWT3D_PYTHON_VERSION}.x \
which doesn't seem to be installed.$\r$\n\
$\r$\n\
Do you with to continue with the installation?" IDYES GotPython
            Abort
GotPython:
    ${Endif}
FunctionEnd


# Define the different pages.
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "..\COPYING"
!insertmacro MUI_PAGE_COMPONENTS
!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

    # Make sure this is clean and tidy.
    RMDir /r $PROGRAMFILES\PyQwt3D
    CreateDirectory $PROGRAMFILES\PyQwt3D

    SetOverwrite on

    SetOutPath $INSTDIR\Lib\site-packages\PyQt4\Qwt3D
    File .\Qwt3D_Qt4\__init__.py
    File .\Qwt3D_Qt4\ezplot.py
    File .\Qwt3D_Qt4\_Qwt3D.pyd
    File .\OpenGL_Qt4\OpenGL.pyd
SectionEnd

Section "Documentation" SecDocumentation
    SectionIn 1

    SetOverwrite on

    SetOutPath $PROGRAMFILES\PyQwt3D
    File /r ..\Doc\html\pyqwt3d
    File /r ..\qwtplot3d-0.2.7\doc\web\doxygen
SectionEnd

Section "Examples" SecExamples
    SectionIn 1

    SetOverwrite on

    SetOutPath $PROGRAMFILES\PyQwt3D
    File /r ..\qt4examples
SectionEnd

Section "Start Menu shortcuts" SecShortcuts
    SectionIn 1

    # Make sure this is clean and tidy.
    RMDir /r "$SMPROGRAMS\${PYQWT3D_NAME}"
    CreateDirectory "$SMPROGRAMS\${PYQWT3D_NAME}"

    IfFileExists "$PROGRAMFILES\PyQwt3D\pyqwt3d\index.html" 0 +2
        CreateShortCut "$SMPROGRAMS\${PYQWT3D_NAME}\PyQwt3D Documentation.lnk" "$PROGRAMFILES\PyQwt3D\pyqwt3d\index.html"
        
    IfFileExists "$PROGRAMFILES\PyQwt3D\doxygen\index.html" 0 +2
        CreateShortCut "$SMPROGRAMS\${PYQWT3D_NAME}\QwtPlot3D Documentation.lnk" "$PROGRAMFILES\PyQwt3D\doxygen\index.html"

    CreateShortCut "$SMPROGRAMS\${PYQWT3D_NAME}\QwtPlot3D Manual.lnk" "http://qwtplot3d.sourceforge.net"

    IfFileExists "$PROGRAMFILES\PyQwt3D\qt4examples" 0 +3
	SetOutPath $INSTDIR
        CreateShortCut "$SMPROGRAMS\${PYQWT3D_NAME}\Examples Source.lnk" "$PROGRAMFILES\PyQwt3D\qt4examples"

    CreateShortCut "$SMPROGRAMS\${PYQWT3D_NAME}\Uninstall PyQwt3D.lnk" "$PROGRAMFILES\PyQwt3D\Uninstall.exe"
SectionEnd

Section -post
    # Tell Windows about the package.
    WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" "UninstallString" '"$PROGRAMFILES\PyQwt3D\Uninstall.exe"'
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" "DisplayName" "${PYQWT3D_NAME}"
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" "DisplayVersion" "${PYQWT3D_VERSION}"
    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" "NoModify" "1"
    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D" "NoRepair" "1"

    # Save the installation directory for the uninstaller.
    WriteRegStr HKLM "Software\PyQwt3D" "" $INSTDIR

    # Create the uninstaller.
    WriteUninstaller "$PROGRAMFILES\PyQwt3D\Uninstall.exe"
SectionEnd


# Section description text.
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecModules} \
"The PyQwt3D modules: Qwt, anynumpy, grace, iqt, qplt."
!insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} \
"The PyQwt3D and Qwt documentation."
!insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} \
"Ports to Python of the Qwt-5.0.1 examples."
!insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} \
"Shortcuts to your Start Menu."
!insertmacro MUI_FUNCTION_DESCRIPTION_END


Section "Uninstall"
    # Get the install directory.
    ReadRegStr $INSTDIR HKLM "Software\PyQwt3D" ""

    # The modules section.
    RMDir /r $INSTDIR\Lib\site-packages\PyQt4\Qwt3D

    # The shortcuts section.
    RMDir /r "$SMPROGRAMS\${PYQWT3D_NAME}"

    # The examples section and the installer itself.
    RMDir /r "$PROGRAMFILES\PyQwt3D"

    # Clean the registry.
    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PyQwt3D"
    DeleteRegKey HKLM "Software\PyQwt3D"
SectionEnd