source: branches/irods-mockup/installer.nsi @ 247

Revision 247, 12.4 KB checked in by bartek, 11 years ago (diff)

copy for create the irods mockup

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.4.1"
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\JarSync-0.3.jar"
115  File "dist\lib\QCGComputingSDK-3.0.0.jar"
116  File "dist\lib\QCGCoreSDK-3.0.0.jar"
117  File "dist\lib\activation-1.1.jar"
118  File "dist\lib\avalon-framework-4.1.3.jar"
119  File "dist\lib\bcprov-jdk16-1.46.jar"
120  File "dist\lib\canl-1.1.0.jar"
121  File "dist\lib\commons-io-1.4.jar"
122  File "dist\lib\commons-logging-1.1.jar"
123  File "dist\lib\gss-2.1-SNAPSHOT.jar"
124  File "dist\lib\jaxb-api-2.1.jar"
125  File "dist\lib\jaxb-impl-2.1.6.jar"
126  File "dist\lib\jaxws-api-2.1.jar"
127  File "dist\lib\jaxws-rt-2.1.3.jar"
128  File "dist\lib\jsch-0.1.49.jar"
129  File "dist\lib\jsr181-api-1.0-MR1.jar"
130  File "dist\lib\jsr250-api-1.0.jar"
131  File "dist\lib\jsse-2.1-SNAPSHOT.jar"
132  File "dist\lib\junit-3.8.jar"
133  File "dist\lib\log4j-1.2.12.jar"
134  File "dist\lib\logkit-1.0.1.jar"
135  File "dist\lib\mimepull-1.1.jar"
136  File "dist\lib\not-yet-commons-ssl-0.3.11.jar"
137  File "dist\lib\resolver-20050927.jar"
138  File "dist\lib\saaj-api-1.3.jar"
139  File "dist\lib\saaj-impl-1.3.jar"
140  File "dist\lib\servlet-api-2.3.jar"
141  File "dist\lib\sjsxp-1.0.jar"
142  File "dist\lib\ssl-proxies-2.1-SNAPSHOT.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\swing-layout-1.0.4.jar"
147  File "dist\lib\voms-api-java-3.0.0.jar"
148  File "dist\lib\webservices-api-1.1.2-SNAPSHOT.jar"
149  File "dist\lib\xmlsec-2.0.jar"
150  File "dist\lib\jsch-0.1.49.jar"
151  SetOutPath "$INSTDIR\resources"
152  File "resources\qcg-logo-stones-16.png"
153  SetOutPath "$INSTDIR"
154  File "dist\QCG-Icon.jar"
155  File "dist_static\qcg-icon.exe"
156  File "dist_static\config.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\QCG-Icon.jar"
222  Delete "$INSTDIR\qcg-icon.exe"
223  Delete "$INSTDIR\resources\qcg-logo-stones-16.png"
224  Delete "$INSTDIR\lib\xmlsec-2.0.jar"
225  Delete "$INSTDIR\lib\webservices-api-1.1.2-SNAPSHOT.jar"
226  Delete "$INSTDIR\lib\voms-api-java-3.0.0.jar"
227  Delete "$INSTDIR\lib\streambuffer-0.7.jar"
228  Delete "$INSTDIR\lib\stax-ex-1.2.jar"
229  Delete "$INSTDIR\lib\stax-api-1.0.jar"
230  Delete "$INSTDIR\lib\ssl-proxies-2.1-SNAPSHOT.jar"
231  Delete "$INSTDIR\lib\sjsxp-1.0.jar"
232  Delete "$INSTDIR\lib\servlet-api-2.3.jar"
233  Delete "$INSTDIR\lib\saaj-impl-1.3.jar"
234  Delete "$INSTDIR\lib\saaj-api-1.3.jar"
235  Delete "$INSTDIR\lib\resolver-20050927.jar"
236  Delete "$INSTDIR\lib\not-yet-commons-ssl-0.3.11.jar"
237  Delete "$INSTDIR\lib\mimepull-1.1.jar"
238  Delete "$INSTDIR\lib\logkit-1.0.1.jar"
239  Delete "$INSTDIR\lib\log4j-1.2.12.jar"
240  Delete "$INSTDIR\lib\junit-3.8.jar"
241  Delete "$INSTDIR\lib\jsse-2.1-SNAPSHOT.jar"
242  Delete "$INSTDIR\lib\jsr250-api-1.0.jar"
243  Delete "$INSTDIR\lib\jsr181-api-1.0-MR1.jar"
244  Delete "$INSTDIR\lib\jsch-0.1.49.jar"
245  Delete "$INSTDIR\lib\jce-jdk13-131-CURRENT.jar"
246  Delete "$INSTDIR\lib\jaxws-rt-2.1.3.jar"
247  Delete "$INSTDIR\lib\jaxws-api-2.1.jar"
248  Delete "$INSTDIR\lib\jaxb-impl-2.1.6.jar"
249  Delete "$INSTDIR\lib\jaxb-api-2.1.jar"
250  Delete "$INSTDIR\lib\gss-2.1-SNAPSHOT.jar"
251  Delete "$INSTDIR\lib\commons-logging-1.1.jar"
252  Delete "$INSTDIR\lib\commons-io-1.4.jar"
253  Delete "$INSTDIR\lib\canl-1.1.0.jar"
254  Delete "$INSTDIR\lib\bcprov-jdk16-1.46.jar"
255  Delete "$INSTDIR\lib\avalon-framework-4.1.3.jar"
256  Delete "$INSTDIR\lib\activation-1.1.jar"
257  Delete "$INSTDIR\lib\QCGCoreSDK-3.0.0.jar"
258  Delete "$INSTDIR\lib\QCGComputingSDK-3.0.0.jar"
259  Delete "$INSTDIR\lib\JarSync-0.3.jar"
260
261
262  Delete "$INSTDIR\config.properties"
263  Delete "$INSTDIR\certs\8a661490.signing_policy"
264  Delete "$INSTDIR\certs\8a661490.0"
265  Delete "$INSTDIR\logging.properties"
266  Delete "$INSTDIR\qcg-icon.log"
267  Delete "$INSTDIR\qcg-icon.log.1"
268  Delete "$INSTDIR\uninst.exe"
269  Delete "$INSTDIR\certs\*"
270
271  RMDir "$INSTDIR\resources"
272  RMDir "$INSTDIR\lib"
273  RMDir "$INSTDIR\certs"
274  RMDir "$INSTDIR"
275 
276  # autostart
277  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "QCG-Icon"
278 
279  # Menu Start
280  Delete "$SMPROGRAMS\qcg-icon.lnk"
281 
282  # matlab
283  DeleteRegKey HKCR ".m\shell\submit\command"
284  DeleteRegKey HKCR ".m\shell\submit"
285 
286  # namd
287  DeleteRegKey HKCR ".namd\shell\submit\command"
288  DeleteRegKey HKCR ".namd\shell\submit"
289 
290  # R
291  DeleteRegKey HKCR ".r\shell\submit\command"
292  DeleteRegKey HKCR ".r\shell\submit"
293
294  # CFX
295  DeleteRegKey HKCR ".def\shell\submit\command"
296  DeleteRegKey HKCR ".def\shell\submit"
297
298  # Fluent
299  DeleteRegKey HKCR ".fluent\shell\submit\command"
300  DeleteRegKey HKCR ".fluent\shell\submit"
301
302  # Bash
303  DeleteRegKey HKCR ".sh\shell\submit\command"
304  DeleteRegKey HKCR ".sh\shell\submit"
305
306  # Gausian
307  DeleteRegKey HKCR ".gjf\shell\submit\command"
308  DeleteRegKey HKCR ".gjf\shell\submit"
309  DeleteRegKey HKCR ".inp\shell\submit\command"
310  DeleteRegKey HKCR ".inp\shell\submit"
311  DeleteRegKey HKCR ".com\shell\submit\command"
312  DeleteRegKey HKCR ".com\shell\submit"
313
314# uninstallKey
315  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QCG-Icon"
316
317# Possible old registry entries
318  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "QCG-Icon"
319  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\qcg-icon"
320  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QCG icon"
321
322SectionEnd
323
324LangString successDeinstall ${LANG_POLISH} "Program $(^Name) zosta³ pomyœlnie usuniêty."
325LangString successDeinstall ${LANG_ENGLISH} "Program $(^Name) has been successfully removed."
326Function un.onUninstSuccess
327  HideWindow
328  MessageBox MB_ICONINFORMATION|MB_OK "$(successDeinstall)"
329FunctionEnd
Note: See TracBrowser for help on using the repository browser.