5 ;--------------------------------
10 ;--------------------------------
12 !define InstName "WinBoard"
13 !define InstVersion "4.2.7"
14 !define InstBaseDir "WinBoard-4.2.7"
16 ;--------------------------------
20 Name "${InstName} ${InstVersion}"
21 Caption "WinBoard - Chessboard For Windows"
22 OutFile "WinBoard-4.2.7_full.exe"
23 InstallDir $PROGRAMFILES\${InstBaseDir}
27 SetDatablockOptimize on
30 BGGradient 000000 4682b4 FFFFFF
33 ;--------------------------------
40 ;--------------------------------
43 ;!define MUI_ICON "knight.ico"
44 ;!define MUI_UNICON "wc_uninst.ico"
45 !define MUI_WELCOMEFINISHPAGE_BITMAP "welcome_chess.bmp"
47 ;--------------------------------
50 !define MUI_ABORTWARNING
51 ;!define MUI_COMPONENTSPAGE_NODESC
52 !define MUI_COMPONENTSPAGE_SMALLDESC
53 !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${InstName} ${InstVersion}.\n\n\n\n\nClick Next to continue."
54 !define MUI_LICENSEPAGE_TEXT_BOTTOM "$\nPress Continue to proceed with the installation."
55 !define MUI_LICENSEPAGE_BUTTON "Continue"
57 ;--------------------------------
59 ;--------------------------------
63 ;--------------------------------------------------------------------
64 !insertmacro MUI_PAGE_WELCOME
65 !insertmacro MUI_PAGE_LICENSE "..\READ_ME.txt"
66 !insertmacro MUI_PAGE_COMPONENTS
68 !insertmacro MUI_PAGE_DIRECTORY
70 ;Start Menu Folder Page Configuration
71 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
72 !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\WinBoard"
73 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
74 !insertmacro MUI_PAGE_STARTMENU Application $START_MENU_FOLDER
76 !insertmacro MUI_PAGE_INSTFILES
77 !insertmacro MUI_PAGE_FINISH
78 ;--------------------------------------------------------------------
82 ;!define MUI_WELCOMEPAGE_TEXT "WARNING! THIS UNINSTALLER WILL COMPLETELY DELETE THE INSTALLATION DIRECTORY\n\n$INSTDIR !!!\n\nIF THERE ARE ANY FILES YOU WISH TO SAVE, MOVE THEM FROM THE INSTALLATION DIRECTORY FIRST!\n\n\n\nPress Next to Continue."
83 !define MUI_WELCOMEPAGE_TEXT "This will uninstall WinBoard from directory:\n\n$INSTDIR\n\n\n\nPress Next to Continue."
84 !insertmacro MUI_UNPAGE_WELCOME
85 !insertmacro MUI_UNPAGE_CONFIRM
86 !insertmacro MUI_UNPAGE_INSTFILES
87 !insertmacro MUI_UNPAGE_FINISH
89 ;--------------------------------
92 !insertmacro MUI_LANGUAGE "English"
94 ;--------------------------------
96 ;--------------------------------
99 ;These files should be inserted before other files in the data block
100 ;Keep these lines before any File command
101 ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA)
104 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
106 ;--------------------------------
108 Section "WinBoard Core Components" Core
118 File ..\cygncurses7.dll
119 File ..\cygreadline5.dll
127 File ..\timestamp.exe
134 WriteUninstaller "$INSTDIR\UnInstall.exe"
136 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
138 CreateDirectory "$SMPROGRAMS\$START_MENU_FOLDER"
139 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Game Viewer.lnk" "$INSTDIR\winboard.exe" "-ncp" "$INSTDIR\winboard.exe" 1
140 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Game Viewer - Bobby Fischer.lnk" "$INSTDIR\winboard.exe" "-ncp -lgf RJF60.pgn" "$INSTDIR\winboard.exe" 1
141 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Game Viewer - Karpov vs Kasparov.lnk" "$INSTDIR\winboard.exe" "-ncp -lgf kk13.pgn" "$INSTDIR\winboard.exe" 1
142 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\WinBoard Help.lnk" "$INSTDIR\winboard.hlp"
143 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Frequently Asked Questions.lnk" "$INSTDIR\FAQ.html"
144 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\WinBoard READ_ME.lnk" "$INSTDIR\READ_ME.txt"
145 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\WinBoard UnInstall.lnk" "$INSTDIR\UnInstall.exe"
146 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Chess Server - chessclub.com.lnk" "$INSTDIR\winboard.exe" "-ics -icshost chessclub.com -icshelper timestamp" "$INSTDIR\winboard.exe" 0
147 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Chess Server - freechess.org.lnk" "$INSTDIR\winboard.exe" "-ics -icshost freechess.org -icshelper timeseal" "$INSTDIR\winboard.exe" 0
148 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Chess Server - Other.lnk" "$INSTDIR\winboard.exe" "-ics" "$INSTDIR\winboard.exe" 0
149 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\WinBoard Startup Dialog.lnk" "$INSTDIR\winboard.exe" "" "$INSTDIR\winboard.exe" 2
151 !insertmacro MUI_STARTMENU_WRITE_END
155 SubSection /e "Chess Engines" Engines
157 Section "GNU Chess 5.0" GNUChess5
159 SetOutPath "$INSTDIR"
166 File ..\gnuchess.README
168 CreateDirectory "$SMPROGRAMS\$START_MENU_FOLDER\Chess Engines"
170 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
172 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Chess Engines\GNU Chess 5.0 Documentation.lnk" "$INSTDIR\gnuches5.txt"
173 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Chess Engines\GNU Chess 5.0.lnk" "$INSTDIR\winboard.exe" "-cp -fcp 'GNUChes5 xboard' -scp 'GNUChes5 xboard'" "$INSTDIR\winboard.exe" 2
175 !insertmacro MUI_STARTMENU_WRITE_END
179 Section "GNU Chess 4.0" GNUChess4
181 SetOutPath "$INSTDIR"
187 CreateDirectory "$SMPROGRAMS\$START_MENU_FOLDER\Chess Engines"
189 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
191 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Chess Engines\GNU Chess 4.0 Documentation.lnk" "$INSTDIR\gnuchess.txt"
192 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Chess Engines\GNU Chess 4.0.lnk" "$INSTDIR\winboard.exe" "-cp -fcp GNUChess -scp GNUChess" "$INSTDIR\winboard.exe" 2
194 !insertmacro MUI_STARTMENU_WRITE_END
198 Section "Crafty 19.3" Crafty
200 SetOutPath "$INSTDIR\Crafty"
202 File ..\Crafty-WinBoard\wcrafty.exe
203 File ..\Crafty-WinBoard\book.bin
204 File ..\Crafty-WinBoard\books.bin
205 File ..\Crafty-WinBoard\Crafty.rc
206 File ..\Crafty-WinBoard\crafty.doc.txt
208 CreateDirectory "$SMPROGRAMS\$START_MENU_FOLDER\Chess Engines"
210 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
212 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Chess Engines\Crafty Documentation.lnk" "$INSTDIR\Crafty\crafty.doc.txt"
213 CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Chess Engines\Crafty 19.3.lnk" "$INSTDIR\winboard.exe" "-cp -fcp Crafty\wcrafty.exe -fd Crafty -scp Crafty\wcrafty.exe -sd Crafty" "$INSTDIR\winboard.exe" 2
215 !insertmacro MUI_STARTMENU_WRITE_END
223 ;--------------------------------
227 ;Extract InstallOptions INI files
228 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "FA.ini"
234 !insertmacro MUI_HEADER_TEXT "Windows File Associations" "Do you want to use Winboard as your viewer for the following file types?"
235 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "FA.ini"
238 ;Read a value from an InstallOptions INI file
240 !insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "FA.ini" "Field 2" "State"
242 ;Display a messagebox if check box was checked
243 StrCmp $INI_VALUE "1" "" CheckFEN
244 WriteRegStr HKCR ".pgn" "" "WinBoard.PGN"
245 WriteRegStr HKCR ".pgn" "Content Type" "application/x-chess-pgn"
246 WriteRegStr HKCR "WinBoard.PGN" "" "Chess Game"
247 WriteRegStr HKCR "WinBoard.PGN\DefaultIcon" "" "$INSTDIR\WinBoard.exe,1"
248 WriteRegStr HKCR "WinBoard.PGN\Shell\Open" "" "Open"
249 WriteRegStr HKCR "WinBoard.PGN\Shell\Open\command" "" '"$INSTDIR\WinBoard.exe" -ini "$INSTDIR\WinBoard.ini" -ncp -lgf "%1"'
252 !insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "FA.ini" "Field 3" "State"
254 ;Display a messagebox if check box was checked
255 StrCmp $INI_VALUE "1" "" Continue
256 WriteRegStr HKCR ".fen" "" "WinBoard.FEN"
257 WriteRegStr HKCR ".fen" "Content Type" "application/x-chess-fen"
258 WriteRegStr HKCR "WinBoard.FEN" "" "Chess Position"
259 WriteRegStr HKCR "WinBoard.FEN\DefaultIcon" "" "$INSTDIR\WinBoard.exe,1"
260 WriteRegStr HKCR "WinBoard.FEN\Shell\Open" "" "Open"
261 WriteRegStr HKCR "WinBoard.FEN\Shell\Open\command" "" '"$INSTDIR\WinBoard.exe" -ini "$INSTDIR\WinBoard.ini" -ncp -lpf "%1"'
267 ;--------------------------------
272 LangString DESC_Core ${LANG_ENGLISH} "Winboard Core Components - Executable and Help Files"
273 LangString DESC_Engines ${LANG_ENGLISH} "Chess Engines to play against using the WinBoard Interface"
274 LangString DESC_GNUChess5 ${LANG_ENGLISH} "GNU Chess 5.0 Engine"
275 LangString DESC_GNUChess4 ${LANG_ENGLISH} "GNU Chess 4.0 Engine"
276 LangString DESC_Crafty ${LANG_ENGLISH} "Crafty 19.3 Chess Engine, by Robert Hyatt"
279 ;Assign language strings to sections
281 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
282 !insertmacro MUI_DESCRIPTION_TEXT ${Core} $(DESC_Core)
283 !insertmacro MUI_DESCRIPTION_TEXT ${Engines} $(DESC_Engines)
284 !insertmacro MUI_DESCRIPTION_TEXT ${GNUChess5} $(DESC_GNUChess5)
285 !insertmacro MUI_DESCRIPTION_TEXT ${GNUChess4} $(DESC_GNUChess4)
286 !insertmacro MUI_DESCRIPTION_TEXT ${Crafty} $(DESC_Crafty)
287 !insertmacro MUI_FUNCTION_DESCRIPTION_END
289 ;--------------------------------
291 ;--------------------------------
294 ; Function to delete install directory if non-empty on user request
295 Function un.ForceDirectoryDelete
297 MessageBox MB_YESNO "The uninstaller was unable to delete the directory '$INSTDIR'. This is usually$\r$\ndue to user-created files such as WinBoard.ini, or other configuration files. If$\r$\nyou wish to keep your old configuration files, select No.$\r$\n$\r$\nForce deletion of install directory and all files in it?" IDNO End
308 Delete "$INSTDIR\bughouse.bat"
309 Delete "$INSTDIR\ChangeLog"
310 Delete "$INSTDIR\COPYING"
311 Delete "$INSTDIR\COPYRIGHT"
312 Delete "$INSTDIR\cygncurses7.dll"
313 Delete "$INSTDIR\cygreadline5.dll"
314 Delete "$INSTDIR\cygwin1.dll"
315 Delete "$INSTDIR\FAQ.html"
316 Delete "$INSTDIR\kk13.pgn"
317 Delete "$INSTDIR\NEWS"
318 Delete "$INSTDIR\READ_ME.txt"
319 Delete "$INSTDIR\RJF60.pgn"
320 Delete "$INSTDIR\timeseal.exe"
321 Delete "$INSTDIR\timestamp.exe"
322 Delete "$INSTDIR\winboard.exe"
323 Delete "$INSTDIR\winboard.hlp"
324 Delete "$INSTDIR\zippy.lines"
325 Delete "$INSTDIR\zippy.README"
326 Delete "$INSTDIR\book.dat"
327 Delete "$INSTDIR\GNUChes5.exe"
328 Delete "$INSTDIR\gnuches5.txt"
329 Delete "$INSTDIR\gnuchess.dat"
330 Delete "$INSTDIR\gnuchess.lan"
331 Delete "$INSTDIR\gnuchess.README"
332 Delete "$INSTDIR\gnuchesr.exe"
333 Delete "$INSTDIR\GNUChess.exe"
334 Delete "$INSTDIR\gnuchess.txt"
335 Delete "$INSTDIR\UnInstall.exe"
336 Delete "$INSTDIR\Crafty\wcrafty.exe"
337 Delete "$INSTDIR\Crafty\book.bin"
338 Delete "$INSTDIR\Crafty\books.bin"
339 Delete "$INSTDIR\Crafty\Crafty.rc"
340 Delete "$INSTDIR\Crafty\crafty.doc.txt"
341 RMDir "$INSTDIR\Crafty"
345 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
347 RMDir /r "$SMPROGRAMS\$MUI_TEMP"
349 ReadRegStr $1 HKCR ".pgn" ""
350 StrCmp $1 "WinBoard.PGN" "" DelFEN
351 ReadRegStr $1 HKCR "WinBoard.PGN\Shell\Open\command" ""
352 StrCmp $1 '"$INSTDIR\WinBoard.exe" -ini "$INSTDIR\WinBoard.ini" -ncp -lgf "%1"' "" DelFEN
353 DeleteRegKey HKCR ".pgn"
354 DeleteRegKey HKCR "WinBoard.PGN"
358 ReadRegStr $1 HKCR ".fen" ""
359 StrCmp $1 "WinBoard.FEN" "" ContDelFEN
360 ReadRegStr $1 HKCR "WinBoard.FEN\Shell\Open\command" ""
361 StrCmp $1 '"$INSTDIR\WinBoard.exe" -ini "$INSTDIR\WinBoard.ini" -ncp -lpf "%1"' "" ContDelFEN
362 DeleteRegKey HKCR ".fen"
363 DeleteRegKey HKCR "WinBoard.FEN"
367 DeleteRegKey HKCU "Software\WinBoard"
370 IfFileExists "$INSTDIR\*.*" GoDirDel Continue
373 Call un.ForceDirectoryDelete