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