source: branches/1.1.8/installer.nsi @ 207

Revision 207, 12.4 KB checked in by bartek, 9 years ago (diff)
  • applying the lost changes to windows installation
Line 
1; Script generated by the HM NIS Edit Script Wizard.
2
3; HM NIS Edit Wizard helper defines
4!define PRODUCT_NAME "QCG-Icon"
5!define PRODUCT_VERSION "1.1.8"
6!define PRODUCT_PUBLISHER "PSNC"
7!define PRODUCT_WEB_SITE "http://www.qoscosgrid.org/trac/qcg-icon"
8!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\qcg-icon"
9!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
10!define PRODUCT_UNINST_ROOT_KEY "HKLM"
11
12; MUI ------
13!include "MUI2.nsh"
14
15; MUI Settings
16!define MUI_ABORTWARNING
17; !define MUI_ICON "resources\qcg-icon-128.ico"
18!define MUI_ICON "resources\qcg-logo-stones.ico"
19!define MUI_HEADERIMAGE
20!define MUI_HEADERIMAGE_BITMAP "dist_static\resources\qcg-icon-header.bmp"
21!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
22
23; Welcome page
24!insertmacro MUI_PAGE_WELCOME
25
26; Directory page
27!insertmacro MUI_PAGE_DIRECTORY
28
29; Instfiles page
30!insertmacro MUI_PAGE_INSTFILES
31
32; from: http://nsis.sourceforge.net/Docs/Modern%20UI/Readme.html
33; "  MUI_FINISHPAGE_SHOWREADME_FUNCTION function
34;    Call a function instead of showing a file (define MUI_FINISHPAGE_SHOWREADME without parameters).
35;    You can use the function to show multiple files or you can change the checkbox name and use it for other things. "
36
37; Finish page
38!define MUI_FINISHPAGE_RUN "$INSTDIR\qcg-icon.exe"
39!define MUI_FINISHPAGE_SHOWREADME
40!define MUI_FINISHPAGE_SHOWREADME_TEXT "$(addToAutostart)"
41!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
42!define MUI_FINISHPAGE_SHOWREADME_FUNCTION "EnableAutostart"
43!insertmacro MUI_PAGE_FINISH
44
45; Uninstaller pages
46!insertmacro MUI_UNPAGE_INSTFILES
47
48; Language files
49!insertmacro MUI_LANGUAGE "Polish"
50!insertmacro MUI_LANGUAGE "English"
51
52LangString addToAutostart ${LANG_POLISH} "Uruchamiaj automatycznie z systemem"
53LangString addToAutostart ${LANG_ENGLISH} "Enable autostart" 
54
55; MUI end ------
56
57Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
58OutFile "C:\${PRODUCT_NAME}-${PRODUCT_VERSION}.exe"
59InstallDir "$PROGRAMFILES\qcg-icon"
60InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
61ShowInstDetails show
62ShowUnInstDetails show
63
64LangString deinstallOld ${LANG_POLISH} "Inna wersja programu ${PRODUCT_NAME} jest ju¿ zainstalowana w systemie. $\n$\nAby usun¹æ poprzedni¹ wersjê kliknij 'OK'. Aby zrezygnowaæ kliknij 'Anuluj'."
65LangString deinstallOld ${LANG_ENGLISH} "The another version of ${PRODUCT_NAME} is already installed. $\n$\nClick 'OK' to remove the previous version or 'Cancel' to cancel this upgrade."
66
67LangString closeOld ${LANG_POLISH} "Inna instancja programu ${PRODUCT_NAME} jest uruchomiona. $\n$\nPrzed instalacj¹ nale¿y j¹ zamkn¹æ."
68LangString closeOld ${LANG_ENGLISH} "The another instance of ${PRODUCT_NAME} is running. $\n$\nIt should be closed before this upgrade."
69
70
71Function .onInit
72 !insertmacro MUI_LANGDLL_DISPLAY
73 FindProcDLL::FindProc "${PRODUCT_NAME}.exe"
74 IntCmp $R0 1 0 notRunning
75    MessageBox MB_OK|MB_ICONEXCLAMATION "$(closeOld)" /SD IDOK
76    Abort
77 notRunning:
78
79 ReadRegStr $R0 HKLM \
80  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
81  "UninstallString"
82  StrCmp $R0 "" done
83 
84  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
85  "$(deinstallOld)" \
86  IDOK uninst
87  Abort
88 
89  ;Run the uninstaller
90  uninst:
91    ClearErrors
92
93    ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
94 
95    IfErrors no_remove_uninstaller done
96      ;You can either use Delete /REBOOTOK in the uninstaller or add some code
97      ;here to remove the uninstaller. Use a registry key to check
98      ;whether the user has chosen to uninstall. If you are using an uninstaller
99      ;components page, make sure all sections are uninstalled.
100    no_remove_uninstaller:
101 
102  done:
103FunctionEnd
104
105Function "EnableAutostart"
106  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "QCG-Icon" "$INSTDIR\qcg-icon.exe"
107FunctionEnd
108
109Section "main" SEC01
110  SetOutPath "$INSTDIR\certs"
111  SetOverwrite try
112  File "dist_static\certs\*"
113  SetOutPath "$INSTDIR\lib"
114  File "dist\lib\activation-1.1.jar"
115  File "dist\lib\avalon-framework-4.1.3.jar"
116  File "dist\lib\cog-jglobus-CURRENT.jar"
117  File "dist\lib\cog-url-CURRENT.jar"
118  File "dist\lib\commons-logging-1.1.jar"
119  File "dist\lib\cryptix-asn1-CURRENT.jar"
120  File "dist\lib\cryptix-CURRENT.jar"
121  File "dist\lib\cryptix32-CURRENT.jar"
122  File "dist\lib\JarSync-0.3.jar"
123  File "dist\lib\jaxb-api-2.1.jar"
124  File "dist\lib\jaxb-impl-2.1.6.jar"
125  File "dist\lib\jaxws-api-2.1.jar"
126  File "dist\lib\jaxws-rt-2.1.3.jar"
127  File "dist\lib\jce-jdk13-131-CURRENT.jar"
128  File "dist\lib\jgss-CURRENT.jar"
129  File "dist\lib\jsr181-api-1.0-MR1.jar"
130  File "dist\lib\jsr250-api-1.0.jar"
131  File "dist\lib\junit-3.8.jar"
132  File "dist\lib\log4j-1.2.12.jar"
133  File "dist\lib\logkit-1.0.1.jar"
134  File "dist\lib\mimepull-1.1.jar"
135  File "dist\lib\puretls-CURRENT.jar"
136  File "dist\lib\resolver-20050927.jar"
137  File "dist\lib\saaj-api-1.3.jar"
138  File "dist\lib\saaj-impl-1.3.jar"
139  File "dist\lib\servlet-api-2.3.jar"
140  File "dist\lib\sjsxp-1.0.jar"
141  File "dist\lib\QCGComputingSDK-2.4.1.jar"
142  File "dist\lib\QCGCoreSDK-2.4.0.jar"
143  File "dist\lib\stax-api-1.0.jar"
144  File "dist\lib\stax-ex-1.2.jar"
145  File "dist\lib\streambuffer-0.7.jar"
146  File "dist\lib\webservices-api-1.1.2-SNAPSHOT.jar"
147  File "dist\lib\xmlsec-2.0.jar"
148  File "dist\lib\xws-security-CURRENT.jar"
149  File "dist\lib\jsch-0.1.49.jar"
150  SetOutPath "$INSTDIR\resources"
151  File "resources\qcg-logo-stones-16.png"
152  SetOutPath "$INSTDIR"
153  File "dist\QCG-Icon.jar"
154  File "dist_static\qcg-icon.exe"
155  File "dist_static\config.properties"
156  File "dist_static\urls.properties"
157  File "dist_static\logging.properties"
158SectionEnd
159
160LangString submitTask ${LANG_POLISH} "Zleæ zadanie..."
161LangString submitTask ${LANG_ENGLISH} "Submit task..." 
162
163Section -Post
164  WriteUninstaller "$INSTDIR\uninst.exe"
165  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\qcg-icon.exe"
166  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
167  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
168  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\qcg-icon.exe"
169  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
170  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
171  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
172 
173  # remove autostart from HKLM and set it in HKCU (in EnableAutostart function)
174  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Run\QCG-Icon"
175 
176  # Menu Start
177  CreateShortCut "$SMPROGRAMS\QCG-Icon.lnk" "$INSTDIR\qcg-icon.exe"
178 
179  # Matlab
180  WriteRegStr HKCR ".m\shell\submit" "" "$(submitTask)"
181  WriteRegStr HKCR ".m\shell\submit\command" "" "$\"$INSTDIR\qcg-icon.exe$\" $\"%1$\""
182 
183  # Namd
184  WriteRegStr HKCR ".namd\shell\submit" "" "$(submitTask)"
185  WriteRegStr HKCR ".namd\shell\submit\command" "" "$\"$INSTDIR\qcg-icon.exe$\" $\"%1$\""
186 
187  # R
188  WriteRegStr HKCR ".r\shell\submit" "" "$(submitTask)"
189  WriteRegStr HKCR ".r\shell\submit\command" "" "$\"$INSTDIR\qcg-icon.exe$\" $\"%1$\""
190
191  # CFX
192  WriteRegStr HKCR ".def\shell\submit" "" "$(submitTask)"
193  WriteRegStr HKCR ".def\shell\submit\command" "" "$\"$INSTDIR\qcg-icon.exe$\" $\"%1$\""
194
195  # Fluent
196  WriteRegStr HKCR ".fluent\shell\submit" "" "$(submitTask)"
197  WriteRegStr HKCR ".fluent\shell\submit\command" "" "$\"$INSTDIR\qcg-icon.exe$\" $\"%1$\""
198
199  # BASH
200  WriteRegStr HKCR ".sh\shell\submit" "" "$(submitTask)"
201  WriteRegStr HKCR ".sh\shell\submit\command" "" "$\"$INSTDIR\qcg-icon.exe$\" $\"%1$\""
202
203  # Gaussian
204  WriteRegStr HKCR ".gjf\shell\submit" "" "$(submitTask)"
205  WriteRegStr HKCR ".gjf\shell\submit\command" "" "$\"$INSTDIR\qcg-icon.exe$\" $\"%1$\""
206  WriteRegStr HKCR ".inp\shell\submit" "" "$(submitTask)"
207  WriteRegStr HKCR ".inp\shell\submit\command" "" "$\"$INSTDIR\qcg-icon.exe$\" $\"%1$\""
208  WriteRegStr HKCR ".com\shell\submit" "" "$(submitTask)"
209  WriteRegStr HKCR ".com\shell\submit\command" "" "$\"$INSTDIR\qcg-icon.exe$\" $\"%1$\""
210   
211SectionEnd
212
213LangString askDeinstall ${LANG_POLISH} "Czy na pewno chcesz usun¹æ program $(^Name) i wszystkie jego komponenty?"
214LangString askDeinstall ${LANG_ENGLISH} "Do you really want to remove $(^Name) and all it's components?"
215Function un.onInit
216  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(askDeinstall)" IDYES +2
217  Abort
218FunctionEnd
219
220Section Uninstall
221  Delete "$INSTDIR\urls.properties"
222  Delete "$INSTDIR\QCG-Icon.jar"
223  Delete "$INSTDIR\qcg-icon.exe"
224  Delete "$INSTDIR\resources\qcg-logo-stones-16.png"
225  Delete "$INSTDIR\lib\xws-security-CURRENT.jar"
226  Delete "$INSTDIR\lib\xmlsec-2.0.jar"
227  Delete "$INSTDIR\lib\webservices-api-1.1.2-SNAPSHOT.jar"
228  Delete "$INSTDIR\lib\streambuffer-0.7.jar"
229  Delete "$INSTDIR\lib\stax-ex-1.2.jar"
230  Delete "$INSTDIR\lib\stax-api-1.0.jar"
231  Delete "$INSTDIR\lib\QCGCoreSDK-2.4.0.jar"
232  Delete "$INSTDIR\lib\QCGComputingSDK-2.4.1.jar"
233  Delete "$INSTDIR\lib\sjsxp-1.0.jar"
234  Delete "$INSTDIR\lib\servlet-api-2.3.jar"
235  Delete "$INSTDIR\lib\saaj-impl-1.3.jar"
236  Delete "$INSTDIR\lib\saaj-api-1.3.jar"
237  Delete "$INSTDIR\lib\resolver-20050927.jar"
238  Delete "$INSTDIR\lib\puretls-CURRENT.jar"
239  Delete "$INSTDIR\lib\mimepull-1.1.jar"
240  Delete "$INSTDIR\lib\logkit-1.0.1.jar"
241  Delete "$INSTDIR\lib\log4j-1.2.12.jar"
242  Delete "$INSTDIR\lib\junit-3.8.jar"
243  Delete "$INSTDIR\lib\jsr250-api-1.0.jar"
244  Delete "$INSTDIR\lib\jsr181-api-1.0-MR1.jar"
245  Delete "$INSTDIR\lib\jgss-CURRENT.jar"
246  Delete "$INSTDIR\lib\jce-jdk13-131-CURRENT.jar"
247  Delete "$INSTDIR\lib\jaxws-rt-2.1.3.jar"
248  Delete "$INSTDIR\lib\jaxws-api-2.1.jar"
249  Delete "$INSTDIR\lib\jaxb-impl-2.1.6.jar"
250  Delete "$INSTDIR\lib\jaxb-api-2.1.jar"
251  Delete "$INSTDIR\lib\JarSync-0.3.jar"
252  Delete "$INSTDIR\lib\cryptix32-CURRENT.jar"
253  Delete "$INSTDIR\lib\cryptix-CURRENT.jar"
254  Delete "$INSTDIR\lib\cryptix-asn1-CURRENT.jar"
255  Delete "$INSTDIR\lib\commons-logging-1.1.jar"
256  Delete "$INSTDIR\lib\cog-url-CURRENT.jar"
257  Delete "$INSTDIR\lib\cog-jglobus-CURRENT.jar"
258  Delete "$INSTDIR\lib\avalon-framework-4.1.3.jar"
259  Delete "$INSTDIR\lib\activation-1.1.jar"
260  Delete "$INSTDIR\lib\jsch-0.1.49.jar"
261  Delete "$INSTDIR\config.properties"
262  Delete "$INSTDIR\certs\8a661490.signing_policy"
263  Delete "$INSTDIR\certs\8a661490.0"
264  Delete "$INSTDIR\logging.properties"
265  Delete "$INSTDIR\qcg-icon.log"
266  Delete "$INSTDIR\qcg-icon.log.1"
267  Delete "$INSTDIR\uninst.exe"
268  Delete "$INSTDIR\certs\*"
269
270  RMDir "$INSTDIR\resources"
271  RMDir "$INSTDIR\lib"
272  RMDir "$INSTDIR\certs"
273  RMDir "$INSTDIR"
274 
275  # autostart
276  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "QCG-Icon"
277 
278  # Menu Start
279  Delete "$SMPROGRAMS\qcg-icon.lnk"
280 
281  # matlab
282  DeleteRegKey HKCR ".m\shell\submit\command"
283  DeleteRegKey HKCR ".m\shell\submit"
284 
285  # namd
286  DeleteRegKey HKCR ".namd\shell\submit\command"
287  DeleteRegKey HKCR ".namd\shell\submit"
288 
289  # R
290  DeleteRegKey HKCR ".r\shell\submit\command"
291  DeleteRegKey HKCR ".r\shell\submit"
292
293  # CFX
294  DeleteRegKey HKCR ".def\shell\submit\command"
295  DeleteRegKey HKCR ".def\shell\submit"
296
297  # Fluent
298  DeleteRegKey HKCR ".fluent\shell\submit\command"
299  DeleteRegKey HKCR ".fluent\shell\submit"
300
301  # Bash
302  DeleteRegKey HKCR ".sh\shell\submit\command"
303  DeleteRegKey HKCR ".sh\shell\submit"
304
305  # Gausian
306  DeleteRegKey HKCR ".gjf\shell\submit\command"
307  DeleteRegKey HKCR ".gjf\shell\submit"
308  DeleteRegKey HKCR ".inp\shell\submit\command"
309  DeleteRegKey HKCR ".inp\shell\submit"
310  DeleteRegKey HKCR ".com\shell\submit\command"
311  DeleteRegKey HKCR ".com\shell\submit"
312
313# uninstallKey
314  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QCG-Icon"
315
316# Possible old registry entries
317  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "QCG-Icon"
318  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\qcg-icon"
319  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QCG icon"
320
321SectionEnd
322
323LangString successDeinstall ${LANG_POLISH} "Program $(^Name) zosta³ pomyœlnie usuniêty."
324LangString successDeinstall ${LANG_ENGLISH} "Program $(^Name) has been successfully removed."
325Function un.onUninstSuccess
326  HideWindow
327  MessageBox MB_ICONINFORMATION|MB_OK "$(successDeinstall)"
328FunctionEnd
Note: See TracBrowser for help on using the repository browser.