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