forked from textext/textext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_windows_installer.nsi
99 lines (81 loc) · 3.35 KB
/
build_windows_installer.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
; Script generated by the HM NIS Edit Script Wizard.
Unicode True
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "TexText for Inkscape"
!define /file PRODUCT_VERSION "textext\VERSION"
!define PRODUCT_PUBLISHER "TexText developers"
!define PRODUCT_WEB_SITE "https://github.com/textext/textext"
!define PRODUCT_DOC_SITE "https://textext.github.io/textext"
; MUI 1.67 compatible ------
!include "MUI2.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
; Welcome page
!define MUI_WELCOMEPAGE_TEXT "Setup will guide you through the installation of ${PRODUCT_NAME} \
${PRODUCT_VERSION}$\n$\nPlease note that this version of TexText is only compatible with Inkscape \
1.x!$\n$\nClick Next to continue."
!insertmacro MUI_PAGE_WELCOME
; License page
!define MUI_LICENSEPAGE_BUTTON "Next >"
!define MUI_LICENSEPAGE_TEXT_TOP "TexText is published under the modified BSD License \
(3-clause BSD License):"
!define MUI_LICENSEPAGE_TEXT_BOTTOM "Click Next to continue!"
!insertmacro MUI_PAGE_LICENSE "LICENSE.txt"
; Directory page
!define MUI_DIRECTORYPAGE_TEXT_TOP "${PRODUCT_NAME} ${PRODUCT_VERSION} will be installed into the \
Inkscape extension directory. Please change this directory only if you know what you are doing!"
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_TEXT_LARGE
!define MUI_FINISHPAGE_TEXT "${PRODUCT_NAME} ${PRODUCT_VERSION} has been installed on your computer. \
It is recommended to carefully read the documentation on ${PRODUCT_DOC_SITE} with instructions \
for additional software and a short TexText user guide.$\n$\nClick Finish to close Setup."
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Open documentation ${PRODUCT_DOC_SITE}"
!define MUI_FINISHPAGE_RUN_FUNCTION "ShowDoc"
!insertmacro MUI_PAGE_FINISH
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Function ShowDoc
ExecShell "open" "${PRODUCT_DOC_SITE}"
FunctionEnd
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "TexText-Windows-${PRODUCT_VERSION}.exe"
InstallDir "$APPDATA\inkscape\extensions\"
ShowInstDetails show
RequestExecutionLevel user
Section -SETTINGS
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
SectionEnd
Section "TexText" -SEC01
; The extension files are installed in the subdir "textext" of the
; Inkscape extension directory $INSTDIR.
SetOutPath "$INSTDIR\textext"
File /x "*.pyc" /x "*.log" "textext\*.*"
SetOutPath "$INSTDIR\textext\icons"
File /r "textext\icons\*.png"
; Make sure that extension files from old TexText versions < 0.9
; are removed (they were put directly into Inkscape's extension
; directory and not in a subdirectory)
; Keep old default_packages.tex, i.e. move it to the new location
IfFileExists "$INSTDIR\textext.py" OldExtensionFound InstallFinished
OldExtensionFound:
Delete $INSTDIR\textext\default_packages.tex
Rename $INSTDIR\default_packages.tex $INSTDIR\textext\default_packages.tex
Delete "$INSTDIR\textext.py"
Delete "$INSTDIR\textext.pyc"
Delete "$INSTDIR\asktext.py"
Delete "$INSTDIR\asktext.pyc"
Delete "$INSTDIR\typesetter.py"
Delete "$INSTDIR\typesetter.pyc"
Delete "$INSTDIR\latexlogparser.py"
Delete "$INSTDIR\latexlogparser.pyc"
Delete "$INSTDIR\win_app_paths.py"
Delete "$INSTDIR\win_app_paths.pyc"
InstallFinished:
SectionEnd