comparison packaging/eduexportconvert.nsi @ 51:e9cc707838d1

Add Windows packaging
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 19 Jul 2016 17:44:17 +0200
parents
children 797435c1bbeb
comparison
equal deleted inserted replaced
50:36ee5dd46fd3 51:e9cc707838d1
1 ; Copyright (C) 2016 by ETH Zürich
2 ; Software engineering by Intevation GmbH
3 ;
4 ; This file is Free Software under the GNU GPL (v>=2)
5 ; and comes with ABSOLUTELY NO WARRANTY!
6 ; See LICENSE.txt for details.
7
8 ; This script creates the installer for renameme it needs the
9 ; following definitions to be set when calling makensis:
10 ;
11 ; productname: Name of the Software as it will show up under installed
12 ; Software
13 ; version_number: The version of the software
14 ; setupname: The name for the result created by this
15 ; productname_short: Used for the default folder name and such
16 ; size: the expectes size of the installation.
17
18 ;--------------------------------
19 ; Includes
20
21 !define MULTIUSER_EXECUTIONLEVEL Highest
22 !define MULTIUSER_MUI
23 !define MULTIUSER_INSTALLMODE_COMMANDLINE
24 !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "Software\${productname_short}"
25 !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "InstallMode"
26 !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "Software\${productname_short}"
27 !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "InstallDir"
28 !define MULTIUSER_INSTALLMODE_INSTDIR "${productname}"
29
30 !addincludedir "${plugin_dir}"
31
32 !include "MultiUser.nsh"
33 !include "MUI2.nsh"
34 !include "FileFunc.nsh"
35
36 ;--------------------------------
37 ;Version Information (for installer file properties)
38
39 ;VIProductVersion "${version_number}" ;needs integer format: x.x.x.x
40 VIProductVersion ${numeric_version}
41 VIAddVersionKey "ProductName" "${productname_short}"
42 VIAddVersionKey "Comments" "${productname_short} ist Freie Software"
43 VIAddVersionKey "CompanyName" "Intevation GmbH"
44 VIAddVersionKey "LegalTrademarks" ""
45 VIAddVersionKey "LegalCopyright" "Copyright (C) 2016 by ETH Zürich"
46 VIAddVersionKey "FileDescription" "Converter for EduApp export files"
47 VIAddVersionKey "FileVersion" "${version_number}"
48
49 ;--------------------------------
50 ; General
51
52 ; Define Name, File and Installdir of Installer
53 Name "${productname}"
54 OutFile "${setupname}"
55 InstallDir "$PROGRAMFILES\${productname}"
56 BrandingText "ETH Zürich - ${productname}"
57
58 ;--------------------------------
59 ; Interface Settings
60
61 ; MUI Images / Icons
62 !define MUI_HEADERIMAGE
63 !define MUI_HEADERIMAGE_BITMAP "resources\header-install.bmp"
64 !define MUI_WELCOMEFINISHPAGE_BITMAP "resources\wizard-install.bmp"
65 !define MUI_ICON "resources\install.ico"
66
67 !define MUI_HEADERIMAGE_UNBITMAP "resources\header-uninstall.bmp"
68 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "resources\wizard-uninstall.bmp"
69 !define MUI_UNICON "resources\uninstall.ico"
70
71 !insertmacro MUI_RESERVEFILE_LANGDLL
72 !define MUI_LANGDLL_REGISTRY_ROOT "SHCTX"
73 !define MUI_LANGDLL_REGISTRY_KEY "Software\${productname_short}"
74 !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
75
76 ;--------------------------------
77 ; Pages
78
79 !define MUI_FINISHPAGE_TITLE "$(T_finish_title)"
80 !define MUI_FINISHPAGE_TEXT "$(T_finish_text)"
81
82 ; MUI welcome page text
83 ;!define MUI_WELCOMEPAGE_TITLE "$(T_title)"
84 ;!define MUI_WELCOMEPAGE_TITLE_3LINES
85 ;!define MUI_WELCOMEPAGE_TEXT "$(T_description) $\r$\n$\r$\n$\r$\n$\r$\n"
86
87 ;!insertmacro MUI_PAGE_WELCOME
88 !insertmacro MUI_PAGE_DIRECTORY
89 !insertmacro MUI_PAGE_INSTFILES
90 !insertmacro MUI_PAGE_FINISH
91
92 !insertmacro MUI_UNPAGE_WELCOME
93 !insertmacro MUI_UNPAGE_INSTFILES
94
95
96 ;--------------------------------
97 ;Supported Languages
98
99 !insertmacro MUI_LANGUAGE "German"
100 !insertmacro MUI_LANGUAGE "English"
101
102 ;--------------------------------
103 ; Install Functions
104
105 Function ".onInit"
106 !insertmacro MUI_LANGDLL_DISPLAY
107 !insertmacro MULTIUSER_INIT
108 FunctionEnd
109
110 ;--------------------------------
111 ; UnInstall Functions
112 Function "un.onInit"
113 !insertmacro MULTIUSER_UNINIT
114 FunctionEnd
115
116 Section ""
117 ; The actual installation
118 SetOutPath "$INSTDIR"
119 !include "filelist_in.nsh"
120 ; Store install directory
121 DetailPrint "$(T_registry)"
122 WriteRegStr SHCTX "Software\${productname_short}" "" $INSTDIR
123
124 ; Create uninstaller
125 WriteUninstaller "$INSTDIR\Uninstall.exe"
126
127 ; Register Uninstaller
128
129 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
130 "DisplayName" "${productname}"
131 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
132 "DisplayIcon" "$\"$INSTDIR\${productname_short}.exe$\""
133 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
134 "DisplayVersion" "${version_number}"
135 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
136 "Publisher" "Intevation GmbH"
137 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
138 "URLInfoAbout" "${info_url}"
139 WriteRegDword SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
140 "EstimatedSize" "${size}"
141
142
143 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
144 "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
145 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
146 "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
147
148 ; Set up File Extension .edu
149 # .edu
150 WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" "" "$(T_File_Type_edu_Name)"
151 WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" "FriendlyTypeName" "$(T_File_Type_edu_Name)"
152 WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" "PercievedType" "Document"
153 WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" "InfoTip" "$(T_File_Type_info_tip)"
154 WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU\shell\open\command" "" "$\"$INSTDIR\${productname_short}.exe$\" $\"%1$\""
155 WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" "FriendlyAppName" "${productname}"
156 WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU\DefaultIcon" "" "$INSTDIR\${productname_short}.exe"
157
158 WriteRegBin SHCTX "Software\Classes\.edu\OpenWithProgIDs" "${productname_short}.AssocFile.EDU" 0
159
160 WriteRegStr SHCTX "Software\RegisteredApplications" "${productname_short}" "SOFTWARE\${productname_short}\Capabilities"
161 WriteRegStr SHCTX "Software\${productname_short}" "" "${productname}"
162 WriteRegStr SHCTX "Software\${productname_short}" "FriendlyAppName" "${productname}"
163
164 WriteRegStr SHCTX "Software\${productname_short}\Capabilities" "ApplicationName" "${productname}"
165 WriteRegStr SHCTX "Software\${productname_short}\Capabilities" "ApplicationIcon" "$\"$INSTDIR\${productname_short}.exe$\",0"
166 WriteRegStr SHCTX "Software\${productname_short}\Capabilities" "ApplicationDescription" "$(T_description)"
167 WriteRegStr SHCTX "Software\${productname_short}\Capabilities" "FriendlyAppName" "${productname}"
168 WriteRegStr SHCTX "Software\${productname_short}\Capabilities\DefaultIcon" "" "$\"$INSTDIR\${productname_short}.exe$\",0"
169 WriteRegStr SHCTX "Software\${productname_short}\Capabilities\MimeAssociations" "application/edu-app" "${productname_short}.AssocFile.EDU"
170 WriteRegExpandStr SHCTX "Software\${productname_short}\Capabilities\shell\open\command" "" "$\"$INSTDIR\${productname_short}.exe$\" $\"%1$\""
171 WriteRegStr SHCTX "Software\${productname_short}\Capabilities\shell\open" "FriendlyAppName" "${productname}"
172 WriteRegStr SHCTX "Software\${productname_short}\Capabilities\FileAssociations" ".edu" "${productname_short}.AssocFile.EDU"
173
174
175 WriteRegStr SHCTX "SOFTWARE\Classes\Applications\${productname_short}.exe\SupportedTypes" ".edu" ""
176 WriteRegStr SHCTX "SOFTWARE\Classes\Applications\${productname_short}.exe\shell\open" "FriendlyAppName" "${productname}"
177
178 CreateShortCut "$SMPROGRAMS\${productname}.lnk" "$INSTDIR\${productname_short}.exe"
179
180 System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
181 SectionEnd
182
183 Section "Uninstall"
184 ExpandEnvStrings $0 %APPDATA%
185 Delete "$0\${productname_short}\${productname_short}.ini"
186 RmDir "$0\${productname_short}"
187 !include "filelist_un.nsh"
188 ExpandEnvStrings $0 %APPDATA%
189 Delete "$INSTDIR\Uninstall.exe"
190 RMDir "$INSTDIR"
191 DetailPrint "$(T_unregistry)"
192
193 DeleteRegKey SHCTX "Software\Classes\${productname_short}.AssocFile.EDU"
194 DeleteRegValue SHCTX "Software\Classes\.edu\OpenWithProgIDs" "${productname_short}.AssocFile.EDU"
195 DeleteRegValue SHCTX "Software\RegisteredApplications" "${productname_short}"
196 DeleteRegKey SHCTX "Software\${productname_short}"
197
198 DeleteRegKey SHCTX "SOFTWARE\Classes\Applications\${productname_short}.exe"
199
200 ; Remove uninstaller
201 DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}"
202
203 Delete "$SMPROGRAMS\${productname}.lnk"
204
205 SectionEnd
206
207 LangString T_description ${LANG_ENGLISH} "${productname} is a Software to convert EduApp-Exports into different formats."
208 LangString T_description ${LANG_GERMAN} "${productname} ist eine Anwendung um EduApp-Exporte in andere Formate zu konvertieren."
209 LangString T_title ${LANG_ENGLISH} "Welcome to the installation of ${productname} ${version_number}$\r$\n$\r$\n$\r$\n$\r$\n"
210 LangString T_title ${LANG_GERMAN} "Willkommen zur Installation von ${productname} ${version_number}$\r$\n$\r$\n$\r$\n$\r$\n"
211 LangString T_finish_title ${LANG_ENGLISH} "Installation successful"
212 LangString T_finish_title ${LANG_GERMAN} "Installation erfolgreich"
213 LangString T_finish_text ${LANG_ENGLISH} "${productname} was successfully installed on your computer. $\r$\n$\r$\nClick 'Finish' to close the Install-Wizard."
214 LangString T_finish_text ${LANG_GERMAN} "${productname} wurde erfolgreich auf ihrem System installiert. $\r$\n$\r$\nKlicken Sie auf 'Fertig stellen', um den Installations-Assistenten zu schließen."
215 LangString T_File_Type_info_tip ${LANG_ENGLISH} "An EduApp questionaire export."
216 LangString T_File_Type_info_tip ${LANG_GERMAN} "Export eines EduApp Fragebogens."
217 LangString T_File_Type_edu_Name ${LANG_GERMAN} "EduApp Export"
218 LangString T_File_Type_edu_Name ${LANG_ENGLISH} "EduApp Export"
219 LangString T_registry ${LANG_GERMAN} "Anwendung wird registiert"
220 LangString T_registry ${LANG_ENGLISH} "Registering Application"
221 LangString T_unregistry ${LANG_GERMAN} "Entferne Registry Einträge"
222 LangString T_unregistry ${LANG_ENGLISH} "Unregistering Application"
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)