1 | ; |
---|
2 | ; $Id$ |
---|
3 | ; |
---|
4 | ; RTEMS Tools Installer. |
---|
5 | ; |
---|
6 | ; Copyright Chris Johns (chrisj@rtems.org) |
---|
7 | ; |
---|
8 | |
---|
9 | ;!define EMPTY_INSTALLER |
---|
10 | |
---|
11 | !define PRODUCT_NAME "RTEMS Tools" |
---|
12 | !define PRODUCT_VERSION ${RTEMS_VERSION} |
---|
13 | !define PRODUCT_PUBLISHER "RTEM Project Team" |
---|
14 | !define PRODUCT_WEB_SITE "http://www.rtems.org/" |
---|
15 | |
---|
16 | ; MUI 1.66 compatible ------ |
---|
17 | !include "MUI.nsh" |
---|
18 | |
---|
19 | ; MUI Settings |
---|
20 | !define MUI_ABORTWARNING |
---|
21 | !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico" |
---|
22 | !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico" |
---|
23 | |
---|
24 | !define MUI_HEADERIMAGE |
---|
25 | !define MUI_HEADERIMAGE_BITMAP "${RTEMS_LOGO}" |
---|
26 | |
---|
27 | !define MUI_COMPONENTSPAGE_SMALLDESC |
---|
28 | |
---|
29 | ; Welcome page |
---|
30 | !insertmacro MUI_PAGE_WELCOME |
---|
31 | ; Components page |
---|
32 | ; Details of what will happen. |
---|
33 | Page custom RTEMSMessage |
---|
34 | !insertmacro MUI_PAGE_COMPONENTS |
---|
35 | ; Directory page |
---|
36 | !insertmacro MUI_PAGE_DIRECTORY |
---|
37 | ; Instfiles page |
---|
38 | !insertmacro MUI_PAGE_INSTFILES |
---|
39 | ; Finish page |
---|
40 | !insertmacro MUI_PAGE_FINISH |
---|
41 | |
---|
42 | ; Uninstaller pages |
---|
43 | !insertmacro MUI_UNPAGE_INSTFILES |
---|
44 | |
---|
45 | ; Language files |
---|
46 | !insertmacro MUI_LANGUAGE "English" |
---|
47 | |
---|
48 | ; Reserve files |
---|
49 | !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS |
---|
50 | |
---|
51 | ; MUI end ------ |
---|
52 | |
---|
53 | ReserveFile "rtems.ini" |
---|
54 | !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS |
---|
55 | |
---|
56 | Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (${RTEMS_TARGET})" |
---|
57 | OutFile "${RTEMS_BINARY}/rtems${PRODUCT_VERSION}-${RTEMS_TARGET}-${RTEMS_VERSION}.exe" |
---|
58 | InstallDir "C:\rtems" |
---|
59 | ShowInstDetails show |
---|
60 | ShowUnInstDetails show |
---|
61 | BrandingText "RTEMS ${RTEMS_TARGET} Tools v${PRODUCT_VERSION}" |
---|
62 | AllowRootDirInstall false |
---|
63 | AutoCloseWindow false |
---|
64 | CRCCheck force |
---|
65 | |
---|
66 | Section "RTEMS ${RTEMS_TARGET} Tools" SecTools |
---|
67 | !insertmacro RTEMS_INSTALL_FILES |
---|
68 | SectionEnd |
---|
69 | |
---|
70 | Function .onInit |
---|
71 | ;Extract InstallOptions INI files |
---|
72 | !insertmacro MUI_INSTALLOPTIONS_EXTRACT "rtems.ini" |
---|
73 | FunctionEnd |
---|
74 | |
---|
75 | Function RTEMSMessage |
---|
76 | |
---|
77 | !insertmacro MUI_HEADER_TEXT \ |
---|
78 | "RTEMS Tools (${RTEMS_TARGET})" \ |
---|
79 | "A tool set for the RTEMS operating system." |
---|
80 | |
---|
81 | ;Display the Install Options dialog |
---|
82 | |
---|
83 | Push $R0 |
---|
84 | Push $R1 |
---|
85 | Push $R2 |
---|
86 | |
---|
87 | InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\rtems.ini" |
---|
88 | Pop $R0 |
---|
89 | |
---|
90 | GetDlgItem $R1 $R0 1200 ;1200 + Field number - 1 |
---|
91 | ;$R1 contains the HWND of the first field |
---|
92 | CreateFont $R2 "Tahoma" "8" "300" |
---|
93 | SendMessage $R1 ${WM_SETFONT} $R2 0 |
---|
94 | |
---|
95 | GetDlgItem $R1 $R0 1201 ;1200 + Field number - 1 |
---|
96 | ;$R1 contains the HWND of the first field |
---|
97 | CreateFont $R2 "Tahoma" "12" "700" |
---|
98 | SendMessage $R1 ${WM_SETFONT} $R2 0 |
---|
99 | |
---|
100 | GetDlgItem $R1 $R0 1202 ;1200 + Field number - 1 |
---|
101 | ;$R1 contains the HWND of the first field |
---|
102 | CreateFont $R2 "Tahoma" "9" "550" |
---|
103 | SendMessage $R1 ${WM_SETFONT} $R2 0 |
---|
104 | |
---|
105 | GetDlgItem $R1 $R0 1203 ;1200 + Field number - 1 |
---|
106 | ;$R1 contains the HWND of the first field |
---|
107 | CreateFont $R2 "Tahoma" "9" "550" |
---|
108 | SendMessage $R1 ${WM_SETFONT} $R2 0 |
---|
109 | |
---|
110 | GetDlgItem $R1 $R0 1204 ;1200 + Field number - 1 |
---|
111 | ;$R1 contains the HWND of the first field |
---|
112 | CreateFont $R2 "Tahoma" "9" "550" |
---|
113 | SendMessage $R1 ${WM_SETFONT} $R2 0 |
---|
114 | |
---|
115 | GetDlgItem $R1 $R0 1205 ;1200 + Field number - 1 |
---|
116 | ;$R1 contains the HWND of the first field |
---|
117 | CreateFont $R2 "Tahoma" "9" "550" |
---|
118 | SendMessage $R1 ${WM_SETFONT} $R2 0 |
---|
119 | |
---|
120 | InstallOptions::show |
---|
121 | Pop $R0 |
---|
122 | |
---|
123 | Pop $R2 |
---|
124 | Pop $R1 |
---|
125 | Pop $R0 |
---|
126 | |
---|
127 | FunctionEnd |
---|
128 | |
---|
129 | Section -Post |
---|
130 | WriteUninstaller "$INSTDIR\uninst.exe" |
---|
131 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \ |
---|
132 | "DisplayName" "$(^Name)" |
---|
133 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \ |
---|
134 | "UninstallString" "$INSTDIR\uninst.exe" |
---|
135 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \ |
---|
136 | "DisplayVersion" "${PRODUCT_VERSION}" |
---|
137 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \ |
---|
138 | "URLInfoAbout" "${PRODUCT_WEB_SITE}" |
---|
139 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \ |
---|
140 | "Publisher" "${PRODUCT_PUBLISHER}" |
---|
141 | SectionEnd |
---|
142 | |
---|
143 | Function un.onInit |
---|
144 | MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \ |
---|
145 | "Are you sure you want to uninstall RTEMS Tools?" IDYES +2 |
---|
146 | Abort |
---|
147 | FunctionEnd |
---|
148 | |
---|
149 | Section Uninstall |
---|
150 | Delete $INSTDIR\Uninst.exe |
---|
151 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" |
---|
152 | DetailPrint "Delete the install directory" |
---|
153 | !insertmacro RTEMS_DELETE_FILES |
---|
154 | DetailPrint "All done." |
---|
155 | SetAutoClose true |
---|
156 | SectionEnd |
---|