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