1.8 Creating a Windows setup.exe (unnecessary for most people)
This is not for the faint-hearted. There are several steps necessary and it will need quite a bit of manual intervention. As with most things in life, there is more than one way of doing it, but this works for me and does not require you to spend money on expensive Microsoft development tools.
- Install Mingw, which is a set of GNU programs for software development, that run under
Microsoft Windows. To get Mingw I downloaded the Bloodshed C++ development kit (I used version 4.9.9.2). This is full-featured development environment with a nice
graphical interface, but I did not use any of the graphical bits. I literally just used the
command line tools that form part of it. No doubt if you wanted to mess around creating a project file
you could use the GUI, but I did not bother. The installation program installed the
gcc
compiler,make
and other bits needed into the directory
C:\Dev-Cpp\bin
- Install Tcl/Tk. Since you now have a compiler, you do could do it from the Tcl/Tk source code, but I did not bother, but instead used ActiveTcl which is a free binary distribution of Tcl and Tk.
- Download the ChessDB source code, which will be in a file with the extension .tar.gz. I believe
Winzip and no doubt some free tools will decompress that for you and extract them to a directory.
Use the directory
M:\ChessDB
if possible, since one of the files that is used to create a windows installer assumes that directory is used. If not, you will have to change that file too. - Edit the path at the top of the
Makefile.mingw
which is part of the ChessDB source code. Set this to point to the location where the development tools are installed. For me, this is:
MINGW_BIN = C:\Dev-Cpp\bin
-
Open a command tool (DOS BOX) in Windows (
cmd.exe
orcommand.com
), change to the directory where the source files are and issue the following command:
C:\Dev-Cpp\bin\make -f Makefile.mingw
All being well, that will build chessdb.exe, chessdb.gui and various other files into the directory C:\ ChessDB\bin, C:\ChessDB\share and so on. It would be possible to manually install all the files, but it would be error prone, so a setup.exe is created. - Download and install ISTool which allows you to generate a setup.exe for Windows.
-
Next you will need to create a configuration file for ISTool, which defines what files will be copied into the setup.exe and where they will be placed during installation. Here is a sample configuration script, which is included in the source distribution as ChessDB-with-crafty.iss
A few important but not so obvious files that needs to be installed are:
- The .exe files (chessdblt.exe, eco2epd.exe, crafty.exe, pgnchessdb.exe, scmerge.exe, tcchessdb.exe and chessddb.exe) go into C:\Program Files\ChessDB\bin
- chessdb.gui, tcl84.dll and tk84.dll also go into C:\Program Files\ChessDB\bin
- The snack2.2 (sound), tcl8.4 and tk8.4 directories must be installed at C:\Program Files\ChessDB\lib
The directory structure will look similar (but not identical) to this.
C:\> Program Files C:\> Program Files\ChessDB C:\> Program Files\ChessDB\bin C:\> Program Files\ChessDB\bin\config C:\> Program Files\ChessDB\bin\data C:\> Program Files\ChessDB\bin\log C:\> Program Files\ChessDB\bin\sounds C:\> Program Files\ChessDB\lib C:\> Program Files\ChessDB\lib\snack2.2 C:\> Program Files\ChessDB\lib\tcl8.4 C:\> Program Files\ChessDB\lib\tcl8.4\encoding C:\> Program Files\ChessDB\lib\tcl8.4\msgcat1.3 C:\> Program Files\ChessDB\lib\tk8.4 C:\> Program Files\ChessDB\lib\tk8.4\images C:\> Program Files\ChessDB\lib\tk8.4\msgs C:\> Program Files\ChessDB\bitmaps C:\> Program Files\ChessDB\bitmaps2 C:\> Program Files\ChessDB\help
That directory structure was generated some time back, withh an ISTool script which was a little different from that below.. If the language used by InnoSetup is not one of the "Official translations" then you can download it from here:
http://www.jrsoftware.org/files/istrans/and copy it to the subdirectory "Languages" in InnoSetup to be able to use it in InnoSetup. This is done here for the "Unofficial translations" for Serbian and Swedish...
; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "ChessDB" #define MyAppVerName "ChessDB 3.6.7" #define MyAppPublisher "Dr. David Kirkby" #define MyAppURL "http://chessdb.sourceforge.net " #define MyAppExeName "bin\chessdb.exe" [Setup] AppName={#MyAppName} AppVerName={#MyAppVerName} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} DefaultDirName={pf}\{#MyAppName} DefaultGroupName={#MyAppName} LicenseFile=M:\ChessDB\COPYING InfoBeforeFile=M:\ChessDB\Pre-installation-notes.txt InfoAfterFile=M:\ChessDB\Post-installation-notes.txt OutputBaseFilename=setup SetupIconFile=M:\ChessDB\chessdb.ico Compression=lzma/ultra InternalCompressLevel=ultra SolidCompression=true [Languages] Name: english; MessagesFile: compiler:Default.isl Name: brazilianportuguese; MessagesFile: compiler:Languages\BrazilianPortuguese.isl Name: czech; MessagesFile: compiler:Languages\Czech.isl Name: dutch; MessagesFile: compiler:Languages\Dutch.isl Name: french; MessagesFile: compiler:Languages\French.isl Name: german; MessagesFile: compiler:Languages\German.isl Name: hungarian; MessagesFile: compiler:Languages\Hungarian.isl Name: italian; MessagesFile: compiler:Languages\Italian.isl Name: norwegian; MessagesFile: compiler:Languages\Norwegian.isl Name: polish; MessagesFile: compiler:Languages\Polish.isl Name: serbian; MessagesFile: compiler:Languages\Serbian.isl Name: spanish; MessagesFile: compiler:Languages\Spanish.isl Name: swedish; MessagesFile: compiler:Languages\Swedish.isl [Tasks] Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked [Files] Source: M:\chessdb\chessdb.eco; DestDir: {app}\bin\data; Flags: ignoreversion Source: M:\chessdb\chessdb.gui; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\chessdb.exe; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\chessdblet.exe; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\chessdbt.exe; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\eco2epd.exe; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\pgnchessdb.exe; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\scmerge.exe; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\bitmaps\*; DestDir: {app}\bitmaps; Flags: ignoreversion recursesubdirs createallsubdirs Source: M:\chessdb\bitmaps2\*; DestDir: {app}\bitmaps2; Flags: ignoreversion recursesubdirs createallsubdirs Source: M:\chessdb\lib\*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs createallsubdirs Source: M:\chessdb\sounds\*; DestDir: {app}\bin\sounds; Flags: ignoreversion recursesubdirs createallsubdirs Source: M:\chessdb\tablebases\*; DestDir: {app}\tablebases; Flags: ignoreversion recursesubdirs createallsubdirs Source: M:\chessdb\README.txt; DestDir: {app}; Flags: ignoreversion Source: M:\chessdb\COPYING; DestDir: {app}; Flags: ignoreversion Source: M:\chessdb\ChangeLog; DestDir: {app}; Flags: ignoreversion Source: M:\chessdb\Tutorial\*; DestDir: {app}\tutorial; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files Source: M:\chessdb\bin\tcl84.dll; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\bin\tk84.dll; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\bin\crafty.rc; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\bin\crafty.exe; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\bin\position.lrn; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\bin\position.bin; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\ratings.ssp; DestDir: {app}\bin; Flags: ignoreversion Source: M:\chessdb\chessdb.eco; DestDir: {app}\data; Flags: ignoreversion [Icons] Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName} Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {#MyAppURL} Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe} Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon Name: {group}\Tutorial (local copy); Filename: {app}\tutorial\index.html [Run] Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent
- Select Project->Compile Setup in ISTool and the program will attempt to put all the files into a single setup.exe which is compressed.
- If there are any errors, such as a file missing, or having the wrong permissions, the compiler will make you aware of this, but otherwise it will generate the setup.exe
- Carefully test the setup.exe
If you would like to contribute to the tutorial or see anything that should be updated, corrected or improved, please contact David Kirkby. But please note David only speaks English.
Website administered by Dr. David Kirkby
This page was last modified: September 16, 2007. 10:41:38 am GMT