source: rtems/contrib/mingw/rtems-tools.nsi @ 7eb4d4b

4.104.114.84.95
Last change on this file since 7eb4d4b was be77d1f, checked in by Chris Johns <chrisj@…>, on Jul 21, 2006 at 12:04:20 AM

Add NSIS installer support for MinGW.

  • Property mode set to 100644
File size: 4.3 KB
Line 
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.
33Page 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
53ReserveFile "rtems.ini"
54!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
55
56Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (${RTEMS_TARGET})"
57OutFile "${RTEMS_BINARY}/rtems${PRODUCT_VERSION}-${RTEMS_TARGET}-${RTEMS_VERSION}.exe"
58InstallDir "C:\rtems"
59ShowInstDetails show
60ShowUnInstDetails show
61BrandingText "RTEMS ${RTEMS_TARGET} Tools v${PRODUCT_VERSION}"
62AllowRootDirInstall false
63AutoCloseWindow false
64CRCCheck force
65
66Section "RTEMS ${RTEMS_TARGET} Tools" SecTools
67 !insertmacro RTEMS_INSTALL_FILES
68SectionEnd
69
70Function .onInit
71  ;Extract InstallOptions INI files
72  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "rtems.ini"
73FunctionEnd
74
75Function 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
127FunctionEnd
128
129Section -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}"
141SectionEnd
142
143Function un.onInit
144 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \
145            "Are you sure you want to uninstall RTEMS Tools?" IDYES +2
146 Abort
147FunctionEnd
148
149Section 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
156SectionEnd
Note: See TracBrowser for help on using the repository browser.