1 ; Script generated by the HM NIS Edit Script Wizard.
\r
3 ; HM NIS Edit Wizard helper defines
\r
4 !define PRODUCT_NAME "InspIRCd"
\r
5 !define PRODUCT_VERSION "1.1"
\r
6 !define PRODUCT_PUBLISHER "InspIRCd Development Team"
\r
7 !define PRODUCT_WEB_SITE "http://www.inspircd.org/"
\r
8 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\inspircd.exe"
\r
9 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
\r
10 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
\r
11 !define DOT_MAJOR "2"
\r
12 !define DOT_MINOR "0"
\r
16 ; MUI 1.67 compatible ------
\r
20 !define MUI_ABORTWARNING
\r
21 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\arrow2-install.ico"
\r
22 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\arrow2-uninstall.ico"
\r
25 !insertmacro MUI_PAGE_WELCOME
\r
27 !define MUI_LICENSEPAGE_CHECKBOX
\r
28 !insertmacro MUI_PAGE_LICENSE "..\docs\COPYING"
\r
30 !insertmacro MUI_PAGE_COMPONENTS
\r
32 !insertmacro MUI_PAGE_DIRECTORY
\r
34 !insertmacro MUI_PAGE_INSTFILES
\r
36 !define MUI_FINISHPAGE_RUN "$INSTDIR\InspGUI.exe"
\r
37 !define MUI_FINISHPAGE_RUN_PARAMETERS "--nofork"
\r
38 !insertmacro MUI_PAGE_FINISH
\r
41 !insertmacro MUI_UNPAGE_INSTFILES
\r
44 !insertmacro MUI_LANGUAGE "English"
\r
47 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
\r
51 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
\r
53 InstallDir "$PROGRAMFILES\InspIRCd"
\r
54 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
\r
55 ShowInstDetails show
\r
56 ShowUnInstDetails show
\r
58 Function IsDotNetInstalled
\r
61 StrCpy $1 "SOFTWARE\Microsoft\.NETFramework" ;registry entry to look in.
\r
65 ;Enumerate the versions installed.
\r
66 EnumRegKey $3 HKLM "$1\policy" $2
\r
68 ;If we don't find any versions installed, it's not here.
\r
69 StrCmp $3 "" noDotNet notEmpty
\r
71 ;We found something.
\r
73 ;Find out if the RegKey starts with 'v'.
\r
74 ;If it doesn't, goto the next key.
\r
76 StrCmp $4 "v" +1 goNext
\r
79 ;It starts with 'v'. Now check to see how the installed major version
\r
80 ;relates to our required major version.
\r
81 ;If it's equal check the minor version, if it's greater,
\r
82 ;we found a good RegKey.
\r
83 IntCmp $4 ${DOT_MAJOR} +1 goNext yesDotNetReg
\r
84 ;Check the minor version. If it's equal or greater to our requested
\r
85 ;version then we're good.
\r
87 IntCmp $4 ${DOT_MINOR} yesDotNetReg goNext yesDotNetReg
\r
90 ;Go to the next RegKey.
\r
95 ;Now that we've found a good RegKey, let's make sure it's actually
\r
96 ;installed by getting the install path and checking to see if the
\r
97 ;mscorlib.dll exists.
\r
98 EnumRegValue $2 HKLM "$1\policy\$3" 0
\r
99 ;$2 should equal whatever comes after the major and minor versions
\r
101 StrCmp $2 "" noDotNet
\r
102 ReadRegStr $4 HKLM $1 "InstallRoot"
\r
103 ;Hopefully the install root isn't empty.
\r
104 StrCmp $4 "" noDotNet
\r
105 ;build the actuall directory path to mscorlib.dll.
\r
106 StrCpy $4 "$4$3.$2\mscorlib.dll"
\r
107 IfFileExists $4 yesDotNet noDotNet
\r
110 MessageBox MB_OK "You do not have have v${DOT_MAJOR}.${DOT_MINOR} or greater of the .NET framework installed. This is required for the InspIRCd Monitor, however you can still launch the IRCd manually."
\r
113 ;Everything checks out. Go on with the rest of the installation.
\r
117 Section "Binary Executable" SEC01
\r
118 Call IsDotNetInstalled
\r
119 SetOutPath "$INSTDIR"
\r
120 SetOverwrite ifnewer
\r
121 File "..\bin\debug\InspGUI.exe"
\r
122 CreateDirectory "$SMPROGRAMS\InspIRCd"
\r
123 CreateShortCut "$SMPROGRAMS\InspIRCd\InspIRCd.lnk" "$INSTDIR\InspGUI.exe"
\r
124 SetOutPath "$INSTDIR\bin"
\r
125 SetOverwrite ifnewer
\r
126 File "..\bin\debug\bin\inspircd.exe"
\r
129 Section "Config Files" SEC02
\r
130 SetOutPath "$INSTDIR\conf"
\r
131 File "..\conf\inspircd.motd.example"
\r
132 File "..\conf\inspircd.helpop-full.example"
\r
133 File "..\conf\inspircd.helpop.example"
\r
134 File "..\conf\inspircd.filter.example"
\r
135 File "..\docs\inspircd.conf.example"
\r
136 File "..\conf\inspircd.censor.example"
\r
137 File "..\conf\inspircd.rules.example"
\r
138 File "..\conf\inspircd.quotes.example"
\r
141 Section "Command Handlers" SEC03
\r
142 SetOutPath "$INSTDIR\lib"
\r
143 File "..\bin\debug\lib\cmd_*.so"
\r
146 Section "Modules" SEC04
\r
147 SetOutPath "$INSTDIR\modules"
\r
148 File "..\bin\debug\modules\*.so"
\r
151 Section -AdditionalIcons
\r
152 SetOutPath $INSTDIR
\r
153 WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
\r
154 CreateShortCut "$SMPROGRAMS\InspIRCd\InspIRCd Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
\r
155 CreateShortCut "$SMPROGRAMS\InspIRCd\Uninstall.lnk" "$INSTDIR\uninst.exe"
\r
159 WriteUninstaller "$INSTDIR\uninst.exe"
\r
160 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\bin\inspircd.exe"
\r
161 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
\r
162 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
\r
163 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\inspircd.exe"
\r
164 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
\r
165 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
\r
166 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
\r
169 ; Section descriptions
\r
170 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
\r
171 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Actual Executable"
\r
172 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Default Config Files"
\r
173 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Command Modules"
\r
174 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Optional Modules"
\r
175 !insertmacro MUI_FUNCTION_DESCRIPTION_END
\r
178 Function un.onUninstSuccess
\r
180 MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
\r
184 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
\r
189 Delete "$INSTDIR\${PRODUCT_NAME}.url"
\r
190 Delete "$INSTDIR\uninst.exe"
\r
191 Delete "$INSTDIR\modules\m_*.so"
\r
192 Delete "$INSTDIR\lib\cmd_*.so"
\r
193 Delete "$INSTDIR\conf\inspircd.quotes.example"
\r
194 Delete "$INSTDIR\conf\inspircd.rules.example"
\r
195 Delete "$INSTDIR\conf\inspircd.censor.example"
\r
196 Delete "$INSTDIR\conf\inspircd.conf.example"
\r
197 Delete "$INSTDIR\conf\inspircd.filter.example"
\r
198 Delete "$INSTDIR\conf\inspircd.helpop.example"
\r
199 Delete "$INSTDIR\conf\inspircd.helpop-full.example"
\r
200 Delete "$INSTDIR\conf\inspircd.motd.example"
\r
201 Delete "$INSTDIR\bin\inspircd.exe"
\r
202 Delete "$INSTDIR\InspGUI.exe"
\r
204 Delete "$SMPROGRAMS\InspIRCd\Uninstall.lnk"
\r
205 Delete "$SMPROGRAMS\InspIRCd\InspIRCd Website.lnk"
\r
206 Delete "$SMPROGRAMS\InspIRCd\InspIRCd.lnk"
\r
208 RMDir "$SMPROGRAMS\InspIRCd"
\r
209 RMDir "$INSTDIR\modules"
\r
210 RMDir "$INSTDIR\lib"
\r
211 RMDir "$INSTDIR\conf"
\r
212 RMDir "$INSTDIR\bin"
\r
215 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
\r
216 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
\r