-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathirida-uploader.nsi
36 lines (28 loc) · 1.09 KB
/
irida-uploader.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
[% extends "pyapp_w_pylauncher.nsi" %]
; from nsis documentation: http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
[% block sections %]
[[ super() ]]
Function .onInit
ReadRegStr $R0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
"UninstallString"
StrCmp $R0 "" done
MessageBox MB_OKCANCEL|MB_ICONINFORMATION \
"${PRODUCT_NAME} is already installed. $\n$\nThe old version will be uninstalled \
before installing ${PRODUCT_VERSION}. Click OK to remove the \
old version or Cancel to cancel the upgrade." \
IDOK uninst
Abort
;Run the uninstaller
uninst:
ClearErrors
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
IfErrors no_remove_uninstaller done
;You can either use Delete /REBOOTOK in the uninstaller or add some code
;here to remove the uninstaller. Use a registry key to check
;whether the user has chosen to uninstall. If you are using an uninstaller
;components page, make sure all sections are uninstalled.
no_remove_uninstaller:
done:
FunctionEnd
[% endblock sections %]