14
|
1 |
; ExperienceUI installation
|
|
2 |
Name "ExperienceUI SDK"
|
|
3 |
|
|
4 |
SetCompressor /final /solid lzma
|
|
5 |
|
15
|
6 |
!define XPUI_ABORTWARNING
|
14
|
7 |
!define XPUI_SYSDIR ".\Contrib\ExperienceUI"
|
|
8 |
!include "${XPUI_SYSDIR}\XPUI.nsh"
|
15
|
9 |
Caption "$(^Name) v${XPUI_VERSION} Setup"
|
14
|
10 |
OutFile "experienceui-${XPUI_VERSION}.exe"
|
|
11 |
InstallDir "$PROGRAMFILES\NSIS\ExperienceUI"
|
|
12 |
InstallDirRegKey HKLM "Software\NSIS\ExperienceUI" ""
|
|
13 |
RequestExecutionLevel admin
|
|
14 |
|
|
15 |
${Page} Welcome2
|
|
16 |
${LicensePage} "Contrib\ExperienceUI\License.rtf"
|
|
17 |
${Page} Directory
|
|
18 |
${Page} InstConfirm
|
|
19 |
${Page} InstFiles
|
15
|
20 |
${Page} Abort
|
14
|
21 |
|
|
22 |
${UnPage} Welcome2
|
|
23 |
${UnPage} UnConfirm
|
|
24 |
${UnPage} InstFiles
|
|
25 |
${UnPage} Finish
|
|
26 |
|
|
27 |
${Language} English
|
|
28 |
|
|
29 |
Function .onInit
|
|
30 |
ClearErrors
|
|
31 |
ReadRegStr $0 HKLM "Software\NSIS" ""
|
|
32 |
IfErrors 0 +2
|
|
33 |
Return
|
|
34 |
|
|
35 |
; Set installation dir only if the ExUI is not installed
|
|
36 |
ClearErrors
|
|
37 |
ReadRegStr $R0 HKLM "Software\NSIS\ExperienceUI" ""
|
|
38 |
IfErrors +2
|
|
39 |
Return
|
|
40 |
|
|
41 |
StrCpy $INSTDIR "$0\ExperienceUI"
|
|
42 |
FunctionEnd
|
|
43 |
|
|
44 |
Section
|
|
45 |
SetOutPath $INSTDIR
|
|
46 |
File /r Contrib
|
|
47 |
File /r Docs
|
|
48 |
File /r Examples
|
|
49 |
File /r Include
|
|
50 |
File /r Plugins
|
|
51 |
|
|
52 |
; Write install dir
|
|
53 |
WriteRegStr HKLM "Software\NSIS\ExperienceUI" "" "$INSTDIR"
|
|
54 |
|
|
55 |
; Write uninstaller
|
|
56 |
WriteUninstaller "$INSTDIR\uninstall-exui.exe"
|
|
57 |
|
|
58 |
; Registry stuff
|
|
59 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "DisplayName" "$(^Name)"
|
|
60 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "UninstallString" "$INSTDIR\uninstall-exui.exe"
|
|
61 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" "DisplayIcon" "$INSTDIR\Contrib\Graphics\Icons\XPUI-install.ico"
|
|
62 |
|
|
63 |
; Register with NSIS
|
|
64 |
ClearErrors
|
|
65 |
ReadRegStr $0 HKLM "Software\NSIS" ""
|
|
66 |
IfErrors 0 +3
|
|
67 |
; NSIS not found
|
|
68 |
MessageBox MB_OK|MB_ICONEXCLAMATION "Setup did not detect NSIS on your system. Integrating the ExperienceUI with NSIS will be your job once you install NSIS."
|
|
69 |
Return
|
|
70 |
|
|
71 |
MessageBox MB_YESNO|MB_ICONQUESTION "Found NSIS installation at $0. Do you want to register the ExperienceUI SDK with this copy of NSIS?$\n$\n(If you don't, you'll have to specify the full path to XPUI.nsh in your scripts.)" IDYES +2
|
|
72 |
Return
|
|
73 |
|
|
74 |
; Write in .nsh
|
|
75 |
; $0 = NSIS installation dir
|
|
76 |
ClearErrors
|
|
77 |
FileOpen $1 "$0\Include\XPUI.nsh" "w"
|
|
78 |
FileWrite $1 "!define XPUI_SYSDIR $\"$INSTDIR\Contrib\ExperienceUI$\"$\r$\n"
|
|
79 |
FileWrite $1 "!include $\"$$"
|
|
80 |
; stupid compiler bugs...
|
|
81 |
FileWrite $1 "{XPUI_SYSDIR}\XPUI.nsh$\"$\r$\n"
|
|
82 |
FileClose $0
|
|
83 |
SectionEnd
|
|
84 |
|
|
85 |
Section "Uninstall"
|
|
86 |
Delete "$INSTDIR\uninstall-exui.exe"
|
|
87 |
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
|
|
88 |
DeleteRegKey HKLM "Software\NSIS\ExperienceUI"
|
|
89 |
|
|
90 |
; The goal here: completely clean up the ExperienceUI, but if
|
|
91 |
; there's other stuff, don't touch it
|
|
92 |
|
|
93 |
; Remember, only RmDir /r removes directories with files.
|
|
94 |
; Otherwise, it only removes fully empty directories.
|
|
95 |
|
|
96 |
; Contrib
|
|
97 |
RmDir /r "$INSTDIR\Contrib\ExperienceUI"
|
|
98 |
Delete "$INSTDIR\Contrib\Graphics\Icons\XPUI-install.ico"
|
|
99 |
Delete "$INSTDIR\Contrib\Graphics\Icons\XPUI-uninstall.ico"
|
|
100 |
RmDir "$INSTDIR\Contrib\Graphics\Icons"
|
|
101 |
RmDir "$INSTDIR\Contrib\Graphics"
|
|
102 |
RmDir "$INSTDIR\Contrib"
|
|
103 |
|
|
104 |
; Docs
|
|
105 |
RmDir /r "$INSTDIR\Docs\ExperienceUI"
|
|
106 |
RmDir "$INSTDIR\Docs"
|
|
107 |
|
|
108 |
; Examples
|
|
109 |
RmDir /r "$INSTDIR\Examples\ExperienceUI"
|
|
110 |
RmDir "$INSTDIR\Examples"
|
|
111 |
|
|
112 |
; Include
|
|
113 |
Delete "$INSTDIR\Include\NSISArray.nsh"
|
|
114 |
Delete "$INSTDIR\Include\RecFind.nsh"
|
|
115 |
Delete "$INSTDIR\Include\system.nsh"
|
|
116 |
Delete "$INSTDIR\Include\XPUI.nsh"
|
|
117 |
RmDir "$INSTDIR\Include"
|
|
118 |
|
|
119 |
; Plugins
|
|
120 |
Delete "$INSTDIR\Plugins\DcryptDll.dll"
|
|
121 |
Delete "$INSTDIR\Plugins\messagebox.dll"
|
|
122 |
Delete "$INSTDIR\Plugins\newadvsplash.dll"
|
|
123 |
Delete "$INSTDIR\Plugins\NSISArray.dll"
|
|
124 |
Delete "$INSTDIR\Plugins\WAnsis.dll"
|
|
125 |
Delete "$INSTDIR\Plugins\ZipDLL.dll"
|
|
126 |
RmDir "$INSTDIR\Plugins"
|
|
127 |
|
|
128 |
RmDir "$INSTDIR"
|
|
129 |
|
|
130 |
ClearErrors
|
|
131 |
ReadRegStr $0 HKLM "Software\NSIS" ""
|
|
132 |
IfErrors +2
|
|
133 |
Return
|
|
134 |
|
|
135 |
Delete "$0\Include\XPUI.nsh"
|
|
136 |
|
|
137 |
SectionEnd |