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