-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.txt
291 lines (196 loc) · 11.8 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
********************************************************************
* An introduction to compile Locate32 sources using SVN repository *
********************************************************************
* Changes: *
* 31.12.07 Janne Huttunen: initial version *
* 02.10.08 Janne Huttunen: Notification about VS2008 solutions
********************************************************************
Table of Contents
1. Preface
2. Downloading sources
3. Preliminary arrangements
4. Building sources
5. Using Visual Studio 2005
6. Other compilers
********************************************************************
1. Preface
********************************************************************
This file is intended to be a guide for downloading sources from SVN repository
and compiling them. Instructions given this guide is dedicated for MS Visual Studio 2008
(Visual Studio 2005, see note below). This is due to the fact that I haven't tried other
compilers yet. If you have managed to compile the sources using some other compiler,
please contact the author ([email protected]) and share your experiences with us.
You can also contact the author if you have comments or problems, or if something
did went like described in this file. All comments are also very welcome. If you wish,
you can also modify this document directly to add better description or just for spell checking.
You can send the modified file to the author via email or upload the file directly to SVN
repository (if you ave an account to the repository).
********************************************************************
2. Downloading sources
********************************************************************
At first, you need download the sources from the Locate32's SVN
repository. To do this, you need a SVN client. If you haven't any SVN clients
installed, I suggest you to try TortoiseSVN (http://tortoisesvn.tigris.org/),
which is a very extensive and simple SVN client.
The operation of downloading sources first time from the repository is called as "Checkout".
The checkout sources using TortoiseSVN, you just need to riht-click some directory
in Windows Explorer and choose "SVN Checkout". When a dialog appears, you should type
correct URL (http://svn.locate32.net/locate32) and checkout directory (the target directory,
for example "C:\My documents\locate-sources") and press OK. Then Locate32's sources
are downloaded to the chosen target directory.
The source directory can be updated to correspond the latest sources by right-clicking
the source directory in Windows Explorer and choosing "SVN Update".
********************************************************************
3. Preliminary arrangements
********************************************************************
To compile the sources, you need some libraries which are not included to the repository.
These libraries are bzip2 (http://www.bzip.org), PRRE (http://www.pcre.org/) and MD5 library
(http://256.com/sources/md5/). Compiled binaries for these libraries can be found from
the Locate32 source packages (http://www.locate32.net/files/sources/). This source package
contains also a library called parsers which is also required to compile Locate32 sources but is
not included into the SVN repository. So easiest way is to download the latest source package
and grab required libraries from it (see instructions below to see where to put these libraries).
Locate32 uses my own class library called HFC. Therefore, to compile Locate32 sources, you need
to compile HFC library first (the source package contains HFC library binaries but those
are old).
The HFC library can be compiled using Visual Studio solution files. However, these solution
files copies compiled library files to a certain directory which you have initialize first.
To do that, do the following steps:
1. Create a directory for HFC library binaries. In this guide this directory is "C:\HFC", but
you can also use other names.
2. Extract directories 3rdparty, bin, include, lib andlib64 from the source package to this
directory. Note that these lib, lib64 and 3rdparty directories contain the required libraries
mentioned above.
3. Set environment variable HFCROOT with value "C:\HFC" (or the directory you crated, no apostrophes).
To set environment variables in Windows 2000/XP, right-click "My Computer" icon and choose
Properties from the pop up menu to open System Properties dialog. Environment Variables can
be found from Advanced tab.
4. You need to setup Visual Studio to use these include and library paths. To do this on
Visual Studio 2008, choose Tools -> Options from the menu and choose
"Projects and Solutions" -> "VC++ Directories" from the list on left. Specify the following
directories (change "C:\HFC" to correspond your own path if necessary):
"C:\HFC\include" and "C:\HFC\3rdparty\include" for include files (both Win32 and x64 platform)
"C:\HFC\lib" and "C:\HFC\3rdparty\lib" for include files (Win32 platform)
"C:\HFC\lib64" and "C:\HFC\3rdparty\lib64" for include files (x64 platform)
You can ignore x64 bit platform if you have no 64 bit compilers installed.
5. To compile the language file (lan_en.dll) and the help file, you need to setup lrestool.
First, ensure that lrestool.exe (which is in bin directory) "is in path" so that it can
be found without specifying to the whole path to lrestool.exe file. In other words, check that
that the environment variable PATH contains directory "C:\HFC\bin". Then give the following
commands in the command prompt (change C:\My documents\locate-sources to correspond your
source directory):
lrestool -Ra LOCATE32 "C:\My documents\locate-sources\Locate\Locate32\lres_base.rc
lrestool -Ha LOCATE32 "C:\My documents\locate-sources\Locate\hlp\page_raw.htm
********************************************************************
4. Building sources
********************************************************************
After you have made all initializations described above, building should be very easy task.
First, to compile HFC library, open HFCLib solution file which is in HFCLib directory
(the sources downloaded from the repository) and choose Build -> Batch build. You should
build all configurations show in the list (you can ignore x64 configurations). Finally,
execute copyh.bat file in the same directory (this copies the latest header "*.h" and
inline "*.inl" files from the source directory to C:\HFC\include).
Finally, to compile Locate32 sources, open locate solution file (in Locate directory of
the sources) and build desired configuration. Note that default confiration is usually
"x64 Debug" (because I use it).
You can also compile lrestool.exe yourself to ensure that you are using the latest version.
Source code for lrestool and a Visual Studio solution file is in lrestool directory.
The latest lrestool.exe is also in the latest locate_lan-X.XXXXX.zip package in
http://www.locate32.net/files/devel (these packages are dedicated for translators).
********************************************************************
5. Using Visual Studio 2005
********************************************************************
The solution and project files were converted to Visual Studio 2008 on April 2008.
The change was done in subversion repository 196. This means that
you can found solution and project files for 2005 from revision prior to 196 (e.g. 195).
However, these files do not contain changes made after this date, so you have to update
the solution and project files by yourself. The changes between 195 and the latest (210
so far) are listed below:
** Changes in HFC Library solution:
HFCLib32 and HFCCon32/Header files:
- add HFCNetwork.h and HFCShell.h
HFCLib32 and HFCCon32/Source files:
- remove ShellExtension.cpp
- add Shell.cpp and Network.cpp
** Changes in Locate solution:
common/Header files:
- add win95srcfixes.h
lan_en:
- helptext.txt and helptext2.txt are not used anymore.
locate32/Header files
- Add strnatcmp.h from directory 3rdparty
locate32/Source files
- Add strnatcmp.cpp from directory 3rdparty
locate32/HTML Help Topics:
- There are so many changes that is not worthfile to give a list, an easier way is to
remove all src files from project and then add all src files which are in Locate/hlp
directory.
********************************************************************
6. Other compilers
********************************************************************
This section gives a brief introduction to compile sources using other combilers than
Visual Studio 2008 or 2005. In that case you have to create project/make files by yourself.
In the following I have listed that which libraries and modules you have to compile.
1. HFC Libraries:
HFCLib.lib:
- all cpp files in HFCLib\src directory
- no debug information, full optimizations
- preprosessor definitions: WIN32,NDEBUG,_WINDOWS,HFC_NOFORCELIBS,HFC_COMPILE
HFCLibd.lib:
- all cpp files in HFCLib\src directory
- full debug information, no optimizations
- preprosessor definitions: WIN32,_DEBUG,_WINDOWS,HFC_NOFORCELIBS,HFC_COMPILE
HFCCon.lib:
- all cpp files in HFCLib\src directory
- no debug information, full optimizations
- preprocessor definitions: WIN32,NDEBUG,_CONSOLE,HFC_NOFORCELIBS,HFC_COMPILE
HFCCond.lib:
- all cpp files in HFCLib\src directory
- full debug information, no optimizations
- preprocessor definitions: WIN32,_DEBUG,_CONSOLE,HFC_NOFORCELIBS,HFC_COMPILE
2. Common module:
common.lib:
- Locate\common\common.cpp
- debugging and optimizations depending on what desired (VS solutions compiles
separate debug and release versions)
- preprosessor definition: nothing special (I use WIN32;_DEBUG or NDEBUG;_LIB)
3. locatedb library
locatedb.lib:
- all cpp files in Locate\LocateDB
- debugging and optimizations depending on what desired (VS solutions compiles
separate debug and release libraries)
- preprocessor definition: nothing special (I use WIN32;_DEBUG or NDEBUG;_LIB)
- uses common.lib
4. locater library
locater.lib:
- all cpp files in Locate\Locater
- debugging and optimizations depending on what desired (VS solutions compiles
separate debug and release libraries)
- preprocessor definition: WIN32;_DEBUG or NDEBUG;_LIB;LOCATER_COMBILELIB,PCRE_STATIC
- uses common.lib and libpcre.lib
5. locate.exe:
- console application
- locate\locate\locate.cpp, Locate\locater\Locater.cpp and Locate\Locatedb\Database.cpp (does
not use locater.lib because it is multi-thread).
- preprocessor definition: WIN32;_DEBUG or NDEBUG;_CONSOLE;LOCATER_NOTHREAD;PCRE_STATIC
- uses common.lib and libpcre.lib
6. updtdb32.exe
- console application
- locate\updatedb\updatedb.cpp and locate\updatedb\updtdb32.rc
- preprocessor definition: WIN32;_DEBUG or NDEBUG;_CONSOLE
- uses common.lib and locatedb.lib
7. keyhook.dll
- Locate\Keyhook\keyhook.cpp and Locate\Locate32\shortcut.cpp
- preprocessor definition: WIN32;_DEBUG or NDEBUG;_WINDOWS;_USRDLL;KEYHOOK_EXPORTS;_WIN32_WINNT=0x0500
8. locate32.exe
- Win32 Application
- All cpp files in Locate\Locate32 and Locate\Locate32\3rdparty\CpuUsage.cpp
- preprocessor definition: WIN32;_DEBUG or NDEBUG;_WINDOWS
- uses common.lib, locater.lib, keyhook.lib and locatedb.lib
9. lan_en.dll
- type "lrestool English.lrf -o English.rc" in Locate\Languages\lan_en to compile resource script
- compile English.rc using resource compiler
- compile Locate\languages\lan_base\lan_base.cpp
- link to lan_en.dll file
Notes:
- Use multi threated C++ (and other) libraries