DEVEL15-windows-nsis-20061218
[openafs.git] / src / WINNT / install / NSIS / OpenAFS.nsi
1 !define RELEASE 1
2 ; OpenAFS Install Script for NSIS
3 ; This version compiles with NSIS v2.07
4 ;
5 ; Originally written by Rob Murawski <rsm4@ieee.org>
6 ;
7 ;Redistribution and use in source and binary forms, with or without modification, are permitted
8 ;provided that the following conditions are met:
9 ;
10 ;  Redistributions of source code must retain the above copyright notice, this list of conditions
11 ;  and the following disclaimer. Redistributions in binary form must reproduce the above copyright
12 ;  notice, this list of conditions and the following disclaimer in the documentation and/or other
13 ;  materials provided with the distribution. The name of the author may not be used to endorse or
14 ;  promote products derived from this software without specific prior written permission.
15 ;
16 ;  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
17 ;  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18 ;  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19 ;  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20 ;  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
21 ;  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
22 ;  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
23 ;  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 ;
25 ;
26 ;     Some code originally based on:
27 ;     NSIS Modern User Interface version 1.63
28 ;     MultiLanguage Example Script
29 ;     Written by Joost Verburg
30
31 ; Read in the environment information
32 !include ${INCLUDEDIR}\nsi-includes.nsi
33
34 !ifndef RELEASE
35 !ifndef DEBUG
36 Name "OpenAFS ${AFS_VERSION} ${__DATE__} ${__TIME__}"
37 !else
38 Name "OpenAFS ${AFS_VERSION} ${__DATE__} ${__TIME__} Checked/Debug"
39 !endif               ; End DEBUG/!DEBUG
40 !else
41 !ifndef DEBUG
42 Name "OpenAFS ${AFS_VERSION}"
43 !else                ; DEBUG
44 Name "OpenAFS ${AFS_VERSION} Checked/Debug"
45 !endif               ; End DEBUG/!DEBUG
46 !endif
47 VIProductVersion "${AFS_VERSION}.00"
48 VIAddVersionKey "ProductName" "OpenAFS"
49 VIAddVersionKey "CompanyName" "OpenAFS.org"
50 VIAddVersionKey "ProductVersion" ${AFS_VERSION}
51 VIAddVersionKey "FileVersion" ${AFS_VERSION}
52 VIAddVersionKey "FileDescription" "OpenAFS for Windows Installer"
53 VIAddVersionKey "LegalCopyright" "(C)2000-2005"
54 !ifdef DEBUG
55 VIAddVersionKey "PrivateBuild" "Checked/Debug"
56 !endif               ; End DEBUG
57
58
59 !include "MUI.nsh"
60 !include Sections.nsh
61
62 ;--------------------------------
63 ;Configuration
64
65 !define REPLACEDLL_NOREGISTER
66
67   ;General
68 !ifndef AFSIFS
69 !ifndef DEBUG
70   OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows.exe"
71 !else
72   OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows-DEBUG.exe"
73 !endif
74 !else
75 !ifndef DEBUG
76   OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows-IFS.exe"
77 !else
78   OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows-IFS-DEBUG.exe"
79 !endif
80 !endif
81   SilentInstall normal
82   SetCompressor /solid lzma
83   !define MUI_ICON "..\..\client_config\OpenAFS.ico"
84   !define MUI_UNICON "..\..\client_config\OpenAFS.ico"
85   !define AFS_COMPANY_NAME "OpenAFS"
86   !define AFS_PRODUCT_NAME "OpenAFS"
87   !define AFS_REGKEY_ROOT "Software\TransarcCorporation"
88   !define NID_PLUGIN_MGR  "Software\MIT\NetIDMgr\PluginManager"
89   CRCCheck force
90
91   ;Folder selection page
92   InstallDir "$PROGRAMFILES\OpenAFS"      ; Install to shorter path
93   
94   ;Remember install folder
95   InstallDirRegKey HKCU ${AFS_REGKEY_ROOT} ""
96   
97   ;Remember the installer language
98   !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" 
99   !define MUI_LANGDLL_REGISTRY_KEY ${AFS_REGKEY_ROOT}
100   !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
101   
102   ;Where are the files?
103   !define AFS_CLIENT_BUILDDIR "${AFS_DESTDIR}\root.client\usr\vice\etc"
104   !define AFS_WININSTALL_DIR "${AFS_DESTDIR}\WinInstall\Config"
105   !define AFS_BUILD_INCDIR "${AFS_DESTDIR}\include"
106   !define AFS_CLIENT_LIBDIR "${AFS_DESTDIR}\lib"
107   !define AFS_SERVER_BUILDDIR "${AFS_DESTDIR}\root.server\usr\afs\bin"
108   !define AFS_ETC_BUILDDIR "${AFS_DESTDIR}\etc"
109   !define SYSTEMDIR   "$%SystemRoot%\System32" 
110   
111 ;--------------------------------
112 ;Modern UI Configuration
113
114   !define MUI_LICENSEPAGE
115   !define MUI_CUSTOMPAGECOMMANDS
116   !define MUI_WELCOMEPAGE
117   !define MUI_COMPONENTSPAGE
118   !define MUI_COMPONENTSPAGE_SMALLDESC
119   !define MUI_DIRECTORYPAGE
120
121   !define MUI_ABORTWARNING
122   !define MUI_FINISHPAGE
123   
124   !define MUI_UNINSTALLER
125   !define MUI_UNCONFIRMPAGE
126   
127   
128   !insertmacro MUI_PAGE_WELCOME
129   !insertmacro MUI_PAGE_LICENSE "Licenses.rtf"
130   !insertmacro MUI_PAGE_COMPONENTS
131   !insertmacro MUI_PAGE_DIRECTORY
132   Page custom AFSPageGetCellServDB
133   Page custom AFSPageGetCellName
134   Page custom AFSPageConfigAFSCreds
135   !insertmacro MUI_PAGE_INSTFILES
136   !insertmacro MUI_PAGE_FINISH
137   
138 ;--------------------------------
139 ;Languages
140
141   !insertmacro MUI_LANGUAGE "English"
142   ;!insertmacro MUI_LANGUAGE "French"
143   !insertmacro MUI_LANGUAGE "German"
144   !insertmacro MUI_LANGUAGE "Spanish"
145   !insertmacro MUI_LANGUAGE "SimpChinese"
146   !insertmacro MUI_LANGUAGE "TradChinese"    
147   !insertmacro MUI_LANGUAGE "Japanese"
148   !insertmacro MUI_LANGUAGE "Korean"
149   ;!insertmacro MUI_LANGUAGE "Italian"
150   ;!insertmacro MUI_LANGUAGE "Dutch"
151   ;!insertmacro MUI_LANGUAGE "Danish"
152   ;!insertmacro MUI_LANGUAGE "Greek"
153   ;!insertmacro MUI_LANGUAGE "Russian"
154   !insertmacro MUI_LANGUAGE "PortugueseBR"
155   ;!insertmacro MUI_LANGUAGE "Polish"
156   ;!insertmacro MUI_LANGUAGE "Ukrainian"
157   ;!insertmacro MUI_LANGUAGE "Czech"
158   ;!insertmacro MUI_LANGUAGE "Slovak"
159   ;!insertmacro MUI_LANGUAGE "Croatian"
160   ;!insertmacro MUI_LANGUAGE "Bulgarian"
161   ;!insertmacro MUI_LANGUAGE "Hungarian"
162   ;!insertmacro MUI_LANGUAGE "Thai"
163   ;!insertmacro MUI_LANGUAGE "Romanian"
164   ;!insertmacro MUI_LANGUAGE "Macedonian"
165   ;!insertmacro MUI_LANGUAGE "Turkish"
166   
167 ;--------------------------------
168 ;Language Strings
169     
170   ;Descriptions
171   LangString DESC_SecCopyUI ${LANG_ENGLISH} "OpenAFS for Windows: English"
172   ;LangString DESC_SecCopyUI ${LANG_FRENCH} "OpenAFS for Windows: French"
173   LangString DESC_SecCopyUI ${LANG_GERMAN} "OpenAFS for Windows: German"
174   LangString DESC_SecCopyUI ${LANG_SPANISH} "OpenAFS for Windows: Spanish"
175   LangString DESC_SecCopyUI ${LANG_SIMPCHINESE} "OpenAFS for Windows: Simplified Chinese"
176   LangString DESC_SecCopyUI ${LANG_TRADCHINESE} "OpenAFS for Windows: Traditional Chinese description"
177   LangString DESC_SecCopyUI ${LANG_JAPANESE} "OpenAFS for Windows: Japanese description"
178   LangString DESC_SecCopyUI ${LANG_KOREAN} "OpenAFS for Windows: Korean description"
179   ;LangString DESC_SecCopyUI ${LANG_ITALIAN} "OpenAFS for Windows: Italian description"
180   ;LangString DESC_SecCopyUI ${LANG_DUTCH} "OpenAFS for Windows: Dutch description"
181   ;LangString DESC_SecCopyUI ${LANG_DANISH} "OpenAFS for Windows: Danish description"
182   ;LangString DESC_SecCopyUI ${LANG_GREEK} "OpenAFS for Windows: Greek description"
183   ;LangString DESC_SecCopyUI ${LANG_RUSSIAN} "OpenAFS for Windows: Russian description"
184   LangString DESC_SecCopyUI ${LANG_PORTUGUESEBR} "OpenAFS for Windows: Portuguese (Brasil) description"
185   ;LangString DESC_SecCopyUI ${LANG_POLISH} "OpenAFS for Windows: Polish description"
186   ;LangString DESC_SecCopyUI ${LANG_UKRAINIAN} "OpenAFS for Windows: Ukrainian description"
187   ;LangString DESC_SecCopyUI ${LANG_CZECH} "OpenAFS for Windows: Czechian description"
188   ;LangString DESC_SecCopyUI ${LANG_SLOVAK} "OpenAFS for Windows: Slovakian description"
189   ;LangString DESC_SecCopyUI ${LANG_CROATIAN} "OpenAFS for Windows: Slovakian description"
190   ;LangString DESC_SecCopyUI ${LANG_BULGARIAN} "OpenAFS for Windows: Bulgarian description"
191   ;LangString DESC_SecCopyUI ${LANG_HUNGARIAN} "OpenAFS for Windows: Hungarian description"
192   ;LangString DESC_SecCopyUI ${LANG_THAI} "OpenAFS for Windows: Thai description"
193   ;LangString DESC_SecCopyUI ${LANG_ROMANIAN} "OpenAFS for Windows: Romanian description"
194   ;LangString DESC_SecCopyUI ${LANG_MACEDONIAN} "OpenAFS for Windows: Macedonian description"
195   ;LangString DESC_SecCopyUI ${LANG_TURKISH} "OpenAFS for Windows: Turkish description"
196
197   LangString DESC_secClient ${LANG_ENGLISH} "OpenAFS Client: Allows you to access AFS from your Windows PC."
198   LangString DESC_secClient ${LANG_GERMAN} "OpenAFS Client: Allows you to access AFS from your Windows PC."
199   LangString DESC_secClient ${LANG_SPANISH} "OpenAFS Client: Allows you to access AFS from your Windows PC."
200   LangString DESC_secClient ${LANG_SIMPCHINESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
201   LangString DESC_secClient ${LANG_TRADCHINESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
202   LangString DESC_secClient ${LANG_JAPANESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
203   LangString DESC_secClient ${LANG_KOREAN} "OpenAFS Client: Allows you to access AFS from your Windows PC."
204   LangString DESC_secClient ${LANG_PORTUGUESEBR} "OpenAFS Client: Allows you to access AFS from your Windows PC."
205   
206   LangString DESC_secLoopback ${LANG_ENGLISH} "MS Loopback adapter: Installs the adapter for a more reliable AFS client."
207   LangString DESC_secLoopback ${LANG_GERMAN} "MS Loopback adapter: Installs the adapter for a more reliable AFS client."
208   LangString DESC_secLoopback ${LANG_SPANISH} "MS Loopback adapter: Installs the adapter for a more reliable AFS client."
209   LangString DESC_secLoopback ${LANG_SIMPCHINESE} "MS Loopback adapter: Installs the adapter for a more reliable AFS client."
210   LangString DESC_secLoopback ${LANG_TRADCHINESE} "MS Loopback adapter: Installs the adapter for a more reliable AFS client."
211   LangString DESC_secLoopback ${LANG_JAPANESE} "MS Loopback adapter: Installs the adapter for a more reliable AFS client."
212   LangString DESC_secLoopback ${LANG_KOREAN} "MS Loopback adapter: Installs the adapter for a more reliable AFS client."
213   LangString DESC_secLoopback ${LANG_PORTUGUESEBR} "MS Loopback adapter: Installs the adapter for a more reliable AFS client."
214
215   LangString DESC_secServer ${LANG_ENGLISH} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
216   LangString DESC_secServer ${LANG_GERMAN} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
217   LangString DESC_secServer ${LANG_SPANISH} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
218   LangString DESC_secServer ${LANG_SIMPCHINESE} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
219   LangString DESC_secServer ${LANG_TRADCHINESE} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
220   LangString DESC_secServer ${LANG_JAPANESE} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
221   LangString DESC_secServer ${LANG_KOREAN} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
222   LangString DESC_secServer ${LANG_PORTUGUESEBR} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client."
223   
224   LangString DESC_secControl ${LANG_ENGLISH} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
225   LangString DESC_secControl ${LANG_GERMAN} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
226   LangString DESC_secControl ${LANG_SPANISH} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
227   LangString DESC_secControl ${LANG_SIMPCHINESE} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
228   LangString DESC_secControl ${LANG_TRADCHINESE} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
229   LangString DESC_secControl ${LANG_JAPANESE} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
230   LangString DESC_secControl ${LANG_KOREAN} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
231   LangString DESC_secControl ${LANG_PORTUGUESEBR} "Control Center: GUI utilities for managing and configuring AFS servers.  This option requires the AFS Client."
232   
233   LangString DESC_secDocs ${LANG_ENGLISH} "Supplemental Documentation: Additional documentation for using OpenAFS."
234   LangString DESC_secDocs ${LANG_GERMAN} "Supplemental Documentation: Additional documentation for using OpenAFS."
235   LangString DESC_secDocs ${LANG_SPANISH} "Supplemental Documentation: Additional documentation for using OpenAFS."
236   LangString DESC_secDocs ${LANG_SIMPCHINESE} "Supplemental Documentation: Additional documentation for using OpenAFS."
237   LangString DESC_secDocs ${LANG_TRADCHINESE} "Supplemental Documentation: Additional documentation for using OpenAFS."
238   LangString DESC_secDocs ${LANG_JAPANESE} "Supplemental Documentation: Additional documentation for using OpenAFS."
239   LangString DESC_secDocs ${LANG_KOREAN} "Supplemental Documentation: Additional documentation for using OpenAFS."
240   LangString DESC_secDocs ${LANG_PORTUGUESEBR} "Supplemental Documentation: Additional documentation for using OpenAFS."
241   
242   LangString DESC_secSDK ${LANG_ENGLISH} "SDK: Header files and libraries for developing software with OpenAFS."
243   LangString DESC_secSDK ${LANG_GERMAN} "SDK: Header files and libraries for developing software with OpenAFS."
244   LangString DESC_secSDK ${LANG_SPANISH} "SDK: Header files and libraries for developing software with OpenAFS."
245   LangString DESC_secSDK ${LANG_SIMPCHINESE} "SDK: Header files and libraries for developing software with OpenAFS."
246   LangString DESC_secSDK ${LANG_TRADCHINESE} "SDK: Header files and libraries for developing software with OpenAFS."
247   LangString DESC_secSDK ${LANG_JAPANESE} "SDK: Header files and libraries for developing software with OpenAFS."
248   LangString DESC_secSDK ${LANG_KOREAN} "SDK: Header files and libraries for developing software with OpenAFS."
249   LangString DESC_secSDK ${LANG_PORTUGUESEBR} "SDK: Header files and libraries for developing software with OpenAFS."
250   
251   LangString DESC_secDEBUG ${LANG_ENGLISH} "Debug symbols: Used for debugging problems with OpenAFS."
252   LangString DESC_secDEBUG ${LANG_GERMAN} "Debug symbols: Used for debugging problems with OpenAFS."
253   LangString DESC_secDEBUG ${LANG_SPANISH} "Debug symbols: Used for debugging problems with OpenAFS."
254   LangString DESC_secDEBUG ${LANG_SIMPCHINESE} "Debug symbols: Used for debugging problems with OpenAFS."
255   LangString DESC_secDEBUG ${LANG_TRADCHINESE} "Debug symbols: Used for debugging problems with OpenAFS."
256   LangString DESC_secDEBUG ${LANG_JAPANESE} "Debug symbols: Used for debugging problems with OpenAFS."
257   LangString DESC_secDEBUG ${LANG_KOREAN} "Debug symbols: Used for debugging problems with OpenAFS."
258   LangString DESC_secDEBUG ${LANG_PORTUGUESEBR} "Debug symbols: Used for debugging problems with OpenAFS."
259
260 ; Popup error messages
261   LangString CellError ${LANG_ENGLISH} "You must specify a valid CellServDB file to copy during install"
262   LangString CellError ${LANG_GERMAN} "You must specify a valid CellServDB file to copy during the install"
263   LangString CellError ${LANG_SPANISH} "You must specify a valid CellServDB file to copy during the install"
264   LangString CellError ${LANG_SIMPCHINESE} "You must specify a valid CellServDB file to copy during the install"
265   LangString CellError ${LANG_TRADCHINESE} "You must specify a valid CellServDB file to copy during the install"
266   LangString CellError ${LANG_JAPANESE} "You must specify a valid CellServDB file to copy during the install"
267   LangString CellError ${LANG_KOREAN} "You must specify a valid CellServDB file to copy during the install"
268   LangString CellError ${LANG_PORTUGUESEBR} "You must specify a valid CellServDB file to copy during the install"
269   
270   LangString CellNameError ${LANG_ENGLISH} "You must specify a cell name for your client to use."
271   LangString CellNameError ${LANG_GERMAN} "You must specify a cell name for your client to use."
272   LangString CellNameError ${LANG_SPANISH} "You must specify a cell name for your client to use."
273   LangString CellNameError ${LANG_SIMPCHINESE} "You must specify a cell name for your client to use."
274   LangString CellNameError ${LANG_TRADCHINESE} "You must specify a cell name for your client to use."
275   LangString CellNameError ${LANG_JAPANESE} "You must specify a cell name for your client to use."
276   LangString CellNameError ${LANG_KOREAN} "You must specify a cell name for your client to use."
277   LangString CellNameError ${LANG_PORTUGUESEBR} "You must specify a cell name for your client to use."
278   
279   LangString URLError ${LANG_ENGLISH} "You must specify a URL if you choose the option to download the CellServDB."
280   LangString URLError ${LANG_GERMAN} "You must specify a URL if you choose the option to download the CellServDB."
281   LangString URLError ${LANG_SPANISH} "You must specify a URL if you choose the option to download the CellServDB."
282   LangString URLError ${LANG_SIMPCHINESE} "You must specify a URL if you choose the option to download the CellServDB."
283   LangString URLError ${LANG_TRADCHINESE} "You must specify a URL if you choose the option to download the CellServDB."
284   LangString URLError ${LANG_JAPANESE} "You must specify a URL if you choose the option to download the CellServDB."
285   LangString URLError ${LANG_KOREAN} "You must specify a URL if you choose the option to download the CellServDB."
286   LangString URLError ${LANG_PORTUGUESEBR} "You must specify a URL if you choose the option to download the CellServDB."
287
288   
289 ; Upgrade/re-install strings
290    LangString UPGRADE_CLIENT ${LANG_ENGLISH} "Upgrade AFS Client"
291    LangString UPGRADE_CLIENT ${LANG_GERMAN} "Upgrade AFS Client"
292    LangString UPGRADE_CLIENT ${LANG_SPANISH} "Upgrade AFS Client"
293    LangString UPGRADE_CLIENT ${LANG_SIMPCHINESE} "Upgrade AFS Client"
294    LangString UPGRADE_CLIENT ${LANG_TRADCHINESE} "Upgrade AFS Client"
295    LangString UPGRADE_CLIENT ${LANG_JAPANESE} "Upgrade AFS Client"
296    LangString UPGRADE_CLIENT ${LANG_KOREAN} "Upgrade AFS Client"
297    LangString UPGRADE_CLIENT ${LANG_PORTUGUESEBR} "Upgrade AFS Client"
298  
299    LangString REINSTALL_CLIENT ${LANG_ENGLISH} "Re-install AFS Client"
300    LangString REINSTALL_CLIENT ${LANG_GERMAN} "Re-install AFS Client"
301    LangString REINSTALL_CLIENT ${LANG_SPANISH} "Re-install AFS Client"
302    LangString REINSTALL_CLIENT ${LANG_SIMPCHINESE} "Re-install AFS Client"
303    LangString REINSTALL_CLIENT ${LANG_TRADCHINESE} "Re-install AFS Client"
304    LangString REINSTALL_CLIENT ${LANG_JAPANESE} "Re-install AFS Client"
305    LangString REINSTALL_CLIENT ${LANG_KOREAN} "Re-install AFS Client"
306    LangString REINSTALL_CLIENT ${LANG_PORTUGUESEBR} "Re-install AFS Client"
307   
308    LangString UPGRADE_SERVER ${LANG_ENGLISH} "Upgrade AFS Server"
309    LangString UPGRADE_SERVER ${LANG_GERMAN} "Upgrade AFS Server"
310    LangString UPGRADE_SERVER ${LANG_SPANISH} "Upgrade AFS Server"
311    LangString UPGRADE_SERVER ${LANG_SIMPCHINESE} "Upgrade AFS Server"
312    LangString UPGRADE_SERVER ${LANG_TRADCHINESE} "Upgrade AFS Server"
313    LangString UPGRADE_SERVER ${LANG_JAPANESE} "Upgrade AFS Server"
314    LangString UPGRADE_SERVER ${LANG_KOREAN} "Upgrade AFS Server"
315    LangString UPGRADE_SERVER ${LANG_PORTUGUESEBR} "Upgrade AFS Server"
316     
317    LangString REINSTALL_SERVER ${LANG_ENGLISH} "Re-install AFS Server"
318    LangString REINSTALL_SERVER ${LANG_GERMAN} "Re-install AFS Server"
319    LangString REINSTALL_SERVER ${LANG_SPANISH} "Re-install AFS Server"
320    LangString REINSTALL_SERVER ${LANG_SIMPCHINESE} "Re-install AFS Server"
321    LangString REINSTALL_SERVER ${LANG_TRADCHINESE} "Re-install AFS Server"
322    LangString REINSTALL_SERVER ${LANG_JAPANESE} "Re-install AFS Server"
323    LangString REINSTALL_SERVER ${LANG_KOREAN} "Re-install AFS Server"
324    LangString REINSTALL_SERVER ${LANG_PORTUGUESEBR} "Re-install AFS Server"
325   
326   ReserveFile "CellServPage.ini"
327   ReserveFile "AFSCell.ini"
328   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in
329   !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog
330 ;--------------------------------
331 ; Macros
332 ; Macro - Upgrade DLL File
333 ; Written by Joost Verburg
334 ; ------------------------
335 ;
336 ; Parameters:
337 ; LOCALFILE   - Location of the new DLL file (on the compiler system)
338 ; DESTFILE    - Location of the DLL file that should be upgraded
339 ;              (on the user's system)
340 ; TEMPBASEDIR - Directory on the user's system to store a temporary file
341 ;               when the system has to be rebooted.
342 ;               For Win9x support, this should be on the same volume as the
343 ;               DESTFILE!
344 ;               The Windows temp directory could be located on any volume,
345 ;               so you cannot use  this directory.
346 ;
347 ; Define REPLACEDLL_NOREGISTER if you want to upgrade a DLL that does not
348 ; have to be registered.
349 ;
350 ; Note: If you want to support Win9x, you can only use
351 ;       short filenames (8.3).
352 ;
353 ; Example of usage:
354 ; !insertmacro ReplaceDLL "dllname.dll" "$SYSDIR\dllname.dll" "$SYSDIR"
355 ;
356
357 !macro ReplaceDLL LOCALFILE DESTFILE TEMPBASEDIR
358
359   Push $R0
360   Push $R1
361   Push $R2
362   Push $R3
363   Push $R4
364   Push $R5
365
366   ;------------------------
367   ;Unique number for labels
368
369   !define REPLACEDLL_UNIQUE ${__LINE__}
370
371   ;------------------------
372   ;Copy the parameters used on run-time to a variable
373   ;This allows the usage of variables as paramter
374
375   StrCpy $R4 "${DESTFILE}"
376   StrCpy $R5 "${TEMPBASEDIR}"
377
378   ;------------------------
379   ;Check file and version
380   ;
381   IfFileExists $R4 0 replacedll.copy_${REPLACEDLL_UNIQUE}
382   
383   ;ClearErrors
384   ;  GetDLLVersionLocal "${LOCALFILE}" $R0 $R1
385   ;  GetDLLVersion $R4 $R2 $R3
386   ;IfErrors replacedll.upgrade_${REPLACEDLL_UNIQUE}
387   ;
388   ;IntCmpU $R0 $R2 0 replacedll.done_${REPLACEDLL_UNIQUE} \
389   ;  replacedll.upgrade_${REPLACEDLL_UNIQUE}
390   ;IntCmpU $R1 $R3 replacedll.done_${REPLACEDLL_UNIQUE} \
391   ;  replacedll.done_${REPLACEDLL_UNIQUE} \
392   ;  replacedll.upgrade_${REPLACEDLL_UNIQUE}
393
394   ;------------------------
395   ;Let's replace the DLL!
396
397   SetOverwrite try
398
399   ;replacedll.upgrade_${REPLACEDLL_UNIQUE}:
400     !ifndef REPLACEDLL_NOREGISTER
401       ;Unregister the DLL
402       UnRegDLL $R4
403     !endif
404
405   ;------------------------
406   ;Try to copy the DLL directly
407
408   ClearErrors
409     StrCpy $R0 $R4
410     Call :replacedll.file_${REPLACEDLL_UNIQUE}
411   IfErrors 0 replacedll.noreboot_${REPLACEDLL_UNIQUE}
412
413   ;------------------------
414   ;DLL is in use. Copy it to a temp file and Rename it on reboot.
415
416   GetTempFileName $R0 $R5
417     Call :replacedll.file_${REPLACEDLL_UNIQUE}
418   Rename /REBOOTOK $R0 $R4
419
420   ;------------------------
421   ;Register the DLL on reboot
422
423   !ifndef REPLACEDLL_NOREGISTER
424     WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \
425       "Register $R4" 'rundll32.exe "$R4",DllRegisterServer'
426   !endif
427
428   Goto replacedll.done_${REPLACEDLL_UNIQUE}
429
430   ;------------------------
431   ;DLL does not exist - just extract
432
433   replacedll.copy_${REPLACEDLL_UNIQUE}:
434     StrCpy $R0 $R4
435     Call :replacedll.file_${REPLACEDLL_UNIQUE}
436
437   ;------------------------
438   ;Register the DLL
439
440   replacedll.noreboot_${REPLACEDLL_UNIQUE}:
441     !ifndef REPLACEDLL_NOREGISTER
442       RegDLL $R4
443     !endif
444
445   ;------------------------
446   ;Done
447
448   replacedll.done_${REPLACEDLL_UNIQUE}:
449
450   Pop $R5
451   Pop $R4
452   Pop $R3
453   Pop $R2
454   Pop $R1
455   Pop $R0
456
457   ;------------------------
458   ;End
459
460   Goto replacedll.end_${REPLACEDLL_UNIQUE}
461
462   ;------------------------
463   ;Called to extract the DLL
464
465   replacedll.file_${REPLACEDLL_UNIQUE}:
466     File /oname=$R0 "${LOCALFILE}"
467     Return
468
469   replacedll.end_${REPLACEDLL_UNIQUE}:
470
471  ;------------------------
472  ;Restore settings
473
474  SetOverwrite lastused
475  
476  !undef REPLACEDLL_UNIQUE
477
478 !macroend
479
480
481 ;--------------------------------
482 ;Reserve Files
483   
484   ;Things that need to be extracted on first (keep these lines before any File command!)
485   ;Only useful for BZIP2 compression
486   !insertmacro MUI_RESERVEFILE_LANGDLL
487   
488 ;--------------------------------
489 ; User Variables
490
491 var REG_SUB_KEY
492 var REG_VALUE
493 var REG_DATA_1
494 var REG_DATA_2
495 var REG_DATA_3
496 var REG_DATA_4
497
498
499 ;--------------------------------
500 ;Installer Sections
501
502 ;----------------------
503 ; OpenAFS CLIENT
504 Section "!AFS Client" secClient
505
506   SetShellVarContext all
507
508   ; Check for bad previous installation (if we are doing a new install)
509   Call IsAnyAFSInstalled
510   Pop $R0
511   StrCmp $R0 "0" +1 skipCheck
512   Call CheckPathForAFS
513   skipCheck:
514
515   ; Stop any running services or we can't replace the files
516   ; Stop the running processes
517   GetTempFileName $R0
518   File /oname=$R0 "${AFS_WININSTALL_DIR}\Killer.exe"   ; Might not have the MSVCR71.DLL file to run
519   nsExec::Exec '$R0 afsd_service.exe'
520   nsExec::Exec '$R0 afscreds.exe'
521   Exec "afscreds.exe -z"
522   ; in case we are upgrading an old version that does not support -z
523   nsExec::Exec '$R0 afscreds.exe'
524 !IFDEF INSTALL_KFW
525   ;nsExec::Exec '$R0 krbcc32s.exe'
526 !ENDIF
527
528   nsExec::Exec "net stop TransarcAFSDaemon"
529   nsExec::Exec "net stop TransarcAFSServer"
530   
531    ; Do client components
532   SetOutPath "$INSTDIR\Client\Program"
533   File "${AFS_CLIENT_BUILDDIR}\afsshare.exe"
534   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\libosi.dll" "$INSTDIR\Client\Program\libosi.dll" "$INSTDIR"
535   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\libafsconf.dll" "$INSTDIR\Client\Program\libafsconf.dll" "$INSTDIR"
536   File "${AFS_CLIENT_BUILDDIR}\klog.exe"
537   File "${AFS_CLIENT_BUILDDIR}\tokens.exe"
538   File "${AFS_CLIENT_BUILDDIR}\unlog.exe"
539   File "${AFS_CLIENT_BUILDDIR}\fs.exe"
540   File "${AFS_CLIENT_BUILDDIR}\afsdacl.exe"
541   File "${AFS_CLIENT_BUILDDIR}\cmdebug.exe"
542   File "${AFS_CLIENT_BUILDDIR}\aklog.exe"
543   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds.exe"    "$INSTDIR\Client\Program\afscreds.exe"    "$INSTDIR"
544   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.dll" "$INSTDIR\Client\Program\afs_shl_ext.dll" "$INSTDIR"
545   File "${AFS_CLIENT_BUILDDIR}\afsd_service.exe"
546   File "${AFS_CLIENT_BUILDDIR}\symlink.exe"
547   File "${AFS_DESTDIR}\bin\kpasswd.exe"
548   File "${AFS_SERVER_BUILDDIR}\pts.exe"
549   File "${AFS_SERVER_BUILDDIR}\bos.exe"
550   File "${AFS_SERVER_BUILDDIR}\kas.exe"
551   File "${AFS_SERVER_BUILDDIR}\vos.exe"
552   File "${AFS_SERVER_BUILDDIR}\udebug.exe"
553   File "${AFS_DESTDIR}\bin\translate_et.exe"
554   File "${AFS_DESTDIR}\etc\rxdebug.exe"
555   File "${AFS_DESTDIR}\etc\backup.exe"
556   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa.cpl" "$INSTDIR\Client\Program\afs_cpa.cpl" "$INSTDIR"
557   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscred.dll" "$INSTDIR\Client\Program\afscred.dll" "$INSTDIR"
558   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscred_en_us.dll" "$INSTDIR\Client\Program\afscred_en_us.dll" "$INSTDIR"
559   File "${AFS_CLIENT_BUILDDIR}\afsplhlp.chm"
560   
561   SetOutPath "$SYSDIR"
562   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afslogon.dll" "$SYSDIR\afslogon.dll" "$INSTDIR"
563   File "${AFS_CLIENT_BUILDDIR}\afscpcc.exe"
564 !ifdef AFSIFS
565 !ifndef DEBUG
566   !insertmacro ReplaceDLL "..\..\afsrdr\objfre_w2K_x86\i386\afsrdr.sys" "$SYSDIR\DRIVERS\afsrdr.sys" "$INSTDIR"
567 !else
568   !insertmacro ReplaceDLL "..\..\afsrdr\objchk_w2K_x86\i386\afsrdr.sys" "$SYSDIR\DRIVERS\afsrdr.sys" "$INSTDIR"
569 !endif
570 !endif
571    
572    Call AFSLangFiles
573
574   ; Get AFS CellServDB file
575   Call afs.GetCellServDB
576
577   GetTempFileName $R0
578   File /oname=$R0 "${AFS_WININSTALL_DIR}\AdminGroup.exe"
579   nsExec::Exec '$R0 -create'
580
581 !ifdef INSTALL_KFW
582   ; Include Kerberos for Windows files in the installer...
583   SetOutPath "$INSTDIR\kfw\bin\"
584   File "${KFW_SOURCE}\bin\*"
585   SetOutPath "$INSTDIR\kfw\doc"
586   File "${KFW_SOURCE}\doc\*"
587 !endif
588    
589   ;Store install folder
590   WriteRegStr HKCU "${AFS_REGKEY_ROOT}\Client" "" $INSTDIR
591   Call AFSCommon.Install
592   
593   ; Write registry entries
594   WriteRegStr HKCR "*\shellex\ContextMenuHandlers\AFS Client Shell Extension" "" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
595   WriteRegStr HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" "" "AFS Client Shell Extension"
596   WriteRegStr HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32" "" "$INSTDIR\Client\Program\afs_shl_ext.dll"
597   WriteRegStr HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32" "ThreadingModel" "Apartment"
598   WriteRegStr HKCR "FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension" "" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
599   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" "AFS Client Shell Extension"
600   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls" "afs_cpa" "$INSTDIR\Client\Program\afs_cpa.cpl"
601
602   ; Support for apps that wrote submount data directly to afsdsbmt.ini
603   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini" "AFS Mappings" "USR:Software\OpenAFS\Client\mappings"
604   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini" "AFS Submounts" "SYS:OpenAFS\Client\Submounts"
605   
606   ; AFS Reg entries
607   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion"
608   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "VersionString" ${AFS_VERSION}
609   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Title" "AFS Client"
610   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Description" "AFS Client"
611   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PathName" "$INSTDIR\Client"
612   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Software Type" "File System"
613   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
614   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
615   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
616   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
617   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Title" "AFS Client"
618   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Description" "AFS Client"
619   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Software Type" "File System"
620   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "PathName" "$INSTDIR\Client\Program"
621   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
622   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
623   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
624 !ifdef DEBUG
625   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Debug" 1
626   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Debug" 1
627 !else
628    ; Delete the DEBUG string
629    DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Debug"
630    DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Debug"
631 !endif
632
633   ;NetIDMgr Plug-in Reg Entries
634   WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "ImagePath" "$INSTDIR\Client\Program\afscred.dll"
635   WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "Description" "OpenAFS Module"
636   WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "Vendor" "Secure Endpoints Inc."
637   WriteRegStr HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "PluginList" "AfsCred"
638   WriteRegDWORD HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS" "NoUnload" "1"
639   
640   WriteRegStr HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Module" "OpenAFS"
641   WriteRegStr HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Description" "AFS Credentials Provider"
642   WriteRegStr HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Dependencies" "Krb5Cred"
643   WriteRegDWORD HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred" "Type" "1"
644
645    ; On Windows 2000 work around KB301673.  This is fixed in Windows XP and 2003
646    Call GetWindowsVersion
647    Pop $R1
648    StrCmp $R1 "2000" +1 +2
649    WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\NetBT\Parameters" "SmbDeviceEnabled" 0
650   
651   ;Write start menu entries
652   CreateDirectory "$SMPROGRAMS\OpenAFS\Client"
653   CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
654   
655   ; Create command line options for AFSCreds...
656   StrCpy $R2 ""
657   ReadINIStr $R1 $2 "Field 3" "State"
658   StrCmp $R1 "1" +1 +2
659   StrCpy $R2 "-A "
660   ReadINIStr $R1 $2 "Field 5" "State"
661   StrCmp $R1 "1" +1 +2
662   StrCpy $R2 "$R2-M "
663   ReadINIStr $R1 $2 "Field 7" "State"
664   StrCmp $R1 "1" +1 +2
665   StrCpy $R2 "$R2-N "
666   ReadINIStr $R1 $2 "Field 9" "State"
667   StrCmp $R1 "1" +1 +2
668   StrCpy $R2 "$R2-Q "
669   ReadINIStr $R1 $2 "Field 13" "State"
670   StrCmp $R1 "1" +1 +2
671   StrCpy $R2 "$R2-S"
672  
673   WriteRegStr HKLM "SOFTWARE\OpenAFS\Client" "AfscredsShortcutParams" "$R2"
674   
675   CreateShortCut "$SMPROGRAMS\OpenAFS\Client\Authentication.lnk" "$INSTDIR\Client\Program\afscreds.exe" "$R2"
676   
677   ReadINIStr $R1 $2 "Field 1" "State"
678   StrCmp $R1 "1" +1 +2
679   CreateShortCut "$SMSTARTUP\AFS Credentials.lnk" "$INSTDIR\Client\Program\afscreds.exe" "$R2"
680
681   Push "$INSTDIR\Client\Program"
682   Call AddToUniquePath
683   Push "$INSTDIR\Common"
684   Call AddToUniquePath
685   
686 !ifdef INSTALL_KFW
687   ; Add kfw to path too
688   Push "$INSTDIR\kfw\bin"
689   Call AddToUniquePath
690 !endif
691    
692   ; Create the AFS service
693   SetOutPath "$INSTDIR\Common"
694   File "${AFS_WININSTALL_DIR}\Service.exe"
695   nsExec::Exec "net stop TransarcAFSDaemon"
696   nsExec::Exec "net stop AfsRdr"
697   ;IMPORTANT!  If we are not refreshing the config files, do NOT remove the service
698   ;Don't re-install because it must be present or we wouldn't have passed the Reg check
699  
700   ReadRegStr $R2 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "Cell"
701   StrCmp $R2 "" +1 skipremove
702   nsExec::Exec '$INSTDIR\Common\Service.exe u TransarcAFSDaemon'
703   nsExec::Exec '$INSTDIR\Common\Service.exe TransarcAFSDaemon "$INSTDIR\Client\Program\afsd_service.exe" "OpenAFS Client Service"'
704   nsExec::Exec '$INSTDIR\Common\Service.exe u AfsRdr'
705 !ifdef AFSIFS
706   nsExec::Exec '$INSTDIR\Common\Service.exe AfsRdr "System32\DRIVERS\afsrdr.sys" "AFS Redirector"'
707 !endif
708 skipremove:
709   Delete "$INSTDIR\Common\service.exe"
710
711   ; Daemon entries
712   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "" ""
713   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "ProviderPath" "$SYSDIR\afslogon.dll"
714   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "AuthentProviderPath" "$SYSDIR\afslogon.dll"
715   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "Class" 2
716   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "VerboseLogging" 10
717
718   ; Must also add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\HwOrder
719   ; and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order
720   ; to also include the service name.
721   Call AddProvider
722   ReadINIStr $R0 $1 "Field 7" "State"
723   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "LogonOptions" $R0
724   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "LogonScript" "$INSTDIR\Client\Program\afscreds.exe -:%s -x -a -m -n -q"
725   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "Name" "OpenAFSDaemon"
726
727   ;Write cell name
728   ReadINIStr $R0 $1 "Field 2" "State"
729   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "Cell" $R0
730   ReadINIStr $R0 $1 "Field 3" "State"
731   WriteRegDWORD HKLM "SOFTWARE\OpenAFS\Client" "ShowTrayIcon" 1
732   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "SecurityLevel" $R0
733   ReadINIStr $R0 $1 "Field 5" "State"  
734   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient" $R0
735   ReadINIStr $R0 $1 "Field 9" "State"
736   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "UseDNS" $R0
737   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "NetbiosName" "AFS"
738   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "MountRoot" "/afs"
739   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "RxMaxMTU" 1260
740   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "IsGateway" 0
741   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "HideDotFiles" 1
742
743   ; Find Lana By Name appears to be causing grief for many people 
744   ; I do not have time to track this down so I am simply going to disable it
745   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "NoFindLanaByName" 1
746
747   strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" 
748   strcpy $REG_VALUE   "DependOnGroup" 
749   strcpy $REG_DATA_1  "PNP_TDI"
750   strcpy $REG_DATA_2  ""
751   strcpy $REG_DATA_3  ""
752   strcpy $REG_DATA_4  ""
753   Call RegWriteMultiStr
754   strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" 
755   strcpy $REG_VALUE   "DependOnService" 
756   strcpy $REG_DATA_1  "Tcpip"
757   strcpy $REG_DATA_2  "NETBIOS"
758   strcpy $REG_DATA_3  "RpcSs"
759 !ifdef AFSIFS
760   strcpy $REG_DATA_4  "AfsRdr"
761 !else
762   strcpy $REG_DATA_4  ""
763 !endif
764   Call RegWriteMultiStr
765 !ifdef AFSIFS
766   strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\AfsRdr" 
767   strcpy $REG_VALUE   "DependOnService" 
768   strcpy $REG_DATA_1  "Tcpip"
769   strcpy $REG_DATA_2  ""
770   strcpy $REG_DATA_3  ""
771   strcpy $REG_DATA_4  ""
772   Call RegWriteMultiStr
773 !endif
774
775   ; WinLogon Event Notification
776   WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Asynchronous" 0
777   WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Impersonate"  1
778   WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "DLLName" "afslogon.dll"
779   WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Logon" "AFS_Logon_Event"
780   WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Logoff" "AFS_Logoff_Event"
781   WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Startup" "AFS_Startup_Event"
782
783   WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Asynchronous" 0
784   WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Impersonate"  0
785   WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "DLLName" "afslogon.dll"
786   WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\KFWLogon" "Logon" "KFW_Logon_Event"
787
788   SetRebootFlag true
789   
790   WriteUninstaller "$INSTDIR\Uninstall.exe"
791   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"  
792   Call CreateDesktopIni
793   
794 SectionEnd
795
796
797
798 ; MS Loopback adapter
799 Section "!MS Loopback Adapter" secLoopback
800
801 Call afs.InstallMSLoopback
802
803 SectionEnd
804
805
806 ;------------------------
807 ; OpenAFS SERVER  
808 Section /o "AFS Server" secServer
809
810   SetShellVarContext all
811
812   ; Check for bad previous installation (if we are doing a new install)
813   Call IsAnyAFSInstalled
814   Pop $R0
815   StrCmp $R0 "0" +1 skipCheck
816   Call CheckPathForAFS
817 skipCheck:
818
819   ; Stop any running services or we can't replace the files
820   ; Stop the running processes
821   GetTempFileName $R0
822   File /oname=$R0 "${AFS_WININSTALL_DIR}\Killer.exe"
823   nsExec::Exec '$R0 afscreds.exe'
824   Exec "afscreds.exe -z"
825   ; in case we are upgrading an old version that does not support -z
826   Sleep 2000
827   nsExec::Exec '$R0 afscreds.exe'
828 !IFDEF INSTALL_KFW
829   ;nsExec::Exec '$R0 krbcc32s.exe'
830 !ENDIF
831
832   Delete $R0
833   
834   nsExec::Exec "net stop TransarcAFSDaemon"
835   nsExec::Exec "net stop TransarcAFSServer"
836
837   CreateDirectory "$INSTDIR\Server\usr\afs\etc"
838   CreateDirectory "$INSTDIR\Server\usr\afs\local"
839   CreateDirectory "$INSTDIR\Server\usr\afs\etc\logs"
840   
841   SetOutPath "$INSTDIR\Server\usr\afs\bin"  
842   File "${AFS_SERVER_BUILDDIR}\afskill.exe"
843   File "${AFS_SERVER_BUILDDIR}\afssvrcfg.exe"
844   File "${AFS_SERVER_BUILDDIR}\asetkey.exe"
845   File "${AFS_SERVER_BUILDDIR}\bosctlsvc.exe"
846   File "${AFS_SERVER_BUILDDIR}\bosserver.exe"
847   File "${AFS_SERVER_BUILDDIR}\buserver.exe"
848   File "${AFS_ETC_BUILDDIR}\butc.exe"
849   File "${AFS_SERVER_BUILDDIR}\fileserver.exe"
850   File "${AFS_ETC_BUILDDIR}\fms.exe"
851   File "${AFS_SERVER_BUILDDIR}\kaserver.exe"
852   File "${AFS_SERVER_BUILDDIR}\ptserver.exe"
853   File "${AFS_SERVER_BUILDDIR}\salvager.exe"
854   File "${AFS_SERVER_BUILDDIR}\upclient.exe"
855   File "${AFS_SERVER_BUILDDIR}\upserver.exe"
856   File "${AFS_SERVER_BUILDDIR}\vlserver.exe"
857   File "${AFS_SERVER_BUILDDIR}\volinfo.exe"
858   File "${AFS_SERVER_BUILDDIR}\volserver.exe"
859  
860  ;AFS Server common files
861  SetOutPath "$INSTDIR\Common"
862  File "${AFS_SERVER_BUILDDIR}\afsvosadmin.dll"
863  File "${AFS_SERVER_BUILDDIR}\afsbosadmin.dll"
864  File "${AFS_SERVER_BUILDDIR}\afscfgadmin.dll"
865  File "${AFS_SERVER_BUILDDIR}\afskasadmin.dll"
866  File "${AFS_SERVER_BUILDDIR}\afsptsadmin.dll"
867
868  SetOutPath "$INSTDIR\Common"
869    Call AFSLangFiles
870    
871    SetOutPath "$SYSDIR"
872   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver.cpl" "$SYSDIR\afsserver.cpl" "$INSTDIR"
873    
874   ;Store install folder
875   WriteRegStr HKCU "${AFS_REGKEY_ROOT}\AFS Server" "" $INSTDIR
876   
877   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion"
878   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "VersionString" ${AFS_VERSION}
879   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Title" "AFS Server"
880   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Description" "AFS Server for Windows"
881   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PathName" "$INSTDIR\Server"
882   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Software Type" "File System"
883   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
884   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
885   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
886   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
887   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Title" "AFS Server"
888   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Description" "AFS Server for Windows"
889   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Software Type" "File System"
890   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "PathName" "$INSTDIR\Server"
891   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
892   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
893   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
894 !ifdef DEBUG
895   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Debug" 1
896   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Debug" 1
897 !else
898    ; Delete the DEBUG string
899    DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Debug"
900    DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Debug"
901 !endif
902   ; Install the service
903   SetOutPath "$INSTDIR\Common"
904   File "${AFS_WININSTALL_DIR}\Service.exe"
905 !ifdef DEBUG
906   File "${AFS_WININSTALL_DIR}\Service.pdb"
907 !endif
908
909   ; Check if the service exists--if it does, this is an upgrade/re-install
910   ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSServer" "ImagePath"
911   StrCmp $R0 "$INSTDIR\Server\usr\afs\bin\bosctlsvc.exe" SkipStartup
912   
913   ; If an uninstall was done, but we kept the config files, also skip
914   IfFileExists "$INSTDIR\Server\usr\afs\etc\ThisCell" SkipStartup
915
916   ; Make the server config wizard auto-start on bootup if this is an install (not an upgrade)
917   ; WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "AFS Server Wizard" '"$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe" /wizard"'
918   
919   
920 SkipStartup:
921   ;Don't want to whack existing settings... Make users un-install and then re-install if they want that
922   ;nsExec::Exec '$INSTDIR\Common\service.exe u TransarcAFSServer'
923   nsExec::Exec '$INSTDIR\Common\service.exe TransarcAFSServer "$INSTDIR\Server\usr\afs\bin\bosctlsvc.exe" "OpenAFS AFS Server"'
924   Delete "$INSTDIR\Common\service.exe"
925
926   strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\TransarcAFSServer" 
927   strcpy $REG_VALUE   "DependOnGroup" 
928   strcpy $REG_DATA_1  "PNP_TDI"
929   strcpy $REG_DATA_2  ""
930   strcpy $REG_DATA_3  ""
931   strcpy $REG_DATA_4  ""
932   Call RegWriteMultiStr
933   strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\TransarcAFSServer" 
934   strcpy $REG_VALUE   "DependOnService" 
935   strcpy $REG_DATA_1  "Tcpip"
936   strcpy $REG_DATA_2  ""
937   strcpy $REG_DATA_3  ""
938   strcpy $REG_DATA_4  ""
939   Call RegWriteMultiStr
940   
941   ;CreateDirectory "$SMPROGRAMS\OpenAFS\Server"
942   ;CreateShortCut "$SMPROGRAMS\OpenAFS\Server\Server Configuration.lnk" "$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe"
943   
944   WriteUninstaller "$INSTDIR\Uninstall.exe"
945   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"  
946
947 SectionEnd
948
949
950 ;----------------------------
951 ; OpenAFS Control Center
952 Section /o "AFS Control Center" secControl
953
954   SetShellVarContext all
955
956    SetOutPath "$INSTDIR\Control Center"
957   File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager.exe"
958   File "${AFS_SERVER_BUILDDIR}\TaAfsAdmSvr.exe"
959   File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager.exe"
960    
961
962  ;AFS Server common files
963  Call AFSCommon.Install
964  Call AFSLangFiles
965  SetOutPath "$INSTDIR\Common"
966
967    ;Store install folder
968   WriteRegStr HKCU "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PathName" $INSTDIR
969   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "VersionString" ${AFS_VERSION}
970   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
971   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
972   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
973   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
974   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
975   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
976   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
977 !ifdef DEBUG
978   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "Debug" 1
979   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "Debug" 1
980 !else
981    ; Delete the DEBUG string
982    DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "Debug"
983    DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "Debug"
984 !endif
985
986   ;Write start menu entries
987   CreateDirectory "$SMPROGRAMS\OpenAFS\Control Center"
988   CreateShortCut "$SMPROGRAMS\OpenAFS\Control Center\Account Manager.lnk" "$INSTDIR\Control Center\TaAfsAccountManager.exe"
989   CreateShortCut "$SMPROGRAMS\OpenAFS\Control Center\Server Manager.lnk" "$INSTDIR\Control Center\TaAfsServerManager.exe"
990   
991   WriteUninstaller "$INSTDIR\Uninstall.exe"
992   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"  
993
994 SectionEnd   
995
996
997 ;----------------------------
998 ; OpenAFS Supplemental Documentation
999 Section /o "Supplemental Documentation" secDocs
1000   SetShellVarContext all
1001
1002    StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
1003    StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman
1004    StrCmp $LANGUAGE ${LANG_SPANISH} DoSpanish
1005    StrCmp $LANGUAGE ${LANG_JAPANESE} DoJapanese
1006    StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean
1007    StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} DoPortugueseBR
1008    StrCmp $LANGUAGE ${LANG_SIMPCHINESE} DoSimpChinese
1009    StrCmp $LANGUAGE ${LANG_TRADCHINESE} DoTradChinese
1010    
1011    
1012 DoEnglish:
1013    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1014    File "..\..\doc\install\Documentation\en_US\html\CmdRef\*"
1015    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1016    File "..\..\doc\install\Documentation\en_US\html\SysAdminGd\*"
1017    goto DoneLanguage
1018    
1019 DoGerman:
1020    SetOutPath "$INSTDIR\Documentation\html"
1021    File "..\..\doc\install\Documentation\de_DE\html\*"
1022    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1023    ;File "..\..\doc\install\Documentation\de_DE\html\CmdRef\*"
1024    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1025    ;File "..\..\doc\install\Documentation\de_DE\html\SysAdminGd\*"
1026    goto DoneLanguage
1027    
1028 DoSpanish:
1029    SetOutPath "$INSTDIR\Documentation\html"
1030    File "..\..\doc\install\Documentation\es_ES\html\*"
1031    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1032    ;File "..\..\doc\install\Documentation\es_ES\html\CmdRef\*"
1033    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1034    ;File "..\..\doc\install\Documentation\es_ES\html\SysAdminGd\*"
1035    goto DoneLanguage
1036
1037 DoJapanese:
1038    SetOutPath "$INSTDIR\Documentation\html"
1039    File "..\..\doc\install\Documentation\ja_JP\html\*"
1040    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1041    File "..\..\doc\install\Documentation\ja_JP\html\CmdRef\*"
1042    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1043    ;File "..\..\doc\install\Documentation\ja_JP\html\SysAdminGd\*"
1044    goto DoneLanguage
1045    
1046 DoKorean:
1047    SetOutPath "$INSTDIR\Documentation\html"
1048    File "..\..\doc\install\Documentation\ko_KR\html\*"
1049    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1050    ;File "..\..\doc\install\Documentation\ko_KR\html\CmdRef\*"
1051    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1052    File "..\..\doc\install\Documentation\ko_KR\html\SysAdminGd\*"
1053    goto DoneLanguage
1054    
1055 DoPortugueseBR:
1056    SetOutPath "$INSTDIR\Documentation\html"
1057    File "..\..\doc\install\Documentation\pt_BR\html\*"
1058    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1059    ;File "..\..\doc\install\Documentation\pt_BR\html\CmdRef\*"
1060    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1061    ;File "..\..\doc\install\Documentation\pt_BR\html\SysAdminGd\*"
1062    goto DoneLanguage
1063
1064 DoSimpChinese:
1065    SetOutPath "$INSTDIR\Documentation\html"
1066    File "..\..\doc\install\Documentation\zh_CN\html\*"
1067    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1068    ;File "..\..\doc\install\Documentation\zh_CN\html\CmdRef\*"
1069    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1070    ;File "..\..\doc\install\Documentation\zh_CN\html\SysAdminGd\*"
1071    goto DoneLanguage
1072    
1073 DoTradChinese:
1074    SetOutPath "$INSTDIR\Documentation\html"
1075    File "..\..\doc\install\Documentation\zh_TW\html\*"
1076    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1077    ;File "..\..\doc\install\Documentation\zh_TW\html\CmdRef\*"
1078    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1079    ;File "..\..\doc\install\Documentation\zh_TW\html\SysAdminGd\*"
1080    goto DoneLanguage
1081    
1082    
1083 DoneLanguage:
1084    ;Store install folder
1085   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation" "" $INSTDIR
1086   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "VersionString" ${AFS_VERSION}
1087   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
1088   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
1089   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
1090   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
1091   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
1092   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
1093   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
1094
1095   WriteUninstaller "$INSTDIR\Uninstall.exe"
1096   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"  
1097   CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
1098   Call AFSCommon.Install
1099 SectionEnd  
1100   
1101
1102 Section /o "Software Development Kit (SDK)" secSDK
1103
1104    SetOutPath "$INSTDIR\SDK\lib"
1105    File /r "${AFS_CLIENT_LIBDIR}\*.*"
1106
1107    SetOutPath "$INSTDIR\SDK\Include"
1108    File /r "${AFS_BUILD_INCDIR}\*.*"    
1109
1110    ; Client Sample
1111    SetOutPath "$INSTDIR\SDK\Sample"
1112    File "..\..\afsd\sample\token.c"
1113
1114    ;Store install folder
1115   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK" "" $INSTDIR
1116   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "VersionString" ${AFS_VERSION}
1117   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
1118   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
1119   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
1120   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
1121   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
1122   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
1123   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
1124
1125   WriteUninstaller "$INSTDIR\Uninstall.exe"
1126   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"  
1127
1128   SetOutPath "$SMPROGRAMS\OpenAFS"
1129   CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
1130
1131   Call AFSCommon.Install
1132 SectionEnd
1133
1134
1135 Section /o "Debug symbols" secDebug
1136    SectionGetFlags ${secClient} $R0
1137    IntOp $R0 $R0 & ${SF_SELECTED}
1138    IntCmp $R0 ${SF_SELECTED} +1 DoServer
1139   
1140   ; Do client components
1141   SetOutPath "$INSTDIR\Client\Program"
1142   File "${AFS_CLIENT_BUILDDIR}\afsshare.pdb"
1143   File "${AFS_CLIENT_BUILDDIR}\libosi.pdb"
1144   File "${AFS_CLIENT_BUILDDIR}\libafsconf.pdb"
1145   File "${AFS_CLIENT_BUILDDIR}\klog.pdb"
1146   File "${AFS_CLIENT_BUILDDIR}\tokens.pdb"
1147   File "${AFS_CLIENT_BUILDDIR}\unlog.pdb"
1148   File "${AFS_CLIENT_BUILDDIR}\fs.pdb"
1149   File "${AFS_CLIENT_BUILDDIR}\afsdacl.pdb"
1150   File "${AFS_CLIENT_BUILDDIR}\cmdebug.pdb"
1151   File "${AFS_CLIENT_BUILDDIR}\aklog.pdb"
1152   File "${AFS_CLIENT_BUILDDIR}\afscreds.pdb"
1153   File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.pdb"
1154   File "${AFS_CLIENT_BUILDDIR}\afsd_service.pdb"
1155   File "${AFS_CLIENT_BUILDDIR}\symlink.pdb"
1156   File "${AFS_DESTDIR}\bin\kpasswd.pdb"
1157   File "${AFS_DESTDIR}\bin\pts.pdb"
1158   File "${AFS_SERVER_BUILDDIR}\bos.pdb"
1159   File "${AFS_SERVER_BUILDDIR}\kas.pdb"
1160   File "${AFS_SERVER_BUILDDIR}\vos.pdb"
1161   File "${AFS_SERVER_BUILDDIR}\udebug.pdb"
1162   File "${AFS_DESTDIR}\bin\translate_et.pdb"
1163   File "${AFS_DESTDIR}\etc\rxdebug.pdb"
1164   File "${AFS_DESTDIR}\etc\backup.pdb"
1165   File "${AFS_CLIENT_BUILDDIR}\afs_cpa.pdb"
1166   File "${AFS_CLIENT_BUILDDIR}\afscred.pdb"
1167
1168   SetOutPath "$SYSDIR"
1169   File "${AFS_CLIENT_BUILDDIR}\afslogon.pdb"
1170   
1171 DoServer:
1172    SectionGetFlags ${secServer} $R0
1173    IntOp $R0 $R0 & ${SF_SELECTED}
1174    IntCmp $R0 ${SF_SELECTED} +1 DoControl
1175
1176   ; Do server components
1177   SetOutPath "$INSTDIR\Server\usr\afs\bin"  
1178   File "${AFS_SERVER_BUILDDIR}\afskill.pdb"
1179   File "${AFS_SERVER_BUILDDIR}\afssvrcfg.pdb"
1180   File "${AFS_SERVER_BUILDDIR}\asetkey.pdb"
1181   File "${AFS_SERVER_BUILDDIR}\bosctlsvc.pdb"
1182   File "${AFS_SERVER_BUILDDIR}\bosserver.pdb"
1183   File "${AFS_SERVER_BUILDDIR}\buserver.pdb"
1184   File "${AFS_ETC_BUILDDIR}\butc.pdb"
1185   File "${AFS_SERVER_BUILDDIR}\fileserver.pdb"
1186   File "${AFS_ETC_BUILDDIR}\fms.pdb"
1187   File "${AFS_SERVER_BUILDDIR}\kaserver.pdb"
1188   File "${AFS_SERVER_BUILDDIR}\ptserver.pdb"
1189   File "${AFS_SERVER_BUILDDIR}\salvager.pdb"
1190   File "${AFS_SERVER_BUILDDIR}\upclient.pdb"
1191   File "${AFS_SERVER_BUILDDIR}\upserver.pdb"
1192   File "${AFS_SERVER_BUILDDIR}\vlserver.pdb"
1193   File "${AFS_SERVER_BUILDDIR}\volinfo.pdb"
1194   File "${AFS_SERVER_BUILDDIR}\volserver.pdb"
1195
1196   ; Do server common components
1197  File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb"
1198  File "${AFS_SERVER_BUILDDIR}\afsbosadmin.pdb"
1199  File "${AFS_SERVER_BUILDDIR}\afscfgadmin.pdb"
1200  File "${AFS_SERVER_BUILDDIR}\afskasadmin.pdb"
1201  File "${AFS_SERVER_BUILDDIR}\afsptsadmin.pdb"
1202  
1203    SetOutPath "$SYSDIR"
1204    File "${AFS_SERVER_BUILDDIR}\afsserver.pdb"
1205
1206    ; Do control center components
1207 DoControl:
1208    SectionGetFlags ${secControl} $R0
1209    IntOp $R0 $R0 & ${SF_SELECTED}
1210    IntCmp $R0 ${SF_SELECTED} +1 DoCommon
1211
1212    SetOutPath "$INSTDIR\Control Center"   
1213   File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager.pdb"
1214   File "${AFS_SERVER_BUILDDIR}\TaAfsAdmSvr.pdb"
1215   File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager.pdb"
1216
1217 DoCommon:
1218   SetOutPath "$INSTDIR\Common"
1219 !IFDEF CL_1400
1220    File "${SYSTEMDIR}\msvcr80d.pdb"
1221    File "${SYSTEMDIR}\msvcp80d.pdb"
1222    File "${SYSTEMDIR}\mfc80d.pdb"
1223 !ELSE
1224 !IFDEF CL_1310
1225    File "${SYSTEMDIR}\msvcr71d.pdb"
1226    File "${SYSTEMDIR}\msvcp71d.pdb"
1227    File "${SYSTEMDIR}\mfc71d.pdb"
1228 !ELSE
1229 !IFDEF CL_1300
1230    File "${SYSTEMDIR}\msvcr70d.pdb"
1231    File "${SYSTEMDIR}\msvcp70d.pdb"
1232    File "${SYSTEMDIR}\mfc70d.pdb"
1233 !ELSE
1234    File "${SYSTEMDIR}\mfc42d.pdb"
1235    File "${SYSTEMDIR}\msvcp60d.pdb"
1236    File "${SYSTEMDIR}\msvcrtd.pdb"
1237 !ENDIF
1238 !ENDIF
1239 !ENDIF
1240   
1241 ; Common Areas
1242    SetOutPath "$INSTDIR\Common"
1243    File "${AFS_CLIENT_BUILDDIR}\afs_config.pdb"
1244    File "${AFS_SERVER_BUILDDIR}\afsadminutil.pdb"
1245    File "${AFS_DESTDIR}\lib\afsauthent.pdb"
1246    File "${AFS_DESTDIR}\lib\afspthread.pdb"
1247    File "${AFS_DESTDIR}\lib\afsrpc.pdb"
1248    File "${AFS_SERVER_BUILDDIR}\afsclientadmin.pdb"
1249    File "${AFS_SERVER_BUILDDIR}\afsprocmgmt.pdb"
1250    File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb"
1251    File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib.pdb"
1252    File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb"
1253    File "${AFS_SERVER_BUILDDIR}\afsbosadmin.pdb"
1254    File "${AFS_SERVER_BUILDDIR}\afscfgadmin.pdb"
1255    File "${AFS_SERVER_BUILDDIR}\afskasadmin.pdb"
1256    File "${AFS_SERVER_BUILDDIR}\afsptsadmin.pdb"
1257
1258 SectionEnd
1259
1260
1261 ;Display the Finish header
1262 ;Insert this macro after the sections if you are not using a finish page
1263 ;!insertmacro MUI_SECTIONS_FINISHHEADER
1264
1265 ;--------------------------------
1266 ;Installer Functions
1267
1268 Function .onInit
1269
1270   !insertmacro MUI_LANGDLL_DISPLAY
1271   
1272   ; Set the default install options
1273         Push $0
1274
1275    Call IsUserAdmin
1276    Pop $R0
1277    StrCmp $R0 "true" contInstall
1278
1279    MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software."
1280    Abort
1281    
1282 contInstall:
1283
1284    ; Set Install Type text
1285    InstTypeSetText 0 "AFS Client"
1286    InstTypeSetText 1 "AFS Administrator"
1287    InstTypeSetText 2 "AFS Server"
1288    InstTypeSetText 3 "AFS Developer Tools"
1289
1290    ; Set sections in each install type
1291    SectionSetInstTypes 0 15             ; AFS Client
1292    SectionSetInstTypes 1 15             ; Loopback adapter
1293    SectionSetInstTypes 2 4              ; AFS Server
1294    SectionSetInstTypes 3 6              ; AFS Control Center
1295    SectionSetInstTypes 4 14             ; Documentation
1296    SectionSetInstTypes 5 8              ; SDK
1297 !ifndef DEBUG
1298    SectionSetInstTypes 6 8              ; Debug symbols
1299 !else
1300    SectionSetInstTypes 6 15             ; Debug symbols
1301 !endif
1302
1303    ; Check that RPC functions are installed (I believe any one of these can be present for
1304    ; OpenAFS to work)
1305    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_np"
1306    StrCmp $R0 "rpcrt4.dll" contInstall2
1307    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_ip_tcp"
1308    StrCmp $R0 "rpcrt4.dll" contInstall2
1309    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncadg_ip_udp"
1310    StrCmp $R0 "rpcrt4.dll" contInstall2
1311    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_http"
1312    StrCmp $R0 "rpcrt4.dll" contInstall2
1313    
1314    MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "An error was detected with your Windows RPC installation. Please make sure Windows RPC is installed before installing OpenAFS."
1315    Abort
1316
1317
1318 contInstall2:
1319    ; If the Loopback is already installed, we mark the option OFF and Read Only
1320    ; so the user can not select it.
1321    Call afs.isLoopbackInstalled
1322    IntCmp $R1 0 SkipLoop
1323    SectionGetFlags ${secLoopback} $0
1324    IntOp $0 $0 & ${SECTION_OFF}
1325    IntOp $0 $0 | ${SF_RO}
1326    SectionSetFlags ${secLoopback} $0
1327    ; And disable the loopback in the types
1328    SectionSetInstTypes 1 0              ; Loopback adapter
1329    
1330 SkipLoop:
1331    ; Never install debug symbols unless explicitly selected, except in DEBUG mode
1332         !IFNDEF DEBUG
1333    SectionGetFlags ${secDebug} $0
1334         IntOp $0 $0 & ${SECTION_OFF}
1335         SectionSetFlags ${secDebug} $0
1336    !ELSE
1337    SectionGetFlags ${secDebug} $0
1338         IntOp $0 $0 | ${SF_SELECTED}
1339         SectionSetFlags ${secDebug} $0
1340    !ENDIF
1341    ; Our logic should be like this.
1342    ;     1) If no AFS components are installed, we do a clean install with default options. (Client/Docs)
1343    ;     2) If existing modules are installed, we keep them selected
1344    ;     3) If it is an upgrade, we set the text accordingly, else we mark it as a re-install
1345    ;  TODO: Downgrade?
1346    Call IsAnyAFSInstalled
1347    Pop $R0
1348    StrCmp $R0 "0" DefaultOptions
1349    
1350    Call ShouldClientInstall
1351    Pop $R2
1352    
1353    ; Check if it was an IBM/Transarc version
1354    ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "DisplayName"
1355    StrCmp $R0 "IBM AFS Client" DoIBM
1356    StrCmp $R0 "Transarc AFS Client" DoIBM
1357 NotIBM:
1358    StrCpy $R9 ""
1359    StrCmp $R2 "0" NoClient
1360    StrCmp $R2 "1" ReinstallClient
1361    StrCmp $R2 "2" UpgradeClient
1362    StrCmp $R2 "3" DowngradeClient
1363    goto Continue
1364 DoIBM:
1365    ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\AFS Client\CurrentVersion" "MajorVersion"
1366    StrCmp $R0 "3" +1 NotIBM
1367    StrCpy $R9 "IBM"
1368    goto UpgradeClient
1369
1370 Continue:
1371         SectionGetFlags ${secClient} $0
1372         IntOp $0 $0 | ${SF_SELECTED}
1373         SectionSetFlags ${secClient} $0
1374     ;# !insertmacro SelectSection ${secClient}
1375    goto skipClient
1376 NoClient:
1377         ;StrCpy $1 ${secClient} ; Gotta remember which section we are at now...
1378         SectionGetFlags ${secClient} $0
1379         IntOp $0 $0 & ${SECTION_OFF}
1380         SectionSetFlags ${secClient} $0
1381    goto skipClient
1382 UpgradeClient:
1383         SectionGetFlags ${secClient} $0
1384         IntOp $0 $0 | ${SF_SELECTED}
1385         SectionSetFlags ${secClient} $0
1386    SectionSetText ${secClient} $(UPGRADE_CLIENT)
1387    goto skipClient
1388 ReinstallClient:
1389         SectionGetFlags ${secClient} $0
1390         IntOp $0 $0 | ${SF_SELECTED}
1391         SectionSetFlags ${secClient} $0
1392    SectionSetText ${secClient} $(REINSTALL_CLIENT)
1393    goto skipClient
1394 DowngradeClient:
1395         SectionGetFlags ${secClient} $0
1396         IntOp $0 $0 | ${SF_SELECTED}
1397         SectionSetFlags ${secClient} $0
1398    SectionSetText ${secClient} $(REINSTALL_CLIENT)
1399    goto skipClient
1400
1401    
1402 skipClient:   
1403    
1404    Call ShouldServerInstall
1405    Pop $R2
1406    StrCmp $R2 "0" NoServer
1407    StrCmp $R2 "1" ReinstallServer
1408    StrCmp $R2 "2" UpgradeServer
1409    StrCmp $R2 "3" DowngradeServer
1410    
1411    SectionGetFlags ${secServer} $0
1412    IntOp $0 $0 | ${SF_SELECTED}
1413    SectionSetFlags ${secServer} $0
1414    ;# !insertmacro UnselectSection ${secServer}
1415    goto skipServer
1416
1417 UpgradeServer:
1418    SectionGetFlags ${secServer} $0
1419    IntOp $0 $0 | ${SF_SELECTED}
1420    SectionSetFlags ${secServer} $0
1421    SectionSetText ${secServer} $(UPGRADE_SERVER)
1422    goto skipServer
1423
1424 ReinstallServer:
1425    SectionGetFlags ${secServer} $0
1426    IntOp $0 $0 | ${SF_SELECTED}
1427    SectionSetFlags ${secServer} $0
1428    SectionSetText ${secServer} $(REINSTALL_SERVER)
1429    goto skipServer
1430
1431 DowngradeServer:
1432    SectionGetFlags ${secServer} $0
1433    IntOp $0 $0 | ${SF_SELECTED}
1434    SectionSetFlags ${secServer} $0
1435    SectionSetText ${secServer} $(REINSTALL_SERVER)
1436    goto skipServer
1437    
1438 NoServer:
1439    SectionGetFlags ${secServer} $0
1440    IntOp $0 $0 & ${SECTION_OFF}
1441    SectionSetFlags ${secServer} $0
1442    ;# !insertmacro UnselectSection ${secServer}
1443    goto skipServer
1444    
1445 skipServer:
1446    ; Check control center
1447    Call IsControlInstalled
1448    Pop $R2
1449    StrCmp $R2 "0" NoControl
1450
1451    SectionGetFlags ${secControl} $0
1452    IntOp $0 $0 | ${SF_SELECTED}
1453    SectionSetFlags ${secControl} $0
1454    goto CheckDocs
1455    
1456 NoControl:   
1457    SectionGetFlags ${secControl} $0
1458    IntOp $0 $0 & ${SECTION_OFF}
1459    SectionSetFlags ${secControl} $0
1460    ;# !insertmacro UnselectSection ${secControl}
1461
1462 CheckDocs:
1463    ; Check Documentation
1464    Call IsDocumentationInstalled
1465    Pop $R2
1466    StrCmp $R2 "0" NoDocs
1467    SectionGetFlags ${secDocs} $0
1468    IntOp $0 $0 | ${SF_SELECTED}
1469    SectionSetFlags ${secDocs} $0
1470    goto CheckSDK
1471    
1472 NoDocs:
1473    SectionGetFlags ${secDocs} $0
1474    IntOp $0 $0 & ${SECTION_OFF}
1475    SectionSetFlags ${secDocs} $0
1476    goto CheckSDK
1477    
1478 ; To check the SDK, we simply look to see if the files exist.  If they do,
1479 ; the SDK is installed.  If not, we don't need to push it on the user.
1480 ; If they are there, we want to make sure they match the installed version.
1481 CheckSDK:
1482    IfFileExists "$INSTDIR\SDK\Include\main.h" +1 NoSDK
1483    SectionGetFlags ${secSDK} $0
1484    IntOp $0 $0 | ${SF_SELECTED}
1485    SectionSetFlags ${secSDK} $0
1486    goto end
1487    
1488 NoSDK:
1489    SectionGetFlags ${secSDK} $0
1490    IntOp $0 $0 & ${SECTION_OFF}
1491    SectionSetFlags ${secSDK} $0
1492    goto end
1493    
1494 DefaultOptions:
1495    ; Client Selected
1496    SectionGetFlags ${secClient} $0
1497    IntOp $0 $0 | ${SF_SELECTED}
1498    SectionSetFlags ${secClient} $0
1499
1500    ; Server NOT selected
1501    SectionGetFlags ${secServer} $0
1502    IntOp $0 $0 & ${SECTION_OFF}
1503    SectionSetFlags ${secServer} $0
1504    
1505    ; Control Center NOT selected
1506    SectionGetFlags ${secControl} $0
1507    IntOp $0 $0 & ${SECTION_OFF}
1508    SectionSetFlags ${secControl} $0
1509    ;# !insertmacro UnselectSection ${secControl}
1510
1511    ; Documentation NOT selected
1512    SectionGetFlags ${secDocs} $0
1513    IntOp $0 $0 & ${SECTION_OFF}
1514    SectionSetFlags ${secDocs} $0
1515    ;# !insertmacro UnselectSection ${secDocs}
1516    
1517    ; SDK not selected
1518    SectionGetFlags ${secSDK} $0
1519    IntOp $0 $0 & ${SECTION_OFF}
1520    SectionSetFlags ${secSDK} $0
1521    ;# !insertmacro UnselectSection ${secSDK}
1522    
1523    goto end
1524
1525 end:
1526    Pop $0
1527   
1528    Push $R0
1529   
1530   ; See if we can set a default installation path...
1531   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PathName"
1532   StrCmp $R0 "" TryServer
1533   Push $R0
1534   Call GetParent
1535   
1536   ; Work around bug in 1.3.5000, 1.3.5100, 1.3.5200, 1.3.5201, 1.3.5299 installers...
1537   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MajorVersion"
1538   StrCmp $R0 "1" +1 SkipParent
1539   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MinorVersion"
1540   StrCmp $R0 "3" +1 SkipParent
1541   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PatchLevel"
1542   StrCmp $R0 "5000" UpParent
1543   StrCmp $R0 "5100" UpParent
1544   StrCmp $R0 "5200" UpParent
1545   StrCmp $R0 "5201" UpParent
1546   StrCmp $R0 "5299" UpParent
1547   goto SkipParent
1548   
1549 UpParent:
1550    Call GetParent
1551   
1552 SkipParent:
1553   Pop $R0
1554   StrCpy $INSTDIR $R0
1555   goto Nope
1556   
1557 TryServer:
1558   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PathName"
1559   StrCmp $R0 "" TryControl
1560   Push $R0
1561   Call GetParent
1562   Pop $R0
1563   StrCpy $INSTDIR $R0
1564   goto Nope
1565    
1566 TryControl:
1567   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PathName"
1568   StrCmp $R0 "" Nope
1569   StrCpy $INSTDIR $R0
1570   
1571 Nope:
1572   Pop $R0
1573   
1574   GetTempFilename $0
1575   File /oname=$0 CellServPage.ini
1576   GetTempFilename $1
1577   File /oname=$1 AFSCell.ini
1578   GetTempFilename $2
1579   File /oname=$2 AFSCreds.ini
1580   ;File /oname=$1 ConfigURL.ini
1581   
1582 FunctionEnd
1583
1584
1585 ;--------------------------------
1586 ; These are our cleanup functions
1587 Function .onInstFailed
1588 Delete $0
1589 Delete $1
1590 FunctionEnd
1591
1592 Function .onInstSuccess
1593 Delete $0
1594 Delete $1
1595 FunctionEnd
1596
1597
1598 ;--------------------------------
1599 ;Descriptions
1600
1601   !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1602   !insertmacro MUI_DESCRIPTION_TEXT ${secServer} $(DESC_secServer)
1603   !insertmacro MUI_DESCRIPTION_TEXT ${secClient} $(DESC_secClient)
1604   !insertmacro MUI_DESCRIPTION_TEXT ${secControl} $(DESC_secControl)
1605   !insertmacro MUI_DESCRIPTION_TEXT ${secDocs} $(DESC_secDocs)
1606   !insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK)
1607   !insertmacro MUI_DESCRIPTION_TEXT ${secLoopback} $(DESC_secLoopback)
1608   !insertmacro MUI_DESCRIPTION_TEXT ${secDebug} $(DESC_secDebug)
1609   !insertmacro MUI_FUNCTION_DESCRIPTION_END
1610  
1611 ;--------------------------------
1612 ;Uninstaller Section
1613
1614 Section "Uninstall"
1615   ; Make sure the user REALLY wants to do this, unless they did a silent uninstall, in which case...let them!
1616   IfSilent StartRemove     ; New in v2.0b4
1617   MessageBox MB_YESNO "Are you sure you want to remove OpenAFS from this machine?" IDYES StartRemove
1618   abort
1619   
1620 StartRemove:
1621   
1622   SetShellVarContext all
1623   ; Stop the running processes
1624   GetTempFileName $R0
1625   File /oname=$R0 "${AFS_WININSTALL_DIR}\Killer.exe"
1626   nsExec::Exec '$R0 afscreds.exe'
1627   Exec "afscreds.exe -z"
1628   ; in case we are upgrading an old version that does not support -z
1629   Sleep 2000
1630   nsExec::Exec '$R0 afscreds.exe'
1631 !IFDEF INSTALL_KFW
1632   nsExec::Exec '$R0 krbcc32s.exe'
1633 !ENDIF
1634
1635   ; Delete the AFS service
1636   GetTempFileName $R0
1637   File /oname=$R0 "${AFS_WININSTALL_DIR}\Service.exe"
1638   nsExec::Exec "net stop TransarcAFSDaemon"
1639   nsExec::Exec "net stop TransarcAFSServer"
1640   nsExec::Exec '$R0 u TransarcAFSDaemon'
1641   ; After we stop the service, but before we delete it, we have to remove the volume data
1642   ; This is because the storage locations are in the registry under the service key.
1643   ; Call un.RemoveAFSVolumes
1644   nsExec::Exec '$R0 u TransarcAFSServer'
1645   Delete $R0
1646   
1647   Call un.RemoveProvider
1648
1649   Push "$INSTDIR\Client\Program"
1650   Call un.RemoveFromPath
1651   Push "$INSTDIR\Common"
1652   Call un.RemoveFromPath
1653 !ifdef INSTALL_KFW
1654   Push "$INSTDIR\kfw\bin"
1655   Call un.RemoveFromPath
1656 !endif
1657   
1658   ; Delete documentation
1659   Delete "$INSTDIR\Documentation\README.TXT"
1660   Delete "$INSTDIR\Documentation\html\*"
1661   Delete "$INSTDIR\Documentation\html\index_files\*"
1662   Delete "$INSTDIR\Documentation\html\CmdRef\*"
1663   Delete "$INSTDIR\Documentation\html\InstallGd\*"
1664   Delete "$INSTDIR\Documentation\html\ReleaseNotes\*"
1665   Delete "$INSTDIR\Documentation\html\ReleaseNotes\logo_files\*"
1666   Delete "$INSTDIR\Documentation\html\SysAdminGd\*"
1667
1668    Delete /REBOOTOK "$INSTDIR\Common\afs_config.exe"
1669    Delete /REBOOTOK "$INSTDIR\Common\afs_shl_ext.dll"
1670    Delete /REBOOTOK "$INSTDIR\Common\afsadminutil.dll"
1671    Delete /REBOOTOK "$INSTDIR\Common\lib\afsauthent.dll"
1672    Delete /REBOOTOK "$INSTDIR\Common\lib\afspthread.dll"
1673    Delete /REBOOTOK "$INSTDIR\Common\lib\afsrpc.dll"
1674    Delete /REBOOTOK "$INSTDIR\Common\afsclientadmin.dll"
1675    Delete /REBOOTOK "$INSTDIR\Common\afsprocmgmt.dll"
1676    Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.dll"
1677    Delete /REBOOTOK "$INSTDIR\Common\TaAfsAppLib.dll"
1678    Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.dll"
1679    Delete /REBOOTOK "$INSTDIR\Common\afsbosadmin.dll"
1680    Delete /REBOOTOK "$INSTDIR\Common\afscfgadmin.dll"
1681    Delete /REBOOTOK "$INSTDIR\Common\afskasadmin.dll"
1682    Delete /REBOOTOK "$INSTDIR\Common\afsptsadmin.dll"
1683
1684    Delete /REBOOTOK "$INSTDIR\Common\afs_config.pdb"
1685    Delete /REBOOTOK "$INSTDIR\Common\afs_shl_ext.pdb"
1686    Delete /REBOOTOK "$INSTDIR\Common\afsadminutil.pdb"
1687    Delete /REBOOTOK "$INSTDIR\Common\lib\afsauthent.pdb"
1688    Delete /REBOOTOK "$INSTDIR\Common\lib\afspthread.pdb"
1689    Delete /REBOOTOK "$INSTDIR\Common\lib\afsrpc.pdb"
1690    Delete /REBOOTOK "$INSTDIR\Common\afsclientadmin.pdb"
1691    Delete /REBOOTOK "$INSTDIR\Common\afsprocmgmt.pdb"
1692    Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.pdb"
1693    Delete /REBOOTOK "$INSTDIR\Common\TaAfsAppLib.pdb"
1694    Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.pdb"
1695    Delete /REBOOTOK "$INSTDIR\Common\afsbosadmin.pdb"
1696    Delete /REBOOTOK "$INSTDIR\Common\afscfgadmin.pdb"
1697    Delete /REBOOTOK "$INSTDIR\Common\afskasadmin.pdb"
1698    Delete /REBOOTOK "$INSTDIR\Common\afsptsadmin.pdb"
1699 !IFDEF DEBUG
1700 !IFDEF CL_1400
1701    Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.dll"
1702    Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.pdb"
1703    Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.dll"
1704    Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.pdb"
1705    Delete /REBOOTOK "$INSTDIR\bin\mfc80d.dll"
1706    Delete /REBOOTOK "$INSTDIR\bin\mfc80d.pdb"
1707 !ELSE
1708 !IFDEF CL_1310
1709    Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll"
1710    Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb"
1711    Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll"
1712    Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb"
1713    Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll"
1714    Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb"
1715 !ELSE
1716 !IFDEF CL_1300
1717    Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll"
1718    Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb"
1719    Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll"
1720    Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb"
1721    Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll"
1722    Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb"
1723 !ELSE
1724    Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll"
1725    Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb"
1726    Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll"
1727    Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb"
1728    Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll"
1729    Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb"
1730 !ENDIF
1731 !ENDIF
1732 !ENDIF
1733 !ELSE
1734 !IFDEF CL_1400
1735    Delete /REBOOTOK "$INSTDIR\bin\mfc80.dll"
1736    Delete /REBOOTOK "$INSTDIR\bin\msvcr80.dll"
1737    Delete /REBOOTOK "$INSTDIR\bin\msvcp80.dll"
1738    Delete /REBOOTOK "$INSTDIR\bin\MFC80CHS.DLL"
1739    Delete /REBOOTOK "$INSTDIR\bin\MFC80CHT.DLL"
1740    Delete /REBOOTOK "$INSTDIR\bin\MFC80DEU.DLL"
1741    Delete /REBOOTOK "$INSTDIR\bin\MFC80ENU.DLL"
1742    Delete /REBOOTOK "$INSTDIR\bin\MFC80ESP.DLL"
1743    Delete /REBOOTOK "$INSTDIR\bin\MFC80FRA.DLL"
1744    Delete /REBOOTOK "$INSTDIR\bin\MFC80ITA.DLL"
1745    Delete /REBOOTOK "$INSTDIR\bin\MFC80JPN.DLL"
1746    Delete /REBOOTOK "$INSTDIR\bin\MFC80KOR.DLL"
1747 !ELSE
1748 !IFDEF CL_1310
1749    Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll"
1750    Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll"
1751    Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll"
1752    Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL"
1753    Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL"
1754    Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL"
1755    Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL"
1756    Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL"
1757    Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL"
1758    Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL"
1759    Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL"
1760    Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL"
1761 !ELSE
1762 !IFDEF CL_1300
1763    Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll"
1764    Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll"
1765    Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll"
1766    Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL"
1767    Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL"
1768    Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL"
1769    Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL"
1770    Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL"
1771    Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL"
1772    Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL"
1773    Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL"
1774    Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL"
1775 !ELSE
1776    Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll"
1777    Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll"
1778    Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll"
1779 !ENDIF
1780 !ENDIF
1781 !ENDIF
1782 !ENDIF
1783   
1784    IfSilent SkipDel
1785 ;  IfFileExists "$INSTDIR\Client\CellServDB" CellExists SkipDelAsk
1786 ;  CellExists:
1787   MessageBox MB_YESNO "Would you like to keep your configuration information?" IDYES SkipDel
1788   Delete "$INSTDIR\Client\CellServDB"
1789
1790 ; Only remove krb5.ini if KfW was installed
1791 !IFDEF INSTALL_KFW
1792   Delete "$WINDIR\krb5.ini"
1793 !ENDIF
1794   Delete "$INSTDIR\Client\afsdns.ini"
1795   
1796   GetTempFileName $R0
1797   File /oname=$R0 "${AFS_WININSTALL_DIR}\AdminGroup.exe"
1798   nsExec::Exec '$R0 -remove'
1799
1800   SkipDel:
1801   Delete "$WINDIR\afsd_init.log"
1802   Delete "$INSTDIR\Uninstall.exe"
1803
1804   ; Remove server
1805   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afskill.exe"
1806   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe"
1807   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosctlsvc.exe"
1808   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosserver.exe"
1809   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\buserver.exe"
1810   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\butc.exe"
1811   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fileserver.exe"
1812   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fms.exe"
1813   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\kaserver.exe"
1814   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\ptserver.exe"
1815   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\salvager.exe"
1816   Delete "$INSTDIR\Server\usr\afs\bin\ServerUninst.dll"
1817   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\upclient.exe"
1818   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\upserver.exe"
1819   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\vlserver.exe"
1820   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\volinfo.exe"
1821   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\volserver.exe"
1822
1823   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afskill.pdb"
1824   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afssvrcfg.pdb"
1825   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosctlsvc.pdb"
1826   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosserver.pdb"
1827   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\buserver.pdb"
1828   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\butc.pdb"
1829   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fileserver.pdb"
1830   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fms.pdb"
1831   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\kaserver.pdb"
1832   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\ptserver.pdb"
1833   Delete "$INSTDIR\Server\usr\afs\bin\salvager.pdb"
1834   Delete "$INSTDIR\Server\usr\afs\bin\ServerUninst.pdb"
1835   Delete "$INSTDIR\Server\usr\afs\bin\upclient.pdb"
1836   Delete "$INSTDIR\Server\usr\afs\bin\upserver.pdb"
1837   Delete "$INSTDIR\Server\usr\afs\bin\vlserver.pdb"
1838   Delete "$INSTDIR\Server\usr\afs\bin\volinfo.pdb"
1839   Delete "$INSTDIR\Server\usr\afs\bin\volserver.pdb"
1840
1841   RMDir /r "$INSTDIR\Server\usr\afs\bin"
1842   ; do not delete the server configuration files
1843   ; or we will lose the volumes and authentication
1844   ; databases
1845   ;RmDir /r "$INSTDIR\Server\usr\afs\etc\logs"
1846   ;RmDir /r "$INSTDIR\Server\usr\afs\etc"
1847   ;RmDir /r "$INSTDIR\Server\usr\afs\local"
1848   ;RMDIR /r "$INSTDIR\Server\usr\afs\logs"
1849   
1850   Delete /REBOOTOK "$SYSDIR\afsserver.cpl"
1851   Delete /REBOOTOK "$SYSDIR\afs_cpa.cpl"
1852   Delete /REBOOTOK "$SYSDIR\afslogon.dll"
1853   Delete /REBOOTOK "$SYSDIR\afscpcc.exe"
1854
1855   Delete /REBOOTOK "$SYSDIR\afsserver.pdb"
1856   Delete /REBOOTOK "$SYSDIR\afs_cpa.pdb"
1857   Delete /REBOOTOK "$SYSDIR\afslogon.pdb"
1858   Delete /REBOOTOK "$SYSDIR\afscpcc.pdb"
1859
1860   RMDir /r "$INSTDIR\Documentation\html\CmdRef"
1861   RMDir /r "$INSTDIR\Documentation\html\InstallGd"
1862   RMDir /r "$INSTDIR\Documentation\html\ReleaseNotes"
1863   RMDir /r "$INSTDIR\Documentation\html\SysAdminGd"
1864   RMDIr /r "$INSTDIR\Documentation\html"
1865   
1866   RMDir "$INSTDIR\Documentation"
1867   ; Delete DOC short cut
1868   Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.exe"
1869
1870   Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.pdb"
1871
1872   Delete /REBOOTOK "$INSTDIR\SDK\Include\*"
1873   Delete /REBOOTOK "$INSTDIR\SDK\Include\afs\*"
1874   Delete /REBOOTOK "$INSTDIR\SDK\Include\rx\*"
1875   Delete /REBOOTOK "$INSTDIR\SDK\Sample\*"
1876   Delete /REBOOTOK "$INSTDIR\SDK\*"
1877
1878   RMDir  "$INSTDIR\SDK\Sample"
1879   RMDir  "$INSTDIR\SDK\Include\afs"
1880   RMDir  "$INSTDIR\SDK\Include\rx"
1881   RMDir  "$INSTDIR\SDK\Include"
1882   RMDir  "$INSTDIR\SDK"
1883
1884   Delete /REBOOTOK "$INSTDIR\Client\Program\*"
1885   Delete /REBOOTOK "$INSTDIR\Client\*"
1886
1887   RMDir  "$INSTDIR\Client\Program"
1888   RMDir  "$INSTDIR\Client"
1889
1890 !IFDEF DEBUG  
1891 !IFDEF CL_1400
1892    Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.dll"
1893    Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.pdb"
1894    Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.dll"
1895    Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.pdb"
1896    Delete /REBOOTOK "$INSTDIR\bin\mfc80d.dll"
1897    Delete /REBOOTOK "$INSTDIR\bin\mfc80d.pdb"
1898 !ELSE
1899 !IFDEF CL_1310
1900    Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll"
1901    Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb"
1902    Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll"
1903    Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb"
1904    Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll"
1905    Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb"
1906 !ELSE
1907 !IFDEF CL_1300
1908    Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll"
1909    Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb"
1910    Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll"
1911    Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb"
1912    Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll"
1913    Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb"
1914 !ELSE
1915    Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll"
1916    Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb"
1917    Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll"
1918    Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb"
1919    Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll"
1920    Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb"
1921 !ENDIF
1922 !ENDIF
1923 !ENDIF
1924 !ELSE
1925 !IFDEF CL_1400
1926    Delete /REBOOTOK "$INSTDIR\bin\mfc80.dll"
1927    Delete /REBOOTOK "$INSTDIR\bin\msvcr80.dll"
1928    Delete /REBOOTOK "$INSTDIR\bin\msvcp80.dll"
1929    Delete /REBOOTOK "$INSTDIR\bin\MFC80CHS.DLL"
1930    Delete /REBOOTOK "$INSTDIR\bin\MFC80CHT.DLL"
1931    Delete /REBOOTOK "$INSTDIR\bin\MFC80DEU.DLL"
1932    Delete /REBOOTOK "$INSTDIR\bin\MFC80ENU.DLL"
1933    Delete /REBOOTOK "$INSTDIR\bin\MFC80ESP.DLL"
1934    Delete /REBOOTOK "$INSTDIR\bin\MFC80FRA.DLL"
1935    Delete /REBOOTOK "$INSTDIR\bin\MFC80ITA.DLL"
1936    Delete /REBOOTOK "$INSTDIR\bin\MFC80JPN.DLL"
1937    Delete /REBOOTOK "$INSTDIR\bin\MFC80KOR.DLL"
1938 !ELSE
1939 !IFDEF CL_1310
1940    Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll"
1941    Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll"
1942    Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll"
1943    Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL"
1944    Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL"
1945    Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL"
1946    Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL"
1947    Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL"
1948    Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL"
1949    Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL"
1950    Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL"
1951    Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL"
1952 !ELSE
1953 !IFDEF CL_1300
1954    Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll"
1955    Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll"
1956    Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll"
1957    Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL"
1958    Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL"
1959    Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL"
1960    Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL"
1961    Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL"
1962    Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL"
1963    Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL"
1964    Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL"
1965    Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL"
1966 !ELSE
1967    Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll"
1968    Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll"
1969    Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll"
1970 !ENDIF
1971 !ENDIF
1972 !ENDIF
1973 !ENDIF
1974
1975   Delete /REBOOTOK "$INSTDIR\Common\*"
1976   RMDir "$INSTDIR\Common"
1977
1978 !ifdef INSTALL_KFW
1979   ;Remove KfW files
1980   Delete /REBOOTOK "$INSTDIR\kfw\bin\*"
1981   RMDIR  /r "$INSTDIR\kfw\bin"
1982   Delete /REBOOTOK "$INSTDIR\kfw\doc\*"
1983   RMDIR  /r "$INSTDIR\kfw\doc"
1984   RMDIR  /r "$INSTDIR\kfw"
1985 !endif
1986
1987   Delete "$SMPROGRAMS\OpenAFS\Documentation.lnk"
1988
1989   ; Remove control center
1990   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAccountManager.exe"
1991   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAdmSvr.exe"
1992   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsServerManager.exe"
1993   Delete /REBOOTOK "$INSTDIR\Control Center\CCUninst.dll"
1994   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAccountManager.pdb"
1995   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAdmSvr.pdb"
1996   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsServerManager.pdb"
1997   RMDir  "$INSTDIR\Control Center"
1998   
1999   Delete "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk"
2000   Delete "$SMPROGRAMS\OpenAFS\Client\Authentication.lnk"
2001   Delete "$SMPROGRAMS\OpenAFS\Control Center\Account Manager.lnk"
2002   Delete "$SMPROGRAMS\OpenAFS\Control Center\Server Manager.lnk"
2003   RMDIR "$SMPROGRAMS\OpenAFS\Control Center"
2004   RMDir /r "$SMPROGRAMS\OpenAFS\Client"
2005   RMDir /r "$SMPROGRAMS\OpenAFS"
2006   Delete "$SMSTARTUP\AFS Credentials.lnk"
2007   
2008   ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "CachePath"
2009   IfErrors +2
2010   Delete "$R0\AFSCache"
2011   Delete "C:\AFSCache"
2012
2013   DeleteRegKey HKCR "*\shellex\ContextMenuHandlers\AFS Client Shell Extension"
2014   DeleteRegKey HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32"
2015   DeleteRegKey HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
2016   DeleteRegKey HKCR "FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension"
2017   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
2018   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls" "afs_cpa"
2019
2020   ; WinLogon Event Notification
2021   DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\AfsLogon"
2022
2023   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion"
2024   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client"
2025   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion"
2026   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation"
2027   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion"
2028   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Control Center"
2029   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion"
2030   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server"
2031   DeleteRegKey /ifempty HKLM "${AFS_REGKEY_ROOT}"
2032   DeleteRegKey HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS"
2033   DeleteRegKey HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred"
2034   DeleteRegKey /ifempty HKLM "Software\MIT\NetIDMgr"
2035   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS"
2036   DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Services\NetBT\Parameters" "SmbDeviceEnabled"
2037
2038   ; Support for apps that wrote submount data directly to afsdsbmt.ini
2039   DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini"
2040
2041   RMDir  "$INSTDIR"
2042
2043 SectionEnd
2044
2045 ;--------------------------------
2046 ;Uninstaller Functions
2047
2048 Function un.onInit
2049
2050   ;Get language from registry
2051   ReadRegStr $LANGUAGE HKCU "Software\OpenAFS\AFS" "Installer Language"
2052
2053 FunctionEnd
2054
2055 Function un.onUninstSuccess
2056
2057   IfSilent SkipAsk
2058   MessageBox MB_OK "Please reboot your machine to complete uninstallation of the software"
2059   SkipAsk:
2060
2061 FunctionEnd
2062
2063 ;------------------------------
2064 ; Get the CellServDB file from the Internet
2065
2066 Function afs.GetCellServDB
2067
2068 ;Check if we should download CellServDB
2069 ReadINIStr $R0 $0 "Field 4" "State"
2070 StrCmp $R0 "1" DoDownload
2071
2072 ;Do nothing if we're keeping the existing file
2073 ReadINIStr $R0 $0 "Field 2" "State"
2074 StrCmp $R0 "1" done
2075
2076 ReadINIStr $R0 $0 "Field 6" "State"
2077 StrCmp $R0 "1" CheckOther
2078
2079 ReadINIStr $R0 $0 "Field 3" "State"
2080 StrCmp $R0 "1" UsePackaged
2081
2082 ; If none of these, grab file from other location
2083 goto UsePackaged
2084
2085 DoDownload:
2086    ReadINIStr $R0 $0 "Field 5" "State"
2087    NSISdl::download $R0 "$INSTDIR\Client\CellServDB"
2088    Pop $R0 ;Get the return value
2089    StrCmp $R0 "success" +2
2090       MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0"
2091    goto done
2092
2093 UsePackaged:
2094    SetOutPath "$INSTDIR\Client"
2095    File "CellServDB"
2096    goto done
2097    
2098 CheckOther:
2099    ReadINIStr $R0 $0 "Field 7" "State"
2100    StrCmp $R0 "" done
2101    CopyFiles $R0 "$INSTDIR\Client\CellServDB"
2102    
2103 done:
2104
2105 FunctionEnd
2106
2107 Function AddProvider
2108    Push $R0
2109    Push $R1
2110    ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder"
2111    Push $R0
2112    StrCpy $R0 "TransarcAFSDaemon"
2113    Push $R0
2114    Call StrStr
2115    Pop $R0
2116    StrCmp $R0 "" +1 DoOther
2117    ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder"   
2118    StrCpy $R0 "$R1,TransarcAFSDaemon"
2119    WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" $R0
2120 DoOther:
2121    ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder"
2122    Push $R0
2123    StrCpy $R0 "TransarcAFSDaemon"
2124    Push $R0
2125    Call StrStr
2126    Pop $R0
2127    StrCmp $R0 "" +1 End
2128    ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder"   
2129    StrCpy $R0 "$R1,TransarcAFSDaemon"
2130    WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" $R0   
2131 End:
2132    Pop $R1
2133    Pop $R0
2134 FunctionEnd
2135
2136 Function un.RemoveProvider
2137    Push $R0
2138    StrCpy $R0 "TransarcAFSDaemon"
2139    Push $R0
2140    StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder"
2141    Call un.RemoveFromProvider
2142    StrCpy $R0 "TransarcAFSDaemon"
2143    Push $R0
2144    StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order"
2145    Call un.RemoveFromProvider
2146    Pop $R0
2147 FunctionEnd
2148
2149 Function un.RemoveFromProvider
2150   Exch $0
2151   Push $1
2152   Push $2
2153   Push $3
2154   Push $4
2155   Push $5
2156   Push $6
2157
2158   ReadRegStr $1 HKLM "$R0" "ProviderOrder"
2159     StrCpy $5 $1 1 -1 # copy last char
2160     StrCmp $5 "," +2 # if last char != ,
2161       StrCpy $1 "$1," # append ,
2162     Push $1
2163     Push "$0,"
2164     Call un.StrStr ; Find `$0,` in $1
2165     Pop $2 ; pos of our dir
2166     StrCmp $2 "" unRemoveFromPath_done
2167       ; else, it is in path
2168       # $0 - path to add
2169       # $1 - path var
2170       StrLen $3 "$0,"
2171       StrLen $4 $2
2172       StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
2173       StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
2174       StrCpy $3 $5$6
2175
2176       StrCpy $5 $3 1 -1 # copy last char
2177       StrCmp $5 "," 0 +2 # if last char == ,
2178         StrCpy $3 $3 -1 # remove last char
2179
2180       WriteRegStr HKLM "$R0" "ProviderOrder" $3
2181       
2182   unRemoveFromPath_done:
2183     Pop $6
2184     Pop $5
2185     Pop $4
2186     Pop $3
2187     Pop $2
2188     Pop $1
2189     Pop $0
2190 FunctionEnd
2191
2192 Function CheckPathForAFS
2193    Push $0
2194    Push $1
2195    Push $2
2196    Push $3
2197    ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
2198    StrCpy $1 "$1;"
2199 loop:
2200    Push $1
2201    Push ";"
2202    Call StrStr
2203    Pop $0
2204    StrLen $2 $0
2205    StrCpy $3 $1 -$2
2206    IfFileExists "$3\afsd_service.exe" Error
2207    StrCpy $1 $0 32768 1
2208    StrLen $2 $1
2209    IntCmp $2 0 Done Done loop
2210    goto Done
2211 Error:
2212    MessageBox MB_ICONSTOP|MB_OK|MB_TOPMOST "This installer is unable to upgrade the previous version of AFS. Please uninstall the current AFS version before continuing."
2213    Abort "Unable to install OpenAFS"
2214 Done:
2215    Pop $3
2216    Pop $2
2217    Pop $1
2218    Pop $0
2219 FunctionEnd
2220
2221 Function AddToUniquePath
2222    Pop $R0
2223    Push $R0
2224    Push "$R0;"
2225    ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
2226    Push "$R0;"
2227    Call StrStr
2228    Pop $R0
2229    StrCmp $R0 "" +1 Done
2230    Call AddToPath
2231 Done:
2232 FunctionEnd
2233
2234
2235 ;-------------------------------
2236 ;Do the page to get the CellServDB
2237
2238 Function AFSPageGetCellServDB
2239   ; Skip this page if we are not installing the client
2240   SectionGetFlags ${secClient} $R0
2241   IntOp $R0 $R0 & ${SF_SELECTED}
2242   StrCmp $R0 "0" Skip
2243   
2244   ; Set the install options here
2245   
2246 startOver:
2247   WriteINIStr $0 "Field 2" "Flags" "DISABLED"
2248   WriteINIStr $0 "Field 3" "State" "1"
2249   WriteINISTR $0 "Field 4" "State" "0"
2250   WriteINIStr $0 "Field 6" "State" "0"
2251   
2252   ; If there is an existing afsdcell.ini file, migrate it to CellServDB
2253   IfFileExists "$WINDIR\afsdcell.ini" +1 +3
2254   CopyFiles /SILENT "$WINDIR\afsdcell.ini" "$INSTDIR\Client\CellServDB"
2255   Delete "$WINDIR\afsdcell.ini"
2256   ; If there is an existing CellServDB file, allow the user to choose it and make it default
2257   IfFileExists "$INSTDIR\Client\CellServDB" +1 notpresent
2258   WriteINIStr $0 "Field 2" "Flags" "ENABLED"
2259   WriteINIStr $0 "Field 2" "State" "1"
2260   WriteINIStr $0 "Field 3" "State" "0"
2261   
2262   notpresent:
2263   
2264   !insertmacro MUI_HEADER_TEXT "CellServDB Configuration" "Please choose a method for installing the CellServDB file:" 
2265   InstallOptions::dialog $0
2266   Pop $R1
2267   StrCmp $R1 "cancel" exit
2268   StrCmp $R1 "back" done
2269   StrCmp $R1 "success" done
2270 exit: Quit
2271 done:
2272
2273    ; Check that if a file is set, a valid filename is entered...
2274    ReadINIStr $R0 $0 "Field 6" "State"
2275    StrCmp $R0 "1" CheckFileName
2276    
2277    ;Check if a URL is specified, one *IS* specified
2278    ReadINIStr $R0 $0 "Field 4" "State"
2279    StrCmp $R0 "1" CheckURL Skip
2280    
2281    CheckURL:
2282    ReadINIStr $R0 $0 "Field 5" "State"
2283    StrCmp $R0 "" +1 Skip
2284    MessageBox MB_OK|MB_ICONSTOP $(URLError)
2285    WriteINIStr $0 "Field 4" "State" "0"
2286    goto startOver
2287    
2288    CheckFileName:
2289    ReadINIStr $R0 $0 "Field 7" "State"
2290    IfFileExists $R0 Skip
2291
2292    MessageBox MB_OK|MB_ICONSTOP $(CellError)
2293    WriteINIStr $0 "Field 6" "State" "0"
2294    goto startOver
2295    
2296    Skip:
2297    
2298 FunctionEnd
2299
2300
2301 Function AFSPageGetCellName
2302    IfSilent good
2303   ; Skip this page if we are not installing the client
2304   SectionGetFlags ${secClient} $R0
2305   IntOp $R0 $R0 & ${SF_SELECTED}
2306   StrCmp $R0 "0" good
2307   
2308 startOver:
2309    ; We want to read in the existing parameters and make them the defaults
2310    
2311    ;AFS Crypt security
2312    ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "SecurityLevel"
2313    StrCmp $R1 "" +3
2314    WriteINIStr $1 "Field 3" "State" $R1
2315    goto +2
2316    WriteINIStr $1 "Field 3" "State" "1"
2317    
2318    ;Use DNS
2319    ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "UseDNS"
2320    StrCmp $R1 "" +3
2321    WriteINIStr $1 "Field 9" "State" $R1
2322    goto +2
2323    WriteINIStr $1 "Field 9" "State" "1"
2324    
2325    ; Use integrated logon
2326    ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "LogonOptions"
2327    StrCmp $R1 "" +3
2328    WriteINIStr $1 "Field 7" "State" $R1
2329    goto +2
2330    WriteINIStr $1 "Field 7" "State" "0"
2331    
2332    ; If this is a server install, we do NOT want to recommend the Freelance client
2333    ; And we do not need to ask for the cell name.
2334    SectionGetFlags ${secServer} $R1
2335    IntOp $R1 $R1 & ${SF_SELECTED}
2336    StrCmp $R1 "1" +1 NotServer
2337    WriteINIStr $1 "Field 6" "Text" "Enable AFS Freelance client (Not Recommended for servers)"
2338    ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient"
2339    StrCmp $R1 "" +3
2340    WriteINIStr $1 "Field 5" "State" $R1
2341    goto +2
2342    WriteINIStr $1 "Field 5" "State" "0"
2343    WriteINIStr $1 "Field 1" "Flags" "DISABLED"
2344    WriteINIStr $1 "Field 2" "Flags" "DISABLED"
2345    goto SkipServerTest
2346 NotServer:
2347    WriteINIStr $1 "Field 6" "Text" "Enable AFS Freelance client (Recommended)"
2348    ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient"
2349    StrCmp $R1 "" +3
2350    WriteINIStr $1 "Field 5" "State" $R1
2351    goto +2
2352    WriteINIStr $1 "Field 5" "State" "1"
2353    WriteINIStr $1 "Field 1" "Flags" ""
2354    WriteINIStr $1 "Field 2" "Flags" ""
2355 SkipServerTest:
2356    ; Get the current cell name, if any
2357    ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "Cell"
2358    StrCmp $R1 "" +2
2359    WriteINIStr $1 "Field 2" "State" $R1
2360   !insertmacro MUI_HEADER_TEXT "Client Cell Name Configuration" "Please enter the name for your default cell:" 
2361   InstallOptions::dialog $1
2362   Pop $R1
2363   StrCmp $R1 "cancel" exit
2364   StrCmp $R1 "back" done
2365   StrCmp $R1 "success" done
2366 exit: Quit
2367 done:
2368    ReadINIStr $R0 $1 "Field 2" "State"
2369    StrCmp $R0 "" +1 good
2370    
2371    MessageBox MB_OK|MB_ICONSTOP $(CellNameError)
2372    goto startOver
2373 good:
2374 FunctionEnd
2375
2376
2377 ;---------------------------------------------------------
2378 ;Do the page to get the afscreds.exe startup configuration
2379
2380 Function AFSPageConfigAFSCreds
2381   ; Skip this page if we are not installing the client
2382   SectionGetFlags ${secClient} $R0
2383   IntOp $R0 $R0 & ${SF_SELECTED}
2384   StrCmp $R0 "0" done
2385   
2386   ; Set the install options here
2387   
2388   !insertmacro MUI_HEADER_TEXT "AFS Credentials Configuration" "Please choose default options for configuring the AFS Credentials program:" 
2389   InstallOptions::dialog $2
2390   Pop $R1
2391   StrCmp $R1 "cancel" exit
2392   StrCmp $R1 "back" done
2393   StrCmp $R1 "success" done
2394 exit: Quit
2395 done:
2396    
2397 FunctionEnd
2398
2399
2400 ;-------------
2401 ; Common install routines for each module
2402 Function AFSCommon.Install
2403
2404 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayName" "OpenAFS for Windows"
2405 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "UninstallString" "$INSTDIR\uninstall.exe"
2406 !ifndef DEBUG
2407 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayVersion" "${AFS_VERSION}"
2408 !else
2409 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayVersion" "${AFS_VERSION} Checked/Debug"
2410 !endif
2411 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "URLInfoAbout" "http://www.openafs.org/"
2412
2413 FunctionEnd
2414
2415
2416 ;-------------------
2417 ; Get the currently installed version and place it on the stack
2418 ; Modifies: Nothing
2419 Function GetInstalledVersion
2420    Push $R0
2421    Push $R1
2422    Push $R4
2423    
2424    ReadRegStr $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "VersionString"
2425    StrCmp $R0 "" NotTransarc done
2426    
2427    
2428 NotTransarc:
2429    ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "VersionString"
2430    StrCmp $R0 "" done
2431    
2432 done:
2433    Pop $R4
2434    Pop $R1
2435    Exch $R0
2436 FunctionEnd
2437
2438 ; Functions to get each component of the version number
2439 Function GetInstalledVersionMajor
2440    Push $R0
2441    Push $R1
2442    Push $R4
2443    
2444    ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "MajorVersion"
2445    StrCmp $R0 "" NotTransarc done
2446    
2447    
2448 NotTransarc:
2449    ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "MajorVersion"
2450    StrCmp $R0 "" done
2451    
2452 done:
2453    Pop $R4
2454    Pop $R1
2455    Exch $R0
2456 FunctionEnd
2457
2458 Function GetInstalledVersionMinor
2459    Push $R0
2460    Push $R1
2461    Push $R4
2462    
2463    ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "MinorVersion"
2464    StrCmp $R0 "" NotTransarc done
2465    
2466    
2467 NotTransarc:
2468    ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "MinorVersion"
2469    StrCmp $R0 "" done
2470    
2471 done:
2472    Pop $R4
2473    Pop $R1
2474    Exch $R0
2475 FunctionEnd
2476
2477 Function GetInstalledVersionPatch
2478    Push $R0
2479    Push $R1
2480    Push $R4
2481    
2482    ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "PatchLevel"
2483    StrCmp $R0 "" NotTransarc done
2484    
2485    
2486 NotTransarc:
2487    ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "PatchLevel"
2488    StrCmp $R0 "" done
2489    
2490 done:
2491    Pop $R4
2492    Pop $R1
2493    Exch $R0
2494 FunctionEnd
2495
2496
2497
2498 ;-------------------------------
2499 ; Check if the client should be checked for default install
2500 Function ShouldClientInstall
2501    Push $R0
2502    StrCpy $R2 "AFS Client"
2503    Call GetInstalledVersion
2504    Pop $R0
2505    
2506    StrCmp $R0 "" NotInstalled
2507    ; Now we see if it's an older or newer version
2508    
2509    Call GetInstalledVersionMajor
2510    Pop $R0
2511    IntCmpU $R0 ${AFS_MAJORVERSION} +1 Upgrade Downgrade
2512
2513    Call GetInstalledVersionMinor
2514    Pop $R0
2515    IntCmpU $R0 ${AFS_MINORVERSION} +1 Upgrade Downgrade
2516    
2517    Call GetInstalledVersionPatch
2518    Pop $R0
2519    IntCmpU $R0 ${AFS_PATCHLEVEL} Reinstall Upgrade Downgrade
2520    
2521 Reinstall:
2522    StrCpy $R0 "1"
2523    Exch $R0
2524    goto end
2525    
2526 Upgrade:
2527    StrCpy $R0 "2"
2528    Exch $R0
2529    goto end
2530    
2531 Downgrade:
2532    StrCpy $R0 "3"
2533    Exch $R0
2534    goto end
2535    
2536 NotInstalled:
2537    StrCpy $R0 "0"
2538    Exch $R0
2539 end:   
2540 FunctionEnd
2541
2542 ;-------------------------------
2543 ; Check how the server options should be set
2544 Function ShouldServerInstall
2545    Push $R0
2546    StrCpy $R2 "AFS Server"
2547    Call GetInstalledVersion
2548    Pop $R0
2549    
2550    StrCmp $R0 "" NotInstalled
2551    ; Now we see if it's an older or newer version
2552
2553    Call GetInstalledVersionMajor
2554    Pop $R0
2555    IntCmpU $R0 ${AFS_MAJORVERSION} +1 Upgrade Downgrade
2556
2557    Call GetInstalledVersionMinor
2558    Pop $R0
2559    IntCmpU $R0 ${AFS_MINORVERSION} +1 Upgrade Downgrade
2560    
2561    Call GetInstalledVersionPatch
2562    Pop $R0
2563    IntCmpU $R0 ${AFS_PATCHLEVEL} Reinstall Upgrade Downgrade
2564    
2565 Reinstall:
2566    StrCpy $R0 "1"
2567    Exch $R0
2568    goto end
2569    
2570 Upgrade:
2571    StrCpy $R0 "2"
2572    Exch $R0
2573    goto end
2574    
2575 Downgrade:
2576    StrCpy $R0 "3"
2577    Exch $R0
2578    goto end
2579    
2580    
2581 NotInstalled:
2582    StrCpy $R0 "0"
2583    Exch $R0
2584 end:   
2585 FunctionEnd
2586
2587
2588 ; See if AFS Server is installed
2589 ; Returns: "1" if it is, 0 if it is not (on the stack)
2590 Function IsServerInstalled
2591    Push $R0
2592    StrCpy $R2 "AFS Server"
2593    Call GetInstalledVersion
2594    Pop $R0
2595    
2596    StrCmp $R0 "" NotInstalled
2597    
2598    StrCpy $R0 "1"
2599    Exch $R0
2600    goto end
2601    
2602 NotInstalled:
2603    StrCpy $R0 "0"
2604    Exch $R0
2605 end:   
2606 FunctionEnd
2607
2608
2609 ; See if AFS Client is installed
2610 ; Returns: "1" if it is, 0 if it is not (on the stack)
2611 Function IsClientInstalled
2612    Push $R0
2613    StrCpy $R2 "AFS Client"
2614    Call GetInstalledVersion
2615    Pop $R0
2616    
2617    StrCmp $R0 "" NotInstalled
2618    
2619    StrCpy $R0 "1"
2620    Exch $R0
2621    goto end
2622    
2623 NotInstalled:
2624    StrCpy $R0 "0"
2625    Exch $R0
2626 end:   
2627 FunctionEnd
2628
2629
2630
2631 ; See if AFS Documentation is installed
2632 ; Returns: "1" if it is, 0 if it is not (on the stack)
2633 Function IsDocumentationInstalled
2634    Push $R0
2635    StrCpy $R2 "AFS Supplemental Documentation"
2636    Call GetInstalledVersion
2637    Pop $R0
2638    
2639    StrCmp $R0 "" NotInstalled
2640    
2641    StrCpy $R0 "1"
2642    Exch $R0
2643    goto end
2644    
2645 NotInstalled:
2646    StrCpy $R0 "0"
2647    Exch $R0
2648 end:   
2649 FunctionEnd
2650
2651
2652 ; See if Control Center is installed
2653 ; Returns: "1" if it is, 0 if it is not (on the stack)
2654 Function IsControlInstalled
2655    Push $R0
2656    StrCpy $R2 "AFS Control Center"
2657    Call GetInstalledVersion
2658    Pop $R0
2659    
2660    StrCmp $R0 "" NotInstalled
2661    
2662    StrCpy $R0 "1"
2663    Exch $R0
2664    goto end
2665    
2666 NotInstalled:
2667    StrCpy $R0 "0"
2668    Exch $R0
2669 end:   
2670 FunctionEnd
2671
2672
2673 !ifdef USE_GETPARAMETERS
2674 ; GetParameters
2675 ; input, none
2676 ; output, top of stack (replaces, with e.g. whatever)
2677 ; modifies no other variables.
2678
2679 Function GetParameters
2680   Push $R0
2681   Push $R1
2682   Push $R2
2683   StrCpy $R0 $CMDLINE 1
2684   StrCpy $R1 '"'
2685   StrCpy $R2 1
2686   StrCmp $R0 '"' loop
2687     StrCpy $R1 ' ' ; we're scanning for a space instead of a quote
2688   loop:
2689     StrCpy $R0 $CMDLINE 1 $R2
2690     StrCmp $R0 $R1 loop2
2691     StrCmp $R0 "" loop2
2692     IntOp $R2 $R2 + 1
2693     Goto loop
2694   loop2:
2695     IntOp $R2 $R2 + 1
2696     StrCpy $R0 $CMDLINE 1 $R2
2697     StrCmp $R0 " " loop2
2698   StrCpy $R0 $CMDLINE "" $R2
2699   Pop $R2
2700   Pop $R1
2701   Exch $R0
2702 FunctionEnd
2703 !endif
2704
2705
2706 ;Check to see if any AFS component is installed
2707 ;Returns: Value on stack: "1" if it is, "0" if it is not
2708 Function IsAnyAFSInstalled
2709    Push $R0
2710    Push $R1
2711    Push $R2
2712    Push $R3
2713    Call IsClientInstalled
2714    Pop $R0
2715    Call IsServerInstalled
2716    Pop $R1
2717    Call IsControlInstalled
2718    Pop $R2
2719    Call IsDocumentationInstalled
2720    Pop $R3
2721    ; Now we must see if ANY of the $Rn values are 1
2722    StrCmp $R0 "1" SomethingInstalled
2723    StrCmp $R1 "1" SomethingInstalled
2724    StrCmp $R2 "1" SomethingInstalled
2725    StrCmp $R3 "1" SomethingInstalled
2726    ;Nothing installed
2727    StrCpy $R0 "0"
2728    goto end
2729 SomethingInstalled:
2730    StrCpy $R0 "1"
2731 end:
2732    Pop $R3
2733    Pop $R2
2734    Pop $R1
2735    Exch $R0
2736 FunctionEnd
2737
2738
2739 ;Install English Language Files
2740 Function AFSLangFiles
2741    ; Common files
2742    SetOutPath "$INSTDIR\Common"
2743    File "${AFS_CLIENT_BUILDDIR}\afs_config.exe"
2744   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afsauthent.dll" "$INSTDIR\Common\afsauthent.dll" "$INSTDIR"
2745   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afspthread.dll" "$INSTDIR\Common\afspthread.dll" "$INSTDIR"
2746   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afsrpc.dll" "$INSTDIR\Common\afsrpc.dll" "$INSTDIR"
2747   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsadminutil.dll"    "$INSTDIR\Common\afsadminutil.dll"    "$INSTDIR"
2748   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsclientadmin.dll"  "$INSTDIR\Common\afsclientadmin.dll"  "$INSTDIR" 
2749   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsprocmgmt.dll"     "$INSTDIR\Common\afsprocmgmt.dll"     "$INSTDIR" 
2750   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsvosadmin.dll"     "$INSTDIR\Common\afsvosadmin.dll"     "$INSTDIR" 
2751   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib.dll"     "$INSTDIR\Common\TaAfsAppLib.dll"     "$INSTDIR" 
2752   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsvosadmin.dll"     "$INSTDIR\Common\afsvosadmin.dll"     "$INSTDIR" 
2753   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsbosadmin.dll"     "$INSTDIR\Common\afsbosadmin.dll"     "$INSTDIR" 
2754   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afscfgadmin.dll"     "$INSTDIR\Common\afscfgadmin.dll"     "$INSTDIR" 
2755   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afskasadmin.dll"     "$INSTDIR\Common\afskasadmin.dll"     "$INSTDIR" 
2756   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsptsadmin.dll"     "$INSTDIR\Common\afsptsadmin.dll"     "$INSTDIR" 
2757
2758  SetOutPath "$INSTDIR\Common"
2759
2760 !IFDEF DEBUG
2761 !IFDEF CL_1400
2762    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr80d.dll" "$INSTDIR\Common\msvcr80d.dll" "$INSTDIR"
2763    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp80d.dll" "$INSTDIR\Common\msvcp80d.dll" "$INSTDIR"
2764    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc80d.dll" "$INSTDIR\Common\mfc80d.dll" "$INSTDIR"
2765    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80CHS.DLL" "$INSTDIR\Common\MFC80CHS.DLL" "$INSTDIR"
2766    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80CHT.DLL" "$INSTDIR\Common\MFC80CHT.DLL" "$INSTDIR"
2767    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80DEU.DLL" "$INSTDIR\Common\MFC80DEU.DLL" "$INSTDIR"
2768    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ENU.DLL" "$INSTDIR\Common\MFC80ENU.DLL" "$INSTDIR"
2769    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ESP.DLL" "$INSTDIR\Common\MFC80ESP.DLL" "$INSTDIR"
2770    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80FRA.DLL" "$INSTDIR\Common\MFC80FRA.DLL" "$INSTDIR"
2771    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ITA.DLL" "$INSTDIR\Common\MFC80ITA.DLL" "$INSTDIR"
2772    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80JPN.DLL" "$INSTDIR\Common\MFC80JPN.DLL" "$INSTDIR"
2773    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80KOR.DLL" "$INSTDIR\Common\MFC80KOR.DLL" "$INSTDIR"
2774 !ELSE
2775 !IFDEF CL_1310
2776    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71d.dll" "$INSTDIR\Common\msvcr71d.dll" "$INSTDIR"
2777    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71d.dll" "$INSTDIR\Common\msvcp71d.dll" "$INSTDIR"
2778    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71d.dll" "$INSTDIR\Common\mfc71d.dll" "$INSTDIR"
2779    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\Common\MFC71CHS.DLL" "$INSTDIR"
2780    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\Common\MFC71CHT.DLL" "$INSTDIR"
2781    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\Common\MFC71DEU.DLL" "$INSTDIR"
2782    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\Common\MFC71ENU.DLL" "$INSTDIR"
2783    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\Common\MFC71ESP.DLL" "$INSTDIR"
2784    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\Common\MFC71FRA.DLL" "$INSTDIR"
2785    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\Common\MFC71ITA.DLL" "$INSTDIR"
2786    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\Common\MFC71JPN.DLL" "$INSTDIR"
2787    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\Common\MFC71KOR.DLL" "$INSTDIR"
2788 !ELSE
2789 !IFDEF CL_1300
2790    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70d.dll" "$INSTDIR\Common\msvcr70d.dll" "$INSTDIR"
2791    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70d.dll" "$INSTDIR\Common\msvcp70d.dll" "$INSTDIR"
2792    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70d.dll" "$INSTDIR\Common\mfc70d.dll" "$INSTDIR"
2793    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\Common\MFC70CHS.DLL" "$INSTDIR"
2794    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\Common\MFC70CHT.DLL" "$INSTDIR"
2795    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\Common\MFC70DEU.DLL" "$INSTDIR"
2796    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\Common\MFC70ENU.DLL" "$INSTDIR"
2797    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\Common\MFC70ESP.DLL" "$INSTDIR"
2798    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\Common\MFC70FRA.DLL" "$INSTDIR"
2799    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\Common\MFC70ITA.DLL" "$INSTDIR"
2800    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\Common\MFC70JPN.DLL" "$INSTDIR"
2801    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\Common\MFC70KOR.DLL" "$INSTDIR"
2802 !ELSE
2803    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42d.dll" "$INSTDIR\Common\mfc42d.dll" "$INSTDIR"
2804    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60d.dll" "$INSTDIR\Common\msvcp60d.dll" "$INSTDIR"
2805    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrtd.dll" "$INSTDIR\Common\msvcrtd.dll" "$INSTDIR"
2806 !ENDIF
2807 !ENDIF
2808 !ENDIF
2809 !ELSE
2810 !IFDEF CL_1400
2811    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc80.dll" "$INSTDIR\Common\mfc80.dll" "$INSTDIR"
2812    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr80.dll" "$INSTDIR\Common\msvcr80.dll" "$INSTDIR"
2813    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp80.dll" "$INSTDIR\Common\msvcp80.dll" "$INSTDIR"
2814    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80CHS.DLL" "$INSTDIR\Common\MFC80CHS.DLL" "$INSTDIR"
2815    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80CHT.DLL" "$INSTDIR\Common\MFC80CHT.DLL" "$INSTDIR"
2816    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80DEU.DLL" "$INSTDIR\Common\MFC80DEU.DLL" "$INSTDIR"
2817    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ENU.DLL" "$INSTDIR\Common\MFC80ENU.DLL" "$INSTDIR"
2818    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ESP.DLL" "$INSTDIR\Common\MFC80ESP.DLL" "$INSTDIR"
2819    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80FRA.DLL" "$INSTDIR\Common\MFC80FRA.DLL" "$INSTDIR"
2820    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ITA.DLL" "$INSTDIR\Common\MFC80ITA.DLL" "$INSTDIR"
2821    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80JPN.DLL" "$INSTDIR\Common\MFC80JPN.DLL" "$INSTDIR"
2822    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80KOR.DLL" "$INSTDIR\Common\MFC80KOR.DLL" "$INSTDIR"
2823 !ELSE
2824 !IFDEF CL_1310
2825    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll" "$INSTDIR\Common\mfc71.dll" "$INSTDIR"
2826    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71.dll" "$INSTDIR\Common\msvcr71.dll" "$INSTDIR"
2827    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71.dll" "$INSTDIR\Common\msvcp71.dll" "$INSTDIR"
2828    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\Common\MFC71CHS.DLL" "$INSTDIR"
2829    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\Common\MFC71CHT.DLL" "$INSTDIR"
2830    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\Common\MFC71DEU.DLL" "$INSTDIR"
2831    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\Common\MFC71ENU.DLL" "$INSTDIR"
2832    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\Common\MFC71ESP.DLL" "$INSTDIR"
2833    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\Common\MFC71FRA.DLL" "$INSTDIR"
2834    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\Common\MFC71ITA.DLL" "$INSTDIR"
2835    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\Common\MFC71JPN.DLL" "$INSTDIR"
2836    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\Common\MFC71KOR.DLL" "$INSTDIR"
2837 !ELSE
2838 !IFDEF CL_1300
2839    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70.dll" "$INSTDIR\Common\mfc70.dll" "$INSTDIR"
2840    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70.dll" "$INSTDIR\Common\msvcr70.dll" "$INSTDIR"
2841    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70.dll" "$INSTDIR\Common\msvcp70.dll" "$INSTDIR"
2842    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\Common\MFC70CHS.DLL" "$INSTDIR"
2843    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\Common\MFC70CHT.DLL" "$INSTDIR"
2844    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\Common\MFC70DEU.DLL" "$INSTDIR"
2845    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\Common\MFC70ENU.DLL" "$INSTDIR"
2846    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\Common\MFC70ESP.DLL" "$INSTDIR"
2847    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\Common\MFC70FRA.DLL" "$INSTDIR"
2848    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\Common\MFC70ITA.DLL" "$INSTDIR"
2849    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\Common\MFC70JPN.DLL" "$INSTDIR"
2850    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\Common\MFC70KOR.DLL" "$INSTDIR"
2851 !ELSE
2852    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42.dll" "$INSTDIR\Common\mfc42.dll" "$INSTDIR"
2853    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60.dll" "$INSTDIR\Common\msvcp60.dll" "$INSTDIR"
2854    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrt.dll" "$INSTDIR\Common\msvcrt.dll" "$INSTDIR"
2855 !ENDIF
2856 !ENDIF
2857 !ENDIF   
2858 !ENDIF
2859
2860    StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
2861    StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman
2862    StrCmp $LANGUAGE ${LANG_SPANISH} DoSpanish
2863    StrCmp $LANGUAGE ${LANG_JAPANESE} DoJapanese
2864    StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean
2865    StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} DoPortugueseBR
2866    StrCmp $LANGUAGE ${LANG_SIMPCHINESE} DoSimpChinese
2867    StrCmp $LANGUAGE ${LANG_TRADCHINESE} DoTradChinese
2868    
2869 DoEnglish:
2870
2871    SetOutPath "$INSTDIR\Documentation"
2872    File "..\..\doc\install\Documentation\en_US\README.TXT"
2873    SetOutPath "$INSTDIR\Documentation\html"
2874    File "..\..\doc\install\Documentation\en_US\html\*"
2875    SetOutPath "$INSTDIR\Documentation\html\index_files"
2876    File "..\..\doc\install\Documentation\en_US\html\index_files\*"
2877    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
2878    File "..\..\doc\install\Documentation\en_US\html\InstallGd\*"
2879    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
2880    File "..\..\doc\install\Documentation\en_US\html\ReleaseNotes\*"
2881    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
2882    File "..\..\doc\install\Documentation\en_US\html\ReleaseNotes\logo_files\*"
2883
2884    SetOutPath "$INSTDIR\Client\Program"
2885    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1033.dll"    "$INSTDIR\Client\Program\afscreds_1033.dll" "$INSTDIR"
2886    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1033.dll" "$INSTDIR\Client\Program\afs_shl_ext_1033.dll" "$INSTDIR"
2887 !ifdef DEBUG
2888    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1033.pdb"
2889    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1033.pdb"
2890 !endif
2891
2892    File "..\..\doc\help\en_US\afs-light.CNT"
2893    File "..\..\doc\help\en_US\afs-light.hlp"
2894    File "..\..\doc\help\en_US\afs-nt.CNT"
2895    File "..\..\doc\help\en_US\afs-nt.HLP"
2896
2897    SetOutPath "$INSTDIR\Common"
2898    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1033.dll"           "$INSTDIR\Common\afs_config_1033.dll" "$INSTDIR"
2899    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1033.dll"              "$INSTDIR\Common\afs_cpa_1033.dll" "$INSTDIR"
2900    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1033.dll"          "$INSTDIR\Common\afseventmsg_1033.dll" "$INSTDIR"
2901   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1033.dll"      "$INSTDIR\Common\afs_setup_utils_1033.dll" "$INSTDIR"
2902    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1033.dll"            "$INSTDIR\Common\afsserver_1033.dll" "$INSTDIR"
2903    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1033.dll"            "$INSTDIR\Common\afssvrcfg_1033.dll" "$INSTDIR"
2904    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1033.dll"  "$INSTDIR\Common\TaAfsAccountManager_1033.dll" "$INSTDIR"
2905    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1033.dll"          "$INSTDIR\Common\TaAfsAppLib_1033.dll" "$INSTDIR"
2906    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1033.dll"   "$INSTDIR\Common\TaAfsServerManager_1033.dll" "$INSTDIR"
2907    File "..\..\doc\help\en_US\afs-cc.CNT"
2908    File "..\..\doc\help\en_US\afs-cc.hlp"
2909    File "..\..\doc\help\en_US\taafscfg.CNT"
2910    File "..\..\doc\help\en_US\taafscfg.hlp"
2911    File "..\..\doc\help\en_US\taafssvrmgr.CNT"
2912    File "..\..\doc\help\en_US\taafssvrmgr.hlp"
2913    File "..\..\doc\help\en_US\taafsusrmgr.CNT"
2914    File "..\..\doc\help\en_US\taafsusrmgr.hlp"
2915
2916 !ifdef DEBUG
2917    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1033.pdb"
2918    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1033.pdb"
2919    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1033.pdb"
2920    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1033.pdb"
2921    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1033.pdb"
2922    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1033.pdb"
2923    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1033.pdb"
2924    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1033.pdb"
2925 !ENDIF
2926    goto done
2927
2928 DoGerman:
2929
2930    SetOutPath "$INSTDIR\Documentation"
2931    File "..\..\doc\install\Documentation\de_DE\README.TXT"
2932    SetOutPath "$INSTDIR\Documentation\html"
2933    File "..\..\doc\install\Documentation\de_DE\html\*"
2934    SetOutPath "$INSTDIR\Documentation\html\index_files"
2935    ;File "..\..\doc\install\Documentation\de_DE\html\index_files\*"
2936    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
2937    File "..\..\doc\install\Documentation\de_DE\html\InstallGd\*"
2938    ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
2939    ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\*"
2940    ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
2941    ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\logo_files\*"
2942
2943    SetOutPath "$INSTDIR\Client\Program"
2944   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1032.dll"                      "$INSTDIR\Client\Program\afscreds_1032.dll" "$INSTDIR"
2945   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1032.dll" "$INSTDIR\Client\Program\afs_shl_ext_1032.dll" "$INSTDIR"
2946 !ifdef DEBUG
2947    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1032.pdb"
2948    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1032.pdb"
2949 !endif
2950
2951    File "..\..\doc\help\de_DE\afs-light.CNT"
2952    File "..\..\doc\help\de_DE\afs-light.hlp"
2953    File "..\..\doc\help\de_DE\afs-nt.CNT"
2954    File "..\..\doc\help\de_DE\afs-nt.HLP"
2955
2956    SetOutPath "$INSTDIR\Common"
2957    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1032.dll"           "$INSTDIR\Common\afs_config_1032.dll" "$INSTDIR"
2958    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1032.dll"              "$INSTDIR\Common\afs_cpa_1032.dll" "$INSTDIR" 
2959    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1032.dll"          "$INSTDIR\Common\afseventmsg_1032.dll" "$INSTDIR" 
2960   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1032.dll"      "$INSTDIR\Common\afs_setup_utils_1032.dll" "$INSTDIR" 
2961    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1032.dll"            "$INSTDIR\Common\afsserver_1032.dll" "$INSTDIR" 
2962    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1032.dll"            "$INSTDIR\Common\afssvrcfg_1032.dll" "$INSTDIR" 
2963    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1032.dll"  "$INSTDIR\Common\TaAfsAccountManager_1032.dll" "$INSTDIR" 
2964    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1032.dll"          "$INSTDIR\Common\TaAfsAppLib_1032.dll" "$INSTDIR" 
2965    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1032.dll"   "$INSTDIR\Common\TaAfsServerManager_1032.dll" "$INSTDIR" 
2966    File "..\..\doc\help\de_DE\afs-cc.CNT"
2967    File "..\..\doc\help\de_DE\afs-cc.hlp"
2968    File "..\..\doc\help\de_DE\taafscfg.CNT"
2969    File "..\..\doc\help\de_DE\taafscfg.hlp"
2970    File "..\..\doc\help\de_DE\taafssvrmgr.CNT"
2971    File "..\..\doc\help\de_DE\taafssvrmgr.hlp"
2972    File "..\..\doc\help\de_DE\taafsusrmgr.CNT"
2973    File "..\..\doc\help\de_DE\taafsusrmgr.hlp"
2974
2975 !ifdef DEBUG
2976    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1032.pdb"
2977    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1032.pdb"
2978    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1032.pdb"
2979    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1032.pdb"
2980    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1032.pdb"
2981    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1032.pdb"
2982    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1032.pdb"
2983    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1032.pdb"
2984 !ENDIF
2985    goto done   
2986
2987 DoSpanish:
2988
2989    SetOutPath "$INSTDIR\Documentation"
2990    File "..\..\doc\install\Documentation\es_ES\README.TXT"
2991    SetOutPath "$INSTDIR\Documentation\html"
2992    ;File "..\..\doc\install\Documentation\es_ES\html\*"
2993    SetOutPath "$INSTDIR\Documentation\html\index_html"
2994    ;File "..\..\doc\install\Documentation\es_ES\html\index_files\*"
2995    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
2996    ;File "..\..\doc\install\Documentation\es_ES\html\InstallGd\*"
2997    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
2998    ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\*"
2999    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3000    ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\logo_files\*"
3001
3002    SetOutPath "$INSTDIR\Client\Program"
3003    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1034.dll"     "$INSTDIR\Client\Program\afscreds_1034.dll" "$INSTDIR" 
3004    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1034.dll" "$INSTDIR\Client\Program\afs_shl_ext_1034.dll" "$INSTDIR"
3005 !ifdef DEBUG
3006    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1034.pdb"
3007    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1034.pdb"
3008 !endif
3009
3010    File "..\..\doc\help\es_ES\afs-light.CNT"
3011    File "..\..\doc\help\es_ES\afs-light.hlp"
3012    File "..\..\doc\help\es_ES\afs-nt.CNT"
3013    File "..\..\doc\help\es_ES\afs-nt.HLP"
3014
3015    SetOutPath "$INSTDIR\Common"
3016    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1034.dll"          "$INSTDIR\Common\afs_config_1034.dll" "$INSTDIR"  
3017    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1034.dll"             "$INSTDIR\Common\afs_cpa_1034.dll" "$INSTDIR"  
3018    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1034.dll"         "$INSTDIR\Common\afseventmsg_1034.dll" "$INSTDIR"  
3019   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1034.dll"     "$INSTDIR\Common\afs_setup_utils_1034.dll" "$INSTDIR"  
3020    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1034.dll"           "$INSTDIR\Common\afsserver_1034.dll" "$INSTDIR"  
3021    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1034.dll"           "$INSTDIR\Common\afssvrcfg_1034.dll" "$INSTDIR"  
3022    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1034.dll" "$INSTDIR\Common\TaAfsAccountManager_1034.dll" "$INSTDIR"  
3023    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1034.dll"         "$INSTDIR\Common\TaAfsAppLib_1034.dll" "$INSTDIR"  
3024    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1034.dll"  "$INSTDIR\Common\TaAfsServerManager_1034.dll" "$INSTDIR"  
3025    File "..\..\doc\help\es_ES\afs-cc.CNT"
3026    File "..\..\doc\help\es_ES\afs-cc.hlp"
3027    File "..\..\doc\help\es_ES\taafscfg.CNT"
3028    File "..\..\doc\help\es_ES\taafscfg.hlp"
3029    File "..\..\doc\help\es_ES\taafssvrmgr.CNT"
3030    File "..\..\doc\help\es_ES\taafssvrmgr.hlp"
3031    File "..\..\doc\help\es_ES\taafsusrmgr.CNT"
3032    File "..\..\doc\help\es_ES\taafsusrmgr.hlp"
3033
3034 !ifdef DEBUG
3035    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1034.pdb"
3036    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1034.pdb"
3037    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1034.pdb"
3038    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1034.pdb"
3039    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1034.pdb"
3040    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1034.pdb"
3041    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1034.pdb"
3042    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1034.pdb"
3043 !ENDIF
3044    goto done
3045
3046 DoJapanese:
3047
3048    SetOutPath "$INSTDIR\Documentation"
3049    File "..\..\doc\install\Documentation\ja_JP\README.TXT"
3050    SetOutPath "$INSTDIR\Documentation\html"
3051    File "..\..\doc\install\Documentation\ja_JP\html\*"
3052    SetOutPath "$INSTDIR\Documentation\html\index_files"
3053    ;File "..\..\doc\install\Documentation\ja_JP\html\index_files\*"
3054    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3055    File "..\..\doc\install\Documentation\ja_JP\html\InstallGd\*"
3056    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3057    ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\*"
3058    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3059    ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\logo_files\*"
3060
3061    SetOutPath "$INSTDIR\Client\Program"
3062    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1041.dll"  "$INSTDIR\Client\Program\afscreds_1041.dll" "$INSTDIR"  
3063    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1041.dll" "$INSTDIR\Client\Program\afs_shl_ext_1041.dll" "$INSTDIR"
3064 !ifdef DEBUG
3065    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1041.pdb"
3066    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1041.pdb"
3067 !endif
3068
3069    File "..\..\doc\help\ja_JP\afs-light.CNT"
3070    File "..\..\doc\help\ja_JP\afs-light.hlp"
3071    File "..\..\doc\help\ja_JP\afs-nt.CNT"
3072    File "..\..\doc\help\ja_JP\afs-nt.HLP"
3073
3074    SetOutPath "$INSTDIR\Common"
3075    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1041.dll"           "$INSTDIR\Common\afs_config_1041.dll" "$INSTDIR"   
3076    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1041.dll"              "$INSTDIR\Common\afs_cpa_1041.dll" "$INSTDIR"   
3077    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1041.dll"          "$INSTDIR\Common\afseventmsg_1041.dll" "$INSTDIR"   
3078   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1041.dll"      "$INSTDIR\Common\afs_setup_utils_1041.dll" "$INSTDIR"   
3079    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1041.dll"            "$INSTDIR\Common\afsserver_1041.dll" "$INSTDIR"   
3080    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1041.dll"            "$INSTDIR\Common\afssvrcfg_1041.dll" "$INSTDIR"   
3081    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1041.dll"  "$INSTDIR\Common\TaAfsAccountManager_1041.dll" "$INSTDIR"   
3082    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1041.dll"          "$INSTDIR\Common\TaAfsAppLib_1041.dll" "$INSTDIR"   
3083    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1041.dll"   "$INSTDIR\Common\TaAfsServerManager_1041.dll" "$INSTDIR"   
3084    File "..\..\doc\help\ja_JP\afs-cc.CNT"
3085    File "..\..\doc\help\ja_JP\afs-cc.hlp"
3086    File "..\..\doc\help\ja_JP\taafscfg.CNT"
3087    File "..\..\doc\help\ja_JP\taafscfg.hlp"
3088    File "..\..\doc\help\ja_JP\taafssvrmgr.CNT"
3089    File "..\..\doc\help\ja_JP\taafssvrmgr.hlp"
3090    File "..\..\doc\help\ja_JP\taafsusrmgr.CNT"
3091    File "..\..\doc\help\ja_JP\taafsusrmgr.hlp"
3092
3093 !ifdef DEBUG
3094    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1041.pdb"
3095    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1041.pdb"
3096    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1041.pdb"
3097    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1041.pdb"
3098    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1041.pdb"
3099    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1041.pdb"
3100    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1041.pdb"
3101    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1041.pdb"
3102 !ENDIF
3103    goto done
3104    
3105 DoKorean:
3106
3107    SetOutPath "$INSTDIR\Documentation"
3108    File "..\..\doc\install\Documentation\ko_KR\README.TXT"
3109    SetOutPath "$INSTDIR\Documentation\html"
3110    File "..\..\doc\install\Documentation\ko_KR\html\*"
3111    SetOutPath "$INSTDIR\Documentation\html\index_files"
3112    ;File "..\..\doc\install\Documentation\ko_KR\html\index_files\*"
3113    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3114    File "..\..\doc\install\Documentation\ko_KR\html\InstallGd\*"
3115    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3116    File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\*"
3117    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3118    ;File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\logo_files\*"
3119
3120    SetOutPath "$INSTDIR\Client\Program"
3121    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1042.dll"  "$INSTDIR\Client\Program\afscreds_1042.dll" "$INSTDIR"   
3122    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1042.dll" "$INSTDIR\Client\Program\afs_shl_ext_1042.dll" "$INSTDIR"
3123 !ifdef DEBUG
3124    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1042.pdb"
3125    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1042.pdb"
3126 !endif
3127
3128    File "..\..\doc\help\ko_KR\afs-light.CNT"
3129    File "..\..\doc\help\ko_KR\afs-light.hlp"
3130    File "..\..\doc\help\ko_KR\afs-nt.CNT"
3131    File "..\..\doc\help\ko_KR\afs-nt.HLP"
3132
3133    SetOutPath "$INSTDIR\Common"
3134    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1042.dll"           "$INSTDIR\Common\afs_config_1042.dll" "$INSTDIR"    
3135    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1042.dll"              "$INSTDIR\Common\afs_cpa_1042.dll" "$INSTDIR"    
3136    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1042.dll"          "$INSTDIR\Common\afseventmsg_1042.dll" "$INSTDIR"    
3137   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1042.dll"      "$INSTDIR\Common\afs_setup_utils_1042.dll" "$INSTDIR"    
3138    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1042.dll"            "$INSTDIR\Common\afsserver_1042.dll" "$INSTDIR"    
3139    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1042.dll"            "$INSTDIR\Common\afssvrcfg_1042.dll" "$INSTDIR"    
3140    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1042.dll"  "$INSTDIR\Common\TaAfsAccountManager_1042.dll" "$INSTDIR"    
3141    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1042.dll"          "$INSTDIR\Common\TaAfsAppLib_1042.dll" "$INSTDIR"    
3142    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1042.dll"   "$INSTDIR\Common\TaAfsServerManager_1042.dll" "$INSTDIR"    
3143    File "..\..\doc\help\ko_KR\afs-cc.CNT"
3144    File "..\..\doc\help\ko_KR\afs-cc.hlp"
3145    File "..\..\doc\help\ko_KR\taafscfg.CNT"
3146    File "..\..\doc\help\ko_KR\taafscfg.hlp"
3147    File "..\..\doc\help\ko_KR\taafssvrmgr.CNT"
3148    File "..\..\doc\help\ko_KR\taafssvrmgr.hlp"
3149    File "..\..\doc\help\ko_KR\taafsusrmgr.CNT"
3150    File "..\..\doc\help\ko_KR\taafsusrmgr.hlp"
3151
3152 !ifdef DEBUG
3153    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1042.pdb"
3154    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1042.pdb"
3155    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1042.pdb"
3156    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1042.pdb"
3157    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1042.pdb"
3158    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1042.pdb"
3159    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1042.pdb"
3160    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1042.pdb"
3161 !ENDIF
3162    goto done
3163
3164
3165 DoPortugueseBR:
3166
3167    SetOutPath "$INSTDIR\Documentation"
3168    File "..\..\doc\install\Documentation\pt_BR\README.TXT"
3169    SetOutPath "$INSTDIR\Documentation\html"
3170    File "..\..\doc\install\Documentation\pt_BR\html\*"
3171    SetOutPath "$INSTDIR\Documentation\html\index_files"
3172    ;File "..\..\doc\install\Documentation\pt_BR\html\index_files\*"
3173    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3174    File "..\..\doc\install\Documentation\pt_BR\html\InstallGd\*"
3175    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3176    File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\*"
3177    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3178    ;File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\logo_files\*"
3179
3180    SetOutPath "$INSTDIR\Client\Program"
3181    !insertmacro ReplaceDLL  "${AFS_CLIENT_BUILDDIR}\afscreds_1046.dll"  "$INSTDIR\Client\Program\afscreds_1046.dll" "$INSTDIR"    
3182    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1046.dll" "$INSTDIR\Client\Program\afs_shl_ext_1046.dll" "$INSTDIR"
3183 !ifdef DEBUG
3184    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1046.pdb"
3185    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1046.pdb"
3186 !endif
3187
3188    File "..\..\doc\help\pt_BR\afs-light.CNT"
3189    File "..\..\doc\help\pt_BR\afs-light.hlp"
3190    File "..\..\doc\help\pt_BR\afs-nt.CNT"
3191    File "..\..\doc\help\pt_BR\afs-nt.HLP"
3192
3193    SetOutPath "$INSTDIR\Common"
3194    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1046.dll"           "$INSTDIR\Common\afs_config_1046.dll" "$INSTDIR"     
3195    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1046.dll"              "$INSTDIR\Common\afs_cpa_1046.dll" "$INSTDIR"     
3196    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1046.dll"          "$INSTDIR\Common\afseventmsg_1046.dll" "$INSTDIR"     
3197   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1046.dll"      "$INSTDIR\Common\afs_setup_utils_1046.dll" "$INSTDIR"     
3198    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1046.dll"            "$INSTDIR\Common\afsserver_1046.dll" "$INSTDIR"     
3199    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1046.dll"            "$INSTDIR\Common\afssvrcfg_1046.dll" "$INSTDIR"     
3200    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1046.dll"  "$INSTDIR\Common\TaAfsAccountManager_1046.dll" "$INSTDIR"     
3201    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1046.dll"          "$INSTDIR\Common\TaAfsAppLib_1046.dll" "$INSTDIR"     
3202    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1046.dll"   "$INSTDIR\Common\TaAfsServerManager_1046.dll" "$INSTDIR"     
3203    File "..\..\doc\help\pt_BR\afs-cc.CNT"
3204    File "..\..\doc\help\pt_BR\afs-cc.hlp"
3205    File "..\..\doc\help\pt_BR\taafscfg.CNT"
3206    File "..\..\doc\help\pt_BR\taafscfg.hlp"
3207    File "..\..\doc\help\pt_BR\taafssvrmgr.CNT"
3208    File "..\..\doc\help\pt_BR\taafssvrmgr.hlp"
3209    File "..\..\doc\help\pt_BR\taafsusrmgr.CNT"
3210    File "..\..\doc\help\pt_BR\taafsusrmgr.hlp"
3211
3212 !ifdef DEBUG
3213    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1046.pdb"
3214    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1046.pdb"
3215    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1046.pdb"
3216    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1046.pdb"
3217    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1046.pdb"
3218    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1046.pdb"
3219    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1046.pdb"
3220    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1046.pdb"
3221 !ENDIF
3222    goto done
3223    
3224 DoSimpChinese:
3225
3226    SetOutPath "$INSTDIR\Documentation"
3227    File "..\..\doc\install\Documentation\zh_CN\README.TXT"
3228    SetOutPath "$INSTDIR\Documentation\html"
3229    File "..\..\doc\install\Documentation\zh_CN\html\*"
3230    SetOutPath "$INSTDIR\Documentation\html\index_files"
3231    ;File "..\..\doc\install\Documentation\zh_CN\html\index_files\*"
3232    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3233    File "..\..\doc\install\Documentation\zh_CN\html\InstallGd\*"
3234    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3235    File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\*"
3236    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3237    ;File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\logo_files\*"
3238
3239    SetOutPath "$INSTDIR\Client\Program"
3240    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_2052.dll"   "$INSTDIR\Client\Program\afscreds_2052.dll" "$INSTDIR"     
3241    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_2052.dll" "$INSTDIR\Client\Program\afs_shl_ext_2052.dll" "$INSTDIR"
3242 !ifdef DEBUG
3243    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_2052.pdb"
3244    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_2052.pdb"
3245 !endif
3246
3247    File "..\..\doc\help\zh_CN\afs-light.CNT"
3248    File "..\..\doc\help\zh_CN\afs-light.hlp"
3249    File "..\..\doc\help\zh_CN\afs-nt.CNT"
3250    File "..\..\doc\help\zh_CN\afs-nt.HLP"
3251
3252    SetOutPath "$INSTDIR\Common"
3253    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_2052.dll"           "$INSTDIR\Common\afs_config_2052.dll" "$INSTDIR"      
3254    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_2052.dll"              "$INSTDIR\Common\afs_cpa_2052.dll" "$INSTDIR"      
3255    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_2052.dll"          "$INSTDIR\Common\afseventmsg_2052.dll" "$INSTDIR"      
3256   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_2052.dll"      "$INSTDIR\Common\afs_setup_utils_2052.dll" "$INSTDIR"      
3257    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_2052.dll"            "$INSTDIR\Common\afsserver_2052.dll" "$INSTDIR"      
3258    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_2052.dll"            "$INSTDIR\Common\afssvrcfg_2052.dll" "$INSTDIR"      
3259    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_2052.dll"  "$INSTDIR\Common\TaAfsAccountManager_2052.dll" "$INSTDIR"      
3260    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_2052.dll"          "$INSTDIR\Common\TaAfsAppLib_2052.dll" "$INSTDIR"      
3261    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_2052.dll"   "$INSTDIR\Common\TaAfsServerManager_2052.dll" "$INSTDIR"      
3262    File "..\..\doc\help\zh_CN\afs-cc.CNT"
3263    File "..\..\doc\help\zh_CN\afs-cc.hlp"
3264    File "..\..\doc\help\zh_CN\taafscfg.CNT"
3265    File "..\..\doc\help\zh_CN\taafscfg.hlp"
3266    File "..\..\doc\help\zh_CN\taafssvrmgr.CNT"
3267    File "..\..\doc\help\zh_CN\taafssvrmgr.hlp"
3268    File "..\..\doc\help\zh_CN\taafsusrmgr.CNT"
3269    File "..\..\doc\help\zh_CN\taafsusrmgr.hlp"
3270
3271 !ifdef DEBUG
3272    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_2052.pdb"
3273    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_2052.pdb"
3274    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_2052.pdb"
3275    ;File "${AFS_SERVER_BUILDDIR}\afsserver_2052.pdb"
3276    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_2052.pdb"
3277    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_2052.pdb"
3278    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_2052.pdb"
3279    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_2052.pdb"
3280 !ENDIF
3281    goto done
3282    
3283 DoTradChinese:
3284
3285    SetOutPath "$INSTDIR\Documentation"
3286    File "..\..\doc\install\Documentation\zh_TW\README.TXT"
3287    SetOutPath "$INSTDIR\Documentation\html"
3288    File "..\..\doc\install\Documentation\zh_TW\html\*"
3289    SetOutPath "$INSTDIR\Documentation\html\index_files"
3290    ;File "..\..\doc\install\Documentation\zh_TW\html\index_files\*"
3291    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3292    File "..\..\doc\install\Documentation\zh_TW\html\InstallGd\*"
3293    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3294    File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\*"
3295    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3296    ;File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\logo_files\*"
3297
3298    SetOutPath "$INSTDIR\Client\Program"
3299    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1028.dll"  "$INSTDIR\Client\Program\_1028.dll" "$INSTDIR"      
3300    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1028.dll" "$INSTDIR\Client\Program\afs_shl_ext_1028.dll" "$INSTDIR"
3301 !ifdef DEBUG
3302    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1028.pdb"
3303    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1028.pdb"
3304 !endif
3305
3306    File "..\..\doc\help\zh_TW\afs-light.CNT"
3307    File "..\..\doc\help\zh_TW\afs-light.hlp"
3308    File "..\..\doc\help\zh_TW\afs-nt.CNT"
3309    File "..\..\doc\help\zh_TW\afs-nt.HLP"
3310
3311    SetOutPath "$INSTDIR\Common"
3312    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1028.dll"           "$INSTDIR\Common\afs_config_1028.dll" "$INSTDIR"       
3313    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1028.dll"              "$INSTDIR\Common\afs_cpa_1028.dll" "$INSTDIR"       
3314    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1028.dll"          "$INSTDIR\Common\afseventmsg_1028.dll" "$INSTDIR"       
3315   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1028.dll"      "$INSTDIR\Common\afs_setup_utils_1028.dll" "$INSTDIR"       
3316    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1028.dll"            "$INSTDIR\Common\afsserver_1028.dll" "$INSTDIR"       
3317    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1028.dll"            "$INSTDIR\Common\afssvrcfg_1028.dll" "$INSTDIR"       
3318    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1028.dll"  "$INSTDIR\Common\TaAfsAccountManager_1028.dll" "$INSTDIR"       
3319    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1028.dll"          "$INSTDIR\Common\TaAfsAppLib_1028.dll" "$INSTDIR"       
3320    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1028.dll"   "$INSTDIR\Common\TaAfsServerManager_1028.dll" "$INSTDIR"       
3321    File "..\..\doc\help\zh_TW\afs-cc.CNT"
3322    File "..\..\doc\help\zh_TW\afs-cc.hlp"
3323    File "..\..\doc\help\zh_TW\taafscfg.CNT"
3324    File "..\..\doc\help\zh_TW\taafscfg.hlp"
3325    File "..\..\doc\help\zh_TW\taafssvrmgr.CNT"
3326    File "..\..\doc\help\zh_TW\taafssvrmgr.hlp"
3327    File "..\..\doc\help\zh_TW\taafsusrmgr.CNT"
3328    File "..\..\doc\help\zh_TW\taafsusrmgr.hlp"
3329
3330 !ifdef DEBUG
3331    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1028.pdb"
3332    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1028.pdb"
3333    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1028.pdb"
3334    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1028.pdb"
3335    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1028.pdb"
3336    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1028.pdb"
3337    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1028.pdb"
3338    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1028.pdb"
3339 !ENDIF
3340    goto done
3341    
3342 done:
3343
3344   ; Write start menu shortcut
3345   SetOutPath "$SMPROGRAMS\OpenAFS"
3346   CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation.lnk" "$INSTDIR\Documentation\html\index.htm"
3347   
3348
3349 FunctionEnd
3350
3351
3352
3353 ;====================================================
3354 ; AddToPath - Adds the given dir to the search path.
3355 ;        Input - head of the stack
3356 ;        Note - Win9x systems requires reboot
3357 ;====================================================
3358 Function AddToPath
3359   Exch $0
3360   Push $1
3361   Push $2
3362   Push $3
3363
3364   # don't add if the path doesn't exist
3365   IfFileExists $0 "" AddToPath_done
3366
3367   ReadEnvStr $1 PATH
3368   Push "$1;"
3369   Push "$0;"
3370   Call StrStr
3371   Pop $2
3372   StrCmp $2 "" "" AddToPath_done
3373   Push "$1;"
3374   Push "$0\;"
3375   Call StrStr
3376   Pop $2
3377   StrCmp $2 "" "" AddToPath_done
3378   GetFullPathName /SHORT $3 $0
3379   Push "$1;"
3380   Push "$3;"
3381   Call StrStr
3382   Pop $2
3383   StrCmp $2 "" "" AddToPath_done
3384   Push "$1;"
3385   Push "$3\;"
3386   Call StrStr
3387   Pop $2
3388   StrCmp $2 "" "" AddToPath_done
3389
3390   Call IsNT
3391   Pop $1
3392   StrCmp $1 1 AddToPath_NT
3393     ; Not on NT
3394     StrCpy $1 $WINDIR 2
3395     FileOpen $1 "$1\autoexec.bat" a
3396     FileSeek $1 -1 END
3397     FileReadByte $1 $2
3398     IntCmp $2 26 0 +2 +2 # DOS EOF
3399       FileSeek $1 -1 END # write over EOF
3400     FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
3401     FileClose $1
3402     SetRebootFlag true
3403     Goto AddToPath_done
3404
3405   AddToPath_NT:
3406     ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
3407     StrCpy $2 $1 1 -1 # copy last char
3408     StrCmp $2 ";" 0 +2 # if last char == ;
3409       StrCpy $1 $1 -1 # remove last char
3410     StrCmp $1 "" AddToPath_NTdoIt
3411       StrCpy $0 "$1;$0"
3412     AddToPath_NTdoIt:
3413       WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $0
3414       SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
3415
3416   AddToPath_done:
3417     Pop $3
3418     Pop $2
3419     Pop $1
3420     Pop $0
3421 FunctionEnd
3422
3423 ;====================================================
3424 ; RemoveFromPath - Remove a given dir from the path
3425 ;     Input: head of the stack
3426 ;====================================================
3427 Function un.RemoveFromPath
3428   Exch $0
3429   Push $1
3430   Push $2
3431   Push $3
3432   Push $4
3433   Push $5
3434   Push $6
3435
3436   IntFmt $6 "%c" 26 # DOS EOF
3437
3438   Call un.IsNT
3439   Pop $1
3440   StrCmp $1 1 unRemoveFromPath_NT
3441     ; Not on NT
3442     StrCpy $1 $WINDIR 2
3443     FileOpen $1 "$1\autoexec.bat" r
3444     GetTempFileName $4
3445     FileOpen $2 $4 w
3446     GetFullPathName /SHORT $0 $0
3447     StrCpy $0 "SET PATH=%PATH%;$0"
3448     Goto unRemoveFromPath_dosLoop
3449
3450     unRemoveFromPath_dosLoop:
3451       FileRead $1 $3
3452       StrCpy $5 $3 1 -1 # read last char
3453       StrCmp $5 $6 0 +2 # if DOS EOF
3454         StrCpy $3 $3 -1 # remove DOS EOF so we can compare
3455       StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
3456       StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
3457       StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
3458       StrCmp $3 "" unRemoveFromPath_dosLoopEnd
3459       FileWrite $2 $3
3460       Goto unRemoveFromPath_dosLoop
3461       unRemoveFromPath_dosLoopRemoveLine:
3462         SetRebootFlag true
3463         Goto unRemoveFromPath_dosLoop
3464
3465     unRemoveFromPath_dosLoopEnd:
3466       FileClose $2
3467       FileClose $1
3468       StrCpy $1 $WINDIR 2
3469       Delete "$1\autoexec.bat"
3470       CopyFiles /SILENT $4 "$1\autoexec.bat"
3471       Delete $4
3472       Goto unRemoveFromPath_done
3473
3474   unRemoveFromPath_NT:
3475     ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
3476     StrCpy $5 $1 1 -1 # copy last char
3477     StrCmp $5 ";" +2 # if last char != ;
3478       StrCpy $1 "$1;" # append ;
3479     Push $1
3480     Push "$0;"
3481     Call un.StrStr ; Find `$0;` in $1
3482     Pop $2 ; pos of our dir
3483     StrCmp $2 "" unRemoveFromPath_done
3484       ; else, it is in path
3485       # $0 - path to add
3486       # $1 - path var
3487       StrLen $3 "$0;"
3488       StrLen $4 $2
3489       StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
3490       StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
3491       StrCpy $3 $5$6
3492
3493       StrCpy $5 $3 1 -1 # copy last char
3494       StrCmp $5 ";" 0 +2 # if last char == ;
3495         StrCpy $3 $3 -1 # remove last char
3496
3497       WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3
3498       SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
3499
3500   unRemoveFromPath_done:
3501     Pop $6
3502     Pop $5
3503     Pop $4
3504     Pop $3
3505     Pop $2
3506     Pop $1
3507     Pop $0
3508 FunctionEnd
3509
3510 ;====================================================
3511 ; IsNT - Returns 1 if the current system is NT, 0
3512 ;        otherwise.
3513 ;     Output: head of the stack
3514 ;====================================================
3515 !macro IsNT un
3516 Function ${un}IsNT
3517   Push $0
3518   ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
3519   StrCmp $0 "" 0 IsNT_yes
3520   ; we are not NT.
3521   Pop $0
3522   Push 0
3523   Return
3524
3525   IsNT_yes:
3526     ; NT!!!
3527     Pop $0
3528     Push 1
3529 FunctionEnd
3530 !macroend
3531 !insertmacro IsNT ""
3532 !insertmacro IsNT "un."
3533
3534 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3535 ; Uninstall stuff
3536 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3537 ;====================================================
3538 ; StrStr - Finds a given string in another given string.
3539 ;               Returns -1 if not found and the pos if found.
3540 ;          Input: head of the stack - string to find
3541 ;                      second in the stack - string to find in
3542 ;          Output: head of the stack
3543 ;====================================================
3544 !macro StrStr un
3545 Function ${un}StrStr
3546 Exch $R1 ; st=haystack,old$R1, $R1=needle
3547   Exch    ; st=old$R1,haystack
3548   Exch $R2 ; st=old$R1,old$R2, $R2=haystack
3549   Push $R3
3550   Push $R4
3551   Push $R5
3552   StrLen $R3 $R1
3553   StrCpy $R4 0
3554   ; $R1=needle
3555   ; $R2=haystack
3556   ; $R3=len(needle)
3557   ; $R4=cnt
3558   ; $R5=tmp
3559   loop:
3560     StrCpy $R5 $R2 $R3 $R4
3561     StrCmp $R5 $R1 done
3562     StrCmp $R5 "" done
3563     IntOp $R4 $R4 + 1
3564     Goto loop
3565 done:
3566   StrCpy $R1 $R2 "" $R4
3567   Pop $R5
3568   Pop $R4
3569   Pop $R3
3570   Pop $R2
3571   Exch $R1
3572 FunctionEnd
3573 !macroend
3574 !insertmacro StrStr ""
3575 !insertmacro StrStr "un."
3576
3577
3578 !ifdef ADDSHAREDDLLUSED
3579 ; AddSharedDLL
3580  ;
3581  ; Increments a shared DLLs reference count.
3582  ; Use by passing one item on the stack (the full path of the DLL).
3583  ;
3584  ; Usage:
3585  ;   Push $SYSDIR\myDll.dll
3586  ;   Call AddSharedDLL
3587  ;
3588
3589  Function AddSharedDLL
3590    Exch $R1
3591    Push $R0
3592    ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
3593    IntOp $R0 $R0 + 1
3594    WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0
3595    Pop $R0
3596    Pop $R1
3597  FunctionEnd
3598
3599  
3600 ; un.RemoveSharedDLL
3601  ;
3602  ; Decrements a shared DLLs reference count, and removes if necessary.
3603  ; Use by passing one item on the stack (the full path of the DLL).
3604  ; Note: for use in the main installer (not the uninstaller), rename the
3605  ; function to RemoveSharedDLL.
3606  ;
3607  ; Usage:
3608  ;   Push $SYSDIR\myDll.dll
3609  ;   Call un.RemoveSharedDLL
3610  ;
3611
3612  Function un.RemoveSharedDLL
3613    Exch $R1
3614    Push $R0
3615    ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
3616    StrCmp $R0 "" remove
3617      IntOp $R0 $R0 - 1
3618      IntCmp $R0 0 rk rk uk
3619      rk:
3620        DeleteRegValue HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
3621      goto Remove
3622      uk:
3623        WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0
3624      Goto noremove
3625    remove:
3626      Delete /REBOOTOK $R1
3627    noremove:
3628    Pop $R0
3629    Pop $R1
3630  FunctionEnd
3631 !endif
3632
3633
3634 ; Installs the loopback adpater and disables it on Windows 2000
3635 Function afs.InstallMSLoopback
3636    GetTempFileName $R0
3637    File /oname=$R0 "${AFS_WININSTALL_DIR}\afsloopback.dll"
3638    nsExec::Exec "rundll32.exe $R0 doLoopBackEntry AFS 10.254.254.253 255.255.255.252"
3639    Delete $R0
3640 FunctionEnd
3641
3642 Function afs.isLoopbackInstalled
3643    SetOutPath $TEMP
3644    File "${AFS_WININSTALL_DIR}\afsloopback.dll"
3645    System::Call "$TEMP\afsloopback.dll::IsLoopbackInstalled() i().r11"
3646    Delete "$TEMP\afsloopback.dll"
3647 FunctionEnd
3648
3649
3650 ; GetWindowsVersion
3651 ;
3652 ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
3653 ; Updated by Joost Verburg
3654 ;
3655 ; Returns on top of stack
3656 ;
3657 ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
3658 ; or
3659 ; '' (Unknown Windows Version)
3660 ;
3661 ; Usage:
3662 ;   Call GetWindowsVersion
3663 ;   Pop $R0
3664 ;   ; at this point $R0 is "NT 4.0" or whatnot
3665
3666 Function GetWindowsVersion
3667
3668   Push $R0
3669   Push $R1
3670
3671   ClearErrors
3672
3673   ReadRegStr $R0 HKLM \
3674   "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
3675
3676   IfErrors 0 lbl_winnt
3677   
3678   ; we are not NT
3679   ReadRegStr $R0 HKLM \
3680   "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
3681
3682   StrCpy $R1 $R0 1
3683   StrCmp $R1 '4' 0 lbl_error
3684
3685   StrCpy $R1 $R0 3
3686
3687   StrCmp $R1 '4.0' lbl_win32_95
3688   StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
3689
3690   lbl_win32_95:
3691     StrCpy $R0 '95'
3692   Goto lbl_done
3693
3694   lbl_win32_98:
3695     StrCpy $R0 '98'
3696   Goto lbl_done
3697
3698   lbl_win32_ME:
3699     StrCpy $R0 'ME'
3700   Goto lbl_done
3701
3702   lbl_winnt:
3703
3704   StrCpy $R1 $R0 1
3705
3706   StrCmp $R1 '3' lbl_winnt_x
3707   StrCmp $R1 '4' lbl_winnt_x
3708
3709   StrCpy $R1 $R0 3
3710
3711   StrCmp $R1 '5.0' lbl_winnt_2000
3712   StrCmp $R1 '5.1' lbl_winnt_XP
3713   StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
3714
3715   lbl_winnt_x:
3716     StrCpy $R0 "NT $R0" 6
3717   Goto lbl_done
3718
3719   lbl_winnt_2000:
3720     Strcpy $R0 '2000'
3721   Goto lbl_done
3722
3723   lbl_winnt_XP:
3724     Strcpy $R0 'XP'
3725   Goto lbl_done
3726
3727   lbl_winnt_2003:
3728     Strcpy $R0 '2003'
3729   Goto lbl_done
3730
3731   lbl_error:
3732     Strcpy $R0 ''
3733   lbl_done:
3734
3735   Pop $R1
3736   Exch $R0
3737
3738 FunctionEnd
3739
3740
3741 ; Author: Lilla (lilla@earthlink.net) 2003-06-13
3742 ; function IsUserAdmin uses plugin \NSIS\PlusgIns\UserInfo.dll
3743 ; This function is based upon code in \NSIS\Contrib\UserInfo\UserInfo.nsi
3744 ; This function was tested under NSIS 2 beta 4 (latest CVS as of this writing).
3745 ;
3746 ; Usage:
3747 ;   Call IsUserAdmin
3748 ;   Pop $R0   ; at this point $R0 is "true" or "false"
3749 ;
3750 Function IsUserAdmin
3751 Push $R0
3752 Push $R1
3753 Push $R2
3754
3755 ClearErrors
3756 UserInfo::GetName
3757 IfErrors Win9x
3758 Pop $R1
3759 UserInfo::GetAccountType
3760 Pop $R2
3761
3762 StrCmp $R2 "Admin" 0 Continue
3763 ; Observation: I get here when running Win98SE. (Lilla)
3764 ; The functions UserInfo.dll looks for are there on Win98 too, 
3765 ; but just don't work. So UserInfo.dll, knowing that admin isn't required
3766 ; on Win98, returns admin anyway. (per kichik)
3767 ; MessageBox MB_OK 'User "$R1" is in the Administrators group'
3768 StrCpy $R0 "true"
3769 Goto Done
3770
3771 Continue:
3772 ; You should still check for an empty string because the functions
3773 ; UserInfo.dll looks for may not be present on Windows 95. (per kichik)
3774 StrCmp $R2 "" Win9x
3775 StrCpy $R0 "false"
3776 ;MessageBox MB_OK 'User "$R1" is in the "$R2" group'
3777 Goto Done
3778
3779 Win9x:
3780 ; comment/message below is by UserInfo.nsi author:
3781 ; This one means you don't need to care about admin or
3782 ; not admin because Windows 9x doesn't either
3783 ;MessageBox MB_OK "Error! This DLL can't run under Windows 9x!"
3784 StrCpy $R0 "false"
3785
3786 Done:
3787 ;MessageBox MB_OK 'User= "$R1"  AccountType= "$R2"  IsUserAdmin= "$R0"'
3788
3789 Pop $R2
3790 Pop $R1
3791 Exch $R0
3792 FunctionEnd
3793
3794 ; GetParent
3795  ; input, top of stack  (e.g. C:\Program Files\Poop)
3796  ; output, top of stack (replaces, with e.g. C:\Program Files)
3797  ; modifies no other variables.
3798  ;
3799  ; Usage:
3800  ;   Push "C:\Program Files\Directory\Whatever"
3801  ;   Call GetParent
3802  ;   Pop $R0
3803  ;   ; at this point $R0 will equal "C:\Program Files\Directory"
3804
3805 Function GetParent
3806
3807   Exch $R0
3808   Push $R1
3809   Push $R2
3810   Push $R3
3811   
3812   StrCpy $R1 0
3813   StrLen $R2 $R0
3814   
3815   loop:
3816     IntOp $R1 $R1 + 1
3817     IntCmp $R1 $R2 get 0 get
3818     StrCpy $R3 $R0 1 -$R1
3819     StrCmp $R3 "\" get
3820   Goto loop
3821   
3822   get:
3823     StrCpy $R0 $R0 -$R1
3824     
3825     Pop $R3
3826     Pop $R2
3827     Pop $R1
3828     Exch $R0
3829     
3830 FunctionEnd
3831
3832
3833 ;--------------------------------
3834 ;Handle what must and what must not be installed
3835 Function .onSelChange
3836    ; If they install the server, they MUST install the client
3837    SectionGetFlags ${secServer} $R0
3838    IntOp $R0 $R0 & ${SF_SELECTED}
3839    StrCmp $R0 "1" MakeClientSelected
3840    
3841    ; If they install the control center, we'll give them the client.
3842    ; It may not be required, but it's a bit more useful
3843    SectionGetFlags ${secControl} $R0
3844    IntOp $R0 $R0 & ${SF_SELECTED}
3845    StrCmp $R0 "1" MakeClientSelected
3846    goto end
3847    
3848 MakeClientSelected:
3849    SectionGetFlags ${secClient} $R0
3850    IntOp $R0 $R0 | ${SF_SELECTED}
3851    SectionSetFlags ${secClient} $R0
3852    
3853 end:
3854 FunctionEnd
3855
3856 Function RegWriteMultiStr
3857 !define HKEY_CLASSES_ROOT        0x80000000
3858 !define HKEY_CURRENT_USER        0x80000001
3859 !define HKEY_LOCAL_MACHINE       0x80000002
3860 !define HKEY_USERS               0x80000003
3861 !define HKEY_PERFORMANCE_DATA    0x80000004
3862 !define HKEY_PERFORMANCE_TEXT    0x80000050
3863 !define HKEY_PERFORMANCE_NLSTEXT 0x80000060
3864 !define HKEY_CURRENT_CONFIG      0x80000005
3865 !define HKEY_DYN_DATA            0x80000006
3866
3867 !define KEY_QUERY_VALUE          0x0001
3868 !define KEY_SET_VALUE            0x0002
3869 !define KEY_CREATE_SUB_KEY       0x0004
3870 !define KEY_ENUMERATE_SUB_KEYS   0x0008
3871 !define KEY_NOTIFY               0x0010
3872 !define KEY_CREATE_LINK          0x0020
3873
3874 !define REG_NONE                 0
3875 !define REG_SZ                   1
3876 !define REG_EXPAND_SZ            2
3877 !define REG_BINARY               3
3878 !define REG_DWORD                4
3879 !define REG_DWORD_LITTLE_ENDIAN  4
3880 !define REG_DWORD_BIG_ENDIAN     5
3881 !define REG_LINK                 6
3882 !define REG_MULTI_SZ             7
3883
3884 !define RegCreateKey             "Advapi32::RegCreateKeyA(i, t, *i) i"
3885 !define RegSetValueEx            "Advapi32::RegSetValueExA(i, t, i, i, i, i) i"
3886 !define RegCloseKey              "Advapi32::RegCloseKeyA(i) i"
3887
3888   Exch $R0
3889   Push $1
3890   Push $2
3891   Push $9
3892
3893   SetPluginUnload alwaysoff
3894   ; Create a buffer for the multi_sz value
3895   System::Call "*(&t${NSIS_MAX_STRLEN}) i.r1"
3896   ; Open/create the registry key
3897   System::Call "${RegCreateKey}(${HKEY_LOCAL_MACHINE}, '$REG_SUB_KEY', .r0) .r9"
3898   ; Failed?
3899   IntCmp $9 0 write
3900     MessageBox MB_OK|MB_ICONSTOP "Can't create registry key! ($9)"
3901     Goto noClose
3902
3903   write:
3904     ; Fill in the buffer with our strings
3905     StrCpy $2 $1                            ; Initial position
3906
3907     StrLen $9 '$REG_DATA_1'                 ; Length of first string
3908     IntOp $9 $9 + 1                         ; Plus null
3909     System::Call "*$2(&t$9 '$REG_DATA_1')"  ; Place the string
3910     IntOp $2 $2 + $9                        ; Advance to the next position
3911
3912     StrCmp '$REG_DATA_2' "" terminate
3913     StrLen $9 '$REG_DATA_2'                 ; Length of second string
3914     IntOp $9 $9 + 1                         ; Plus null
3915     System::Call "*$2(&t$9 '$REG_DATA_2')"  ; Place the string
3916     IntOp $2 $2 + $9                        ; Advance to the next position
3917
3918     StrCmp '$REG_DATA_3' "" terminate
3919     StrLen $9 '$REG_DATA_3'                 ; Length of third string
3920     IntOp $9 $9 + 1                         ; Plus null
3921     System::Call "*$2(&t$9 '$REG_DATA_3')"  ; Place the string
3922     IntOp $2 $2 + $9                        ; Advance to the next position
3923
3924     StrCmp '$REG_DATA_4' "" terminate
3925     StrLen $9 '$REG_DATA_4'                 ; Length of third string
3926     IntOp $9 $9 + 1                         ; Plus null
3927     System::Call "*$2(&t$9 '$REG_DATA_4')"  ; Place the string
3928     IntOp $2 $2 + $9                        ; Advance to the next position
3929
3930   terminate:
3931     System::Call "*$2(&t1 '')"              ; Place the terminating null
3932     IntOp $2 $2 + 1                         ; Advance to the next position
3933
3934     ; Create/write the value
3935     IntOp $2 $2 - $1                        ; Total length
3936     System::Call "${RegSetValueEx}(r0, '$REG_VALUE', 0, ${REG_MULTI_SZ}, r1, r2) .r9"
3937     ; Failed?
3938     IntCmp $9 0 done
3939       MessageBox MB_OK|MB_ICONSTOP "Can't set key value! ($9)"
3940       Goto done
3941
3942   done:
3943     ; Close the registry key
3944     System::Call "${RegCloseKey}(r0)"
3945
3946 noClose:
3947   ; Clear the buffer
3948   SetPluginUnload manual
3949   System::Free $1
3950
3951   Pop $9
3952   Pop $2
3953   Pop $1
3954   Exch $R0
3955 FunctionEnd
3956
3957 Function CreateDesktopIni
3958    WriteIniStr "$INSTDIR\Desktop.ini" ".ShellClassInfo" "IconFile" "client\program\afsd_service.exe"
3959    WriteIniStr "$INSTDIR\Desktop.ini" ".ShellClassInfo" "IconIndex" "0"
3960    SetFileAttributes "$INSTDIR\Desktop.ini" HIDDEN|SYSTEM
3961    SetFileAttributes "$INSTDIR\" READONLY
3962 FunctionEnd