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