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