Windows: NSIS installer requires the architecture for CL=1400
[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\5"
1041    SetOutPath "$INSTDIR\Documentation\html\CmdRef\5"
1042    File "..\..\..\..\doc\man-pages\html\5\*"
1043    CreateDirectory "$INSTDIR\Documentation\html\CmdRef\8"
1044    SetOutPath "$INSTDIR\Documentation\html\CmdRef\8"
1045    File "..\..\..\..\doc\man-pages\html\8\*"
1046    goto DoneLanguage
1047    
1048 DoGerman:
1049    SetOutPath "$INSTDIR\Documentation\html"
1050    File "..\..\doc\install\Documentation\de_DE\html\*"
1051    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1052    ;File "..\..\doc\install\Documentation\de_DE\html\CmdRef\*"
1053    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1054    ;File "..\..\doc\install\Documentation\de_DE\html\SysAdminGd\*"
1055    goto DoneLanguage
1056    
1057 DoSpanish:
1058    SetOutPath "$INSTDIR\Documentation\html"
1059    File "..\..\doc\install\Documentation\es_ES\html\*"
1060    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1061    ;File "..\..\doc\install\Documentation\es_ES\html\CmdRef\*"
1062    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1063    ;File "..\..\doc\install\Documentation\es_ES\html\SysAdminGd\*"
1064    goto DoneLanguage
1065
1066 DoJapanese:
1067    SetOutPath "$INSTDIR\Documentation\html"
1068    File "..\..\doc\install\Documentation\ja_JP\html\*"
1069    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1070    File "..\..\doc\install\Documentation\ja_JP\html\CmdRef\*"
1071    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1072    ;File "..\..\doc\install\Documentation\ja_JP\html\SysAdminGd\*"
1073    goto DoneLanguage
1074    
1075 DoKorean:
1076    SetOutPath "$INSTDIR\Documentation\html"
1077    File "..\..\doc\install\Documentation\ko_KR\html\*"
1078    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1079    ;File "..\..\doc\install\Documentation\ko_KR\html\CmdRef\*"
1080    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1081    File "..\..\doc\install\Documentation\ko_KR\html\SysAdminGd\*"
1082    goto DoneLanguage
1083    
1084 DoPortugueseBR:
1085    SetOutPath "$INSTDIR\Documentation\html"
1086    File "..\..\doc\install\Documentation\pt_BR\html\*"
1087    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1088    ;File "..\..\doc\install\Documentation\pt_BR\html\CmdRef\*"
1089    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1090    ;File "..\..\doc\install\Documentation\pt_BR\html\SysAdminGd\*"
1091    goto DoneLanguage
1092
1093 DoSimpChinese:
1094    SetOutPath "$INSTDIR\Documentation\html"
1095    File "..\..\doc\install\Documentation\zh_CN\html\*"
1096    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1097    ;File "..\..\doc\install\Documentation\zh_CN\html\CmdRef\*"
1098    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1099    ;File "..\..\doc\install\Documentation\zh_CN\html\SysAdminGd\*"
1100    goto DoneLanguage
1101    
1102 DoTradChinese:
1103    SetOutPath "$INSTDIR\Documentation\html"
1104    File "..\..\doc\install\Documentation\zh_TW\html\*"
1105    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
1106    ;File "..\..\doc\install\Documentation\zh_TW\html\CmdRef\*"
1107    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
1108    ;File "..\..\doc\install\Documentation\zh_TW\html\SysAdminGd\*"
1109    goto DoneLanguage
1110    
1111    
1112 DoneLanguage:
1113    ;Store install folder
1114   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation" "" $INSTDIR
1115   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "VersionString" ${AFS_VERSION}
1116   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
1117   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
1118   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
1119   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
1120   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
1121   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
1122   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
1123
1124   WriteUninstaller "$INSTDIR\Uninstall.exe"
1125   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"  
1126   CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
1127   Call AFSCommon.Install
1128 SectionEnd  
1129   
1130
1131 Section /o "Software Development Kit (SDK)" secSDK
1132
1133    SetOutPath "$INSTDIR\SDK\lib"
1134    File /r "${AFS_CLIENT_LIBDIR}\*.*"
1135
1136    SetOutPath "$INSTDIR\SDK\Include"
1137    File /r "${AFS_BUILD_INCDIR}\*.*"    
1138
1139    ; Client Sample
1140    SetOutPath "$INSTDIR\SDK\Sample"
1141    File "..\..\afsd\sample\token.c"
1142
1143    ;Store install folder
1144   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK" "" $INSTDIR
1145   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "VersionString" ${AFS_VERSION}
1146   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION}
1147   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION}
1148   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL}
1149   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "VersionString" ${AFS_VERSION}
1150   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION}
1151   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION}
1152   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL}
1153
1154   WriteUninstaller "$INSTDIR\Uninstall.exe"
1155   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"  
1156
1157   SetOutPath "$SMPROGRAMS\OpenAFS"
1158   CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
1159
1160   Call AFSCommon.Install
1161 SectionEnd
1162
1163
1164 Section /o "Debug symbols" secDebug
1165    SectionGetFlags ${secClient} $R0
1166    IntOp $R0 $R0 & ${SF_SELECTED}
1167    IntCmp $R0 ${SF_SELECTED} +1 DoServer
1168   
1169   ; Do client components
1170   SetOutPath "$INSTDIR\Client\Program"
1171   File "${AFS_CLIENT_BUILDDIR}\afsshare.pdb"
1172   File "${AFS_CLIENT_BUILDDIR}\libosi.pdb"
1173   ; remove old location if present
1174   Delete "$INSTDIR\Client\Program\libafsconf.pdb"
1175   File "${AFS_CLIENT_BUILDDIR}\klog.pdb"
1176   File "${AFS_CLIENT_BUILDDIR}\tokens.pdb"
1177   File "${AFS_CLIENT_BUILDDIR}\unlog.pdb"
1178   File "${AFS_CLIENT_BUILDDIR}\fs.pdb"
1179   File "${AFS_CLIENT_BUILDDIR}\afsdacl.pdb"
1180   File "${AFS_CLIENT_BUILDDIR}\cmdebug.pdb"
1181   File "${AFS_CLIENT_BUILDDIR}\aklog.pdb"
1182   File "${AFS_CLIENT_BUILDDIR}\afscreds.pdb"
1183   File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.pdb"
1184   File "${AFS_CLIENT_BUILDDIR}\afsd_service.pdb"
1185   File "${AFS_CLIENT_BUILDDIR}\symlink.pdb"
1186   File "${AFS_DESTDIR}\bin\kpasswd.pdb"
1187   File "${AFS_DESTDIR}\bin\pts.pdb"
1188   File "${AFS_SERVER_BUILDDIR}\bos.pdb"
1189   File "${AFS_SERVER_BUILDDIR}\kas.pdb"
1190   File "${AFS_SERVER_BUILDDIR}\vos.pdb"
1191   File "${AFS_SERVER_BUILDDIR}\udebug.pdb"
1192   File "${AFS_DESTDIR}\bin\translate_et.pdb"
1193   File "${AFS_DESTDIR}\etc\rxdebug.pdb"
1194   File "${AFS_DESTDIR}\etc\backup.pdb"
1195   File "${AFS_CLIENT_BUILDDIR}\afs_cpa.pdb"
1196   File "${AFS_CLIENT_BUILDDIR}\afscred.pdb"
1197   File "${AFS_CLIENT_BUILDDIR}\afslogon.pdb"
1198   File "${AFS_CLIENT_BUILDDIR}\afscpcc.pdb"
1199
1200   SetOutPath "$SYSDIR"
1201   
1202 DoServer:
1203    SectionGetFlags ${secServer} $R0
1204    IntOp $R0 $R0 & ${SF_SELECTED}
1205    IntCmp $R0 ${SF_SELECTED} +1 DoControl
1206
1207   ; Do server components
1208   SetOutPath "$INSTDIR\Server\usr\afs\bin"  
1209   File "${AFS_SERVER_BUILDDIR}\afskill.pdb"
1210   File "${AFS_SERVER_BUILDDIR}\afssvrcfg.pdb"
1211   File "${AFS_SERVER_BUILDDIR}\asetkey.pdb"
1212   File "${AFS_SERVER_BUILDDIR}\bosctlsvc.pdb"
1213   File "${AFS_SERVER_BUILDDIR}\bosserver.pdb"
1214   File "${AFS_SERVER_BUILDDIR}\buserver.pdb"
1215   File "${AFS_ETC_BUILDDIR}\butc.pdb"
1216   File "${AFS_SERVER_BUILDDIR}\fileserver.pdb"
1217   File "${AFS_ETC_BUILDDIR}\fms.pdb"
1218   File "${AFS_SERVER_BUILDDIR}\kaserver.pdb"
1219   File "${AFS_SERVER_BUILDDIR}\ptserver.pdb"
1220   File "${AFS_DESTDIR}\bin\ptclient.pdb"
1221   File "${AFS_DESTDIR}\bin\pt_util.pdb"
1222   File "${AFS_SERVER_BUILDDIR}\salvager.pdb"
1223   File "${AFS_SERVER_BUILDDIR}\upclient.pdb"
1224   File "${AFS_SERVER_BUILDDIR}\upserver.pdb"
1225   File "${AFS_SERVER_BUILDDIR}\vlserver.pdb"
1226   File "${AFS_SERVER_BUILDDIR}\volinfo.pdb"
1227   File "${AFS_SERVER_BUILDDIR}\volserver.pdb"
1228
1229   ; Do server common components
1230  File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb"
1231  File "${AFS_SERVER_BUILDDIR}\afsbosadmin.pdb"
1232  File "${AFS_SERVER_BUILDDIR}\afscfgadmin.pdb"
1233  File "${AFS_SERVER_BUILDDIR}\afskasadmin.pdb"
1234  File "${AFS_SERVER_BUILDDIR}\afsptsadmin.pdb"
1235  
1236    SetOutPath "$SYSDIR"
1237    File "${AFS_SERVER_BUILDDIR}\afsserver.pdb"
1238
1239    ; Do control center components
1240 DoControl:
1241    SectionGetFlags ${secControl} $R0
1242    IntOp $R0 $R0 & ${SF_SELECTED}
1243    IntCmp $R0 ${SF_SELECTED} +1 DoCommon
1244
1245    SetOutPath "$INSTDIR\Control Center"   
1246   File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager.pdb"
1247   File "${AFS_SERVER_BUILDDIR}\TaAfsAdmSvr.pdb"
1248   File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager.pdb"
1249
1250 DoCommon:
1251   SetOutPath "$INSTDIR\Common"
1252 !IFDEF CL_1500
1253   ; Do nothing
1254 !ELSE
1255 !IFDEF CL_1400
1256   ; Do nothing
1257 !ELSE
1258 !IFDEF CL_1310
1259    File "${SYSTEMDIR}\msvcr71d.pdb"
1260    File "${SYSTEMDIR}\msvcp71d.pdb"
1261    File "${SYSTEMDIR}\mfc71d.pdb"
1262 !ELSE
1263 !IFDEF CL_1300
1264    File "${SYSTEMDIR}\msvcr70d.pdb"
1265    File "${SYSTEMDIR}\msvcp70d.pdb"
1266    File "${SYSTEMDIR}\mfc70d.pdb"
1267 !ELSE
1268    File "${SYSTEMDIR}\mfc42d.pdb"
1269    File "${SYSTEMDIR}\msvcp60d.pdb"
1270    File "${SYSTEMDIR}\msvcrtd.pdb"
1271 !ENDIF
1272 !ENDIF
1273 !ENDIF
1274 !ENDIF
1275   
1276 ; Common Areas
1277    SetOutPath "$INSTDIR\Common"
1278    File "${AFS_CLIENT_BUILDDIR}\afs_config.pdb"
1279    File "${AFS_SERVER_BUILDDIR}\afsadminutil.pdb"
1280    File "${AFS_DESTDIR}\lib\afsauthent.pdb"
1281    File "${AFS_DESTDIR}\lib\afspthread.pdb"
1282    File "${AFS_DESTDIR}\lib\afsrpc.pdb"
1283    File "${AFS_DESTDIR}\lib\libafsconf.pdb"
1284    File "${AFS_SERVER_BUILDDIR}\afsclientadmin.pdb"
1285    File "${AFS_SERVER_BUILDDIR}\afsprocmgmt.pdb"
1286    File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb"
1287    File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib.pdb"
1288    File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb"
1289    File "${AFS_SERVER_BUILDDIR}\afsbosadmin.pdb"
1290    File "${AFS_SERVER_BUILDDIR}\afscfgadmin.pdb"
1291    File "${AFS_SERVER_BUILDDIR}\afskasadmin.pdb"
1292    File "${AFS_SERVER_BUILDDIR}\afsptsadmin.pdb"
1293
1294 SectionEnd
1295
1296
1297 ;Display the Finish header
1298 ;Insert this macro after the sections if you are not using a finish page
1299 ;!insertmacro MUI_SECTIONS_FINISHHEADER
1300
1301 ;--------------------------------
1302 ;Installer Functions
1303
1304 Function .onInit
1305
1306   !insertmacro MUI_LANGDLL_DISPLAY
1307   
1308   ; Set the default install options
1309         Push $0
1310
1311    Call IsUserAdmin
1312    Pop $R0
1313    StrCmp $R0 "true" contInstall
1314
1315    MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software."
1316    Abort
1317    
1318 contInstall:
1319
1320    ; Set Install Type text
1321    InstTypeSetText 0 "AFS Client"
1322    InstTypeSetText 1 "AFS Administrator"
1323    InstTypeSetText 2 "AFS Server"
1324    InstTypeSetText 3 "AFS Developer Tools"
1325
1326    ; Set sections in each install type
1327    SectionSetInstTypes 0 15             ; AFS Client
1328    SectionSetInstTypes 1 15             ; Loopback adapter
1329    SectionSetInstTypes 2 4              ; AFS Server
1330    SectionSetInstTypes 3 6              ; AFS Control Center
1331    SectionSetInstTypes 4 14             ; Documentation
1332    SectionSetInstTypes 5 8              ; SDK
1333 !ifndef DEBUG
1334    SectionSetInstTypes 6 8              ; Debug symbols
1335 !else
1336    SectionSetInstTypes 6 15             ; Debug symbols
1337 !endif
1338
1339    ; Check that RPC functions are installed (I believe any one of these can be present for
1340    ; OpenAFS to work)
1341    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_np"
1342    StrCmp $R0 "rpcrt4.dll" contInstall2
1343    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_ip_tcp"
1344    StrCmp $R0 "rpcrt4.dll" contInstall2
1345    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncadg_ip_udp"
1346    StrCmp $R0 "rpcrt4.dll" contInstall2
1347    ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_http"
1348    StrCmp $R0 "rpcrt4.dll" contInstall2
1349    
1350    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."
1351    Abort
1352
1353
1354 contInstall2:
1355    ; If the Loopback is already installed, we mark the option OFF and Read Only
1356    ; so the user can not select it.
1357    Call afs.isLoopbackInstalled
1358    IntCmp $R1 0 SkipLoop
1359    SectionGetFlags ${secLoopback} $0
1360    IntOp $0 $0 & ${SECTION_OFF}
1361    IntOp $0 $0 | ${SF_RO}
1362    SectionSetFlags ${secLoopback} $0
1363    ; And disable the loopback in the types
1364    SectionSetInstTypes 1 0              ; Loopback adapter
1365    
1366 SkipLoop:
1367    ; Never install debug symbols unless explicitly selected, except in DEBUG mode
1368         !IFNDEF DEBUG
1369    SectionGetFlags ${secDebug} $0
1370         IntOp $0 $0 & ${SECTION_OFF}
1371         SectionSetFlags ${secDebug} $0
1372    !ELSE
1373    SectionGetFlags ${secDebug} $0
1374         IntOp $0 $0 | ${SF_SELECTED}
1375         SectionSetFlags ${secDebug} $0
1376    !ENDIF
1377    ; Our logic should be like this.
1378    ;     1) If no AFS components are installed, we do a clean install with default options. (Client/Docs)
1379    ;     2) If existing modules are installed, we keep them selected
1380    ;     3) If it is an upgrade, we set the text accordingly, else we mark it as a re-install
1381    ;  TODO: Downgrade?
1382    Call IsAnyAFSInstalled
1383    Pop $R0
1384    StrCmp $R0 "0" DefaultOptions
1385    
1386    Call ShouldClientInstall
1387    Pop $R2
1388    
1389    ; Check if it was an IBM/Transarc version
1390    ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "DisplayName"
1391    StrCmp $R0 "IBM AFS Client" DoIBM
1392    StrCmp $R0 "Transarc AFS Client" DoIBM
1393 NotIBM:
1394    StrCpy $R9 ""
1395    StrCmp $R2 "0" NoClient
1396    StrCmp $R2 "1" ReinstallClient
1397    StrCmp $R2 "2" UpgradeClient
1398    StrCmp $R2 "3" DowngradeClient
1399    goto Continue
1400 DoIBM:
1401    ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\AFS Client\CurrentVersion" "MajorVersion"
1402    StrCmp $R0 "3" +1 NotIBM
1403    StrCpy $R9 "IBM"
1404    goto UpgradeClient
1405
1406 Continue:
1407         SectionGetFlags ${secClient} $0
1408         IntOp $0 $0 | ${SF_SELECTED}
1409         SectionSetFlags ${secClient} $0
1410     ;# !insertmacro SelectSection ${secClient}
1411    goto skipClient
1412 NoClient:
1413         ;StrCpy $1 ${secClient} ; Gotta remember which section we are at now...
1414         SectionGetFlags ${secClient} $0
1415         IntOp $0 $0 & ${SECTION_OFF}
1416         SectionSetFlags ${secClient} $0
1417    goto skipClient
1418 UpgradeClient:
1419         SectionGetFlags ${secClient} $0
1420         IntOp $0 $0 | ${SF_SELECTED}
1421         SectionSetFlags ${secClient} $0
1422    SectionSetText ${secClient} $(UPGRADE_CLIENT)
1423    goto skipClient
1424 ReinstallClient:
1425         SectionGetFlags ${secClient} $0
1426         IntOp $0 $0 | ${SF_SELECTED}
1427         SectionSetFlags ${secClient} $0
1428    SectionSetText ${secClient} $(REINSTALL_CLIENT)
1429    goto skipClient
1430 DowngradeClient:
1431         SectionGetFlags ${secClient} $0
1432         IntOp $0 $0 | ${SF_SELECTED}
1433         SectionSetFlags ${secClient} $0
1434    SectionSetText ${secClient} $(REINSTALL_CLIENT)
1435    goto skipClient
1436
1437    
1438 skipClient:   
1439    
1440    Call ShouldServerInstall
1441    Pop $R2
1442    StrCmp $R2 "0" NoServer
1443    StrCmp $R2 "1" ReinstallServer
1444    StrCmp $R2 "2" UpgradeServer
1445    StrCmp $R2 "3" DowngradeServer
1446    
1447    SectionGetFlags ${secServer} $0
1448    IntOp $0 $0 | ${SF_SELECTED}
1449    SectionSetFlags ${secServer} $0
1450    ;# !insertmacro UnselectSection ${secServer}
1451    goto skipServer
1452
1453 UpgradeServer:
1454    SectionGetFlags ${secServer} $0
1455    IntOp $0 $0 | ${SF_SELECTED}
1456    SectionSetFlags ${secServer} $0
1457    SectionSetText ${secServer} $(UPGRADE_SERVER)
1458    goto skipServer
1459
1460 ReinstallServer:
1461    SectionGetFlags ${secServer} $0
1462    IntOp $0 $0 | ${SF_SELECTED}
1463    SectionSetFlags ${secServer} $0
1464    SectionSetText ${secServer} $(REINSTALL_SERVER)
1465    goto skipServer
1466
1467 DowngradeServer:
1468    SectionGetFlags ${secServer} $0
1469    IntOp $0 $0 | ${SF_SELECTED}
1470    SectionSetFlags ${secServer} $0
1471    SectionSetText ${secServer} $(REINSTALL_SERVER)
1472    goto skipServer
1473    
1474 NoServer:
1475    SectionGetFlags ${secServer} $0
1476    IntOp $0 $0 & ${SECTION_OFF}
1477    SectionSetFlags ${secServer} $0
1478    ;# !insertmacro UnselectSection ${secServer}
1479    goto skipServer
1480    
1481 skipServer:
1482    ; Check control center
1483    Call IsControlInstalled
1484    Pop $R2
1485    StrCmp $R2 "0" NoControl
1486
1487    SectionGetFlags ${secControl} $0
1488    IntOp $0 $0 | ${SF_SELECTED}
1489    SectionSetFlags ${secControl} $0
1490    goto CheckDocs
1491    
1492 NoControl:   
1493    SectionGetFlags ${secControl} $0
1494    IntOp $0 $0 & ${SECTION_OFF}
1495    SectionSetFlags ${secControl} $0
1496    ;# !insertmacro UnselectSection ${secControl}
1497
1498 CheckDocs:
1499    ; Check Documentation
1500    Call IsDocumentationInstalled
1501    Pop $R2
1502    StrCmp $R2 "0" NoDocs
1503    SectionGetFlags ${secDocs} $0
1504    IntOp $0 $0 | ${SF_SELECTED}
1505    SectionSetFlags ${secDocs} $0
1506    goto CheckSDK
1507    
1508 NoDocs:
1509    SectionGetFlags ${secDocs} $0
1510    IntOp $0 $0 & ${SECTION_OFF}
1511    SectionSetFlags ${secDocs} $0
1512    goto CheckSDK
1513    
1514 ; To check the SDK, we simply look to see if the files exist.  If they do,
1515 ; the SDK is installed.  If not, we don't need to push it on the user.
1516 ; If they are there, we want to make sure they match the installed version.
1517 CheckSDK:
1518    IfFileExists "$INSTDIR\SDK\Include\main.h" +1 NoSDK
1519    SectionGetFlags ${secSDK} $0
1520    IntOp $0 $0 | ${SF_SELECTED}
1521    SectionSetFlags ${secSDK} $0
1522    goto end
1523    
1524 NoSDK:
1525    SectionGetFlags ${secSDK} $0
1526    IntOp $0 $0 & ${SECTION_OFF}
1527    SectionSetFlags ${secSDK} $0
1528    goto end
1529    
1530 DefaultOptions:
1531    ; Client Selected
1532    SectionGetFlags ${secClient} $0
1533    IntOp $0 $0 | ${SF_SELECTED}
1534    SectionSetFlags ${secClient} $0
1535
1536    ; Server NOT selected
1537    SectionGetFlags ${secServer} $0
1538    IntOp $0 $0 & ${SECTION_OFF}
1539    SectionSetFlags ${secServer} $0
1540    
1541    ; Control Center NOT selected
1542    SectionGetFlags ${secControl} $0
1543    IntOp $0 $0 & ${SECTION_OFF}
1544    SectionSetFlags ${secControl} $0
1545    ;# !insertmacro UnselectSection ${secControl}
1546
1547    ; Documentation NOT selected
1548    SectionGetFlags ${secDocs} $0
1549    IntOp $0 $0 & ${SECTION_OFF}
1550    SectionSetFlags ${secDocs} $0
1551    ;# !insertmacro UnselectSection ${secDocs}
1552    
1553    ; SDK not selected
1554    SectionGetFlags ${secSDK} $0
1555    IntOp $0 $0 & ${SECTION_OFF}
1556    SectionSetFlags ${secSDK} $0
1557    ;# !insertmacro UnselectSection ${secSDK}
1558    
1559    goto end
1560
1561 end:
1562    Pop $0
1563   
1564    Push $R0
1565   
1566   ; See if we can set a default installation path...
1567   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PathName"
1568   StrCmp $R0 "" TryServer
1569   Push $R0
1570   Call GetParent
1571   
1572   ; Work around bug in 1.3.5000, 1.3.5100, 1.3.5200, 1.3.5201, 1.3.5299 installers...
1573   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MajorVersion"
1574   StrCmp $R0 "1" +1 SkipParent
1575   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MinorVersion"
1576   StrCmp $R0 "3" +1 SkipParent
1577   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PatchLevel"
1578   StrCmp $R0 "5000" UpParent
1579   StrCmp $R0 "5100" UpParent
1580   StrCmp $R0 "5200" UpParent
1581   StrCmp $R0 "5201" UpParent
1582   StrCmp $R0 "5299" UpParent
1583   goto SkipParent
1584   
1585 UpParent:
1586    Call GetParent
1587   
1588 SkipParent:
1589   Pop $R0
1590   StrCpy $INSTDIR $R0
1591   goto Nope
1592   
1593 TryServer:
1594   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PathName"
1595   StrCmp $R0 "" TryControl
1596   Push $R0
1597   Call GetParent
1598   Pop $R0
1599   StrCpy $INSTDIR $R0
1600   goto Nope
1601    
1602 TryControl:
1603   ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PathName"
1604   StrCmp $R0 "" Nope
1605   StrCpy $INSTDIR $R0
1606   
1607 Nope:
1608   Pop $R0
1609   
1610   GetTempFilename $0
1611   File /oname=$0 CellServPage.ini
1612   GetTempFilename $1
1613   File /oname=$1 AFSCell.ini
1614   GetTempFilename $2
1615   File /oname=$2 AFSCreds.ini
1616   ;File /oname=$1 ConfigURL.ini
1617   
1618 FunctionEnd
1619
1620
1621 ;--------------------------------
1622 ; These are our cleanup functions
1623 Function .onInstFailed
1624 Delete $0
1625 Delete $1
1626 FunctionEnd
1627
1628 Function .onInstSuccess
1629 Delete $0
1630 Delete $1
1631 FunctionEnd
1632
1633
1634 ;--------------------------------
1635 ;Descriptions
1636
1637   !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1638   !insertmacro MUI_DESCRIPTION_TEXT ${secServer} $(DESC_secServer)
1639   !insertmacro MUI_DESCRIPTION_TEXT ${secClient} $(DESC_secClient)
1640   !insertmacro MUI_DESCRIPTION_TEXT ${secControl} $(DESC_secControl)
1641   !insertmacro MUI_DESCRIPTION_TEXT ${secDocs} $(DESC_secDocs)
1642   !insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK)
1643   !insertmacro MUI_DESCRIPTION_TEXT ${secLoopback} $(DESC_secLoopback)
1644   !insertmacro MUI_DESCRIPTION_TEXT ${secDebug} $(DESC_secDebug)
1645   !insertmacro MUI_FUNCTION_DESCRIPTION_END
1646  
1647 ;--------------------------------
1648 ;Uninstaller Section
1649
1650 Section "Uninstall"
1651   ; Make sure the user REALLY wants to do this, unless they did a silent uninstall, in which case...let them!
1652   IfSilent StartRemove     ; New in v2.0b4
1653   MessageBox MB_YESNO "Are you sure you want to remove OpenAFS from this machine?" IDYES StartRemove
1654   abort
1655   
1656 StartRemove:
1657   
1658   SetShellVarContext all
1659   ; Stop the running processes
1660   GetTempFileName $R0
1661   File /oname=$R0 "${AFS_WININSTALL_DIR}\Killer.exe"
1662   nsExec::Exec '$R0 afscreds.exe'
1663   Exec "afscreds.exe -z"
1664   ; in case we are upgrading an old version that does not support -z
1665   Sleep 2000
1666   nsExec::Exec '$R0 afscreds.exe'
1667 !IFDEF INSTALL_KFW
1668   nsExec::Exec '$R0 krbcc32s.exe'
1669 !ENDIF
1670
1671   ; Delete the AFS service
1672   GetTempFileName $R0
1673   File /oname=$R0 "${AFS_WININSTALL_DIR}\Service.exe"
1674   nsExec::Exec "net stop TransarcAFSDaemon"
1675   nsExec::Exec "net stop TransarcAFSServer"
1676   nsExec::Exec '$R0 u TransarcAFSDaemon'
1677   ; After we stop the service, but before we delete it, we have to remove the volume data
1678   ; This is because the storage locations are in the registry under the service key.
1679   ; Call un.RemoveAFSVolumes
1680   nsExec::Exec '$R0 u TransarcAFSServer'
1681   Delete $R0
1682   
1683   Call un.RemoveProvider
1684
1685   Push "$INSTDIR\Client\Program"
1686   Call un.RemoveFromPath
1687   Push "$INSTDIR\Common"
1688   Call un.RemoveFromPath
1689 !ifdef INSTALL_KFW
1690   Push "$INSTDIR\kfw\bin"
1691   Call un.RemoveFromPath
1692 !endif
1693   
1694   ; Delete documentation
1695   Delete "$INSTDIR\Documentation\README.TXT"
1696   Delete "$INSTDIR\Documentation\html\*"
1697   Delete "$INSTDIR\Documentation\html\index_files\*"
1698   Delete "$INSTDIR\Documentation\html\CmdRef\1\*"
1699   Delete "$INSTDIR\Documentation\html\CmdRef\5\*"
1700   Delete "$INSTDIR\Documentation\html\CmdRef\8\*"
1701   Delete "$INSTDIR\Documentation\html\CmdRef\*"
1702
1703    Delete /REBOOTOK "$INSTDIR\Common\afs_config.exe"
1704    Delete /REBOOTOK "$INSTDIR\Common\afs_shl_ext.dll"
1705    Delete /REBOOTOK "$INSTDIR\Common\afsadminutil.dll"
1706    Delete /REBOOTOK "$INSTDIR\Common\lib\afsauthent.dll"
1707    Delete /REBOOTOK "$INSTDIR\Common\lib\afspthread.dll"
1708    Delete /REBOOTOK "$INSTDIR\Common\lib\afsrpc.dll"
1709    Delete /REBOOTOK "$INSTDIR\Common\lib\afshcrypto.dll"
1710    Delete /REBOOTOK "$INSTDIR\Common\lib\afsroken.dll"
1711    Delete /REBOOTOK "$INSTDIR\Common\afsclientadmin.dll"
1712    Delete /REBOOTOK "$INSTDIR\Common\afsprocmgmt.dll"
1713    Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.dll"
1714    Delete /REBOOTOK "$INSTDIR\Common\TaAfsAppLib.dll"
1715    Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.dll"
1716    Delete /REBOOTOK "$INSTDIR\Common\afsbosadmin.dll"
1717    Delete /REBOOTOK "$INSTDIR\Common\afscfgadmin.dll"
1718    Delete /REBOOTOK "$INSTDIR\Common\afskasadmin.dll"
1719    Delete /REBOOTOK "$INSTDIR\Common\afsptsadmin.dll"
1720
1721    Delete /REBOOTOK "$INSTDIR\Common\afs_config.pdb"
1722    Delete /REBOOTOK "$INSTDIR\Common\afs_shl_ext.pdb"
1723    Delete /REBOOTOK "$INSTDIR\Common\afsadminutil.pdb"
1724    Delete /REBOOTOK "$INSTDIR\Common\lib\afsauthent.pdb"
1725    Delete /REBOOTOK "$INSTDIR\Common\lib\afspthread.pdb"
1726    Delete /REBOOTOK "$INSTDIR\Common\lib\afsrpc.pdb"
1727    Delete /REBOOTOK "$INSTDIR\Common\lib\afshcrypto.pdb"
1728    Delete /REBOOTOK "$INSTDIR\Common\lib\afsroken.pdb"
1729    Delete /REBOOTOK "$INSTDIR\Common\afsclientadmin.pdb"
1730    Delete /REBOOTOK "$INSTDIR\Common\afsprocmgmt.pdb"
1731    Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.pdb"
1732    Delete /REBOOTOK "$INSTDIR\Common\TaAfsAppLib.pdb"
1733    Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.pdb"
1734    Delete /REBOOTOK "$INSTDIR\Common\afsbosadmin.pdb"
1735    Delete /REBOOTOK "$INSTDIR\Common\afscfgadmin.pdb"
1736    Delete /REBOOTOK "$INSTDIR\Common\afskasadmin.pdb"
1737    Delete /REBOOTOK "$INSTDIR\Common\afsptsadmin.pdb"
1738 !IFDEF DEBUG
1739 !IFDEF CL_1500
1740    SetOutPath "$INSTDIR\Common"
1741    File /oname=vcruntime.msi "${MSVCMSI}"
1742    nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
1743    Delete "$INSTDIR\Common\vcruntime.msi"
1744 !ELSE
1745 !IFDEF CL_1400
1746    SetOutPath "$INSTDIR\Common"
1747    File /oname=vcruntime.msi "${MSVCMSI}"
1748    nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
1749    Delete "$INSTDIR\Common\vcruntime.msi"
1750 !ELSE
1751 !IFDEF CL_1310
1752    Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.dll"
1753    Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.pdb"
1754    Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.dll"
1755    Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.pdb"
1756    Delete /REBOOTOK "$INSTDIR\Common\mfc71d.dll"
1757    Delete /REBOOTOK "$INSTDIR\Common\mfc71d.pdb"
1758 !ELSE
1759 !IFDEF CL_1300
1760    Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.dll"
1761    Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.pdb"
1762    Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.dll"
1763    Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.pdb"
1764    Delete /REBOOTOK "$INSTDIR\Common\mfc70d.dll"
1765    Delete /REBOOTOK "$INSTDIR\Common\mfc70d.pdb"
1766 !ELSE
1767    Delete /REBOOTOK "$INSTDIR\Common\mfc42d.dll"
1768    Delete /REBOOTOK "$INSTDIR\Common\mfc42d.pdb"
1769    Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.dll"
1770    Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.pdb"
1771    Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.dll"
1772    Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.pdb"
1773 !ENDIF
1774 !ENDIF
1775 !ENDIF
1776 !ENDIF
1777 !ELSE
1778 !IFDEF CL_1500
1779    SetOutPath "$INSTDIR\Common"
1780    File /oname=vcruntime.msi "${MSVCMSI}"
1781    nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
1782    Delete "$INSTDIR\Common\vcruntime.msi"
1783 !ELSE
1784 !IFDEF CL_1400
1785    SetOutPath "$INSTDIR\Common"
1786    File /oname=vcruntime.msi "${MSVCMSI}"
1787    nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
1788    Delete "$INSTDIR\Common\vcruntime.msi"
1789 !ELSE
1790 !IFDEF CL_1310
1791    Delete /REBOOTOK "$INSTDIR\Common\mfc71.dll"
1792    Delete /REBOOTOK "$INSTDIR\Common\msvcr71.dll"
1793    Delete /REBOOTOK "$INSTDIR\Common\msvcp71.dll"
1794    Delete /REBOOTOK "$INSTDIR\Common\MFC71CHS.DLL"
1795    Delete /REBOOTOK "$INSTDIR\Common\MFC71CHT.DLL"
1796    Delete /REBOOTOK "$INSTDIR\Common\MFC71DEU.DLL"
1797    Delete /REBOOTOK "$INSTDIR\Common\MFC71ENU.DLL"
1798    Delete /REBOOTOK "$INSTDIR\Common\MFC71ESP.DLL"
1799    Delete /REBOOTOK "$INSTDIR\Common\MFC71FRA.DLL"
1800    Delete /REBOOTOK "$INSTDIR\Common\MFC71ITA.DLL"
1801    Delete /REBOOTOK "$INSTDIR\Common\MFC71JPN.DLL"
1802    Delete /REBOOTOK "$INSTDIR\Common\MFC71KOR.DLL"
1803 !ELSE
1804 !IFDEF CL_1300
1805    Delete /REBOOTOK "$INSTDIR\Common\mfc70.dll"
1806    Delete /REBOOTOK "$INSTDIR\Common\msvcr70.dll"
1807    Delete /REBOOTOK "$INSTDIR\Common\msvcp70.dll"
1808    Delete /REBOOTOK "$INSTDIR\Common\MFC70CHS.DLL"
1809    Delete /REBOOTOK "$INSTDIR\Common\MFC70CHT.DLL"
1810    Delete /REBOOTOK "$INSTDIR\Common\MFC70DEU.DLL"
1811    Delete /REBOOTOK "$INSTDIR\Common\MFC70ENU.DLL"
1812    Delete /REBOOTOK "$INSTDIR\Common\MFC70ESP.DLL"
1813    Delete /REBOOTOK "$INSTDIR\Common\MFC70FRA.DLL"
1814    Delete /REBOOTOK "$INSTDIR\Common\MFC70ITA.DLL"
1815    Delete /REBOOTOK "$INSTDIR\Common\MFC70JPN.DLL"
1816    Delete /REBOOTOK "$INSTDIR\Common\MFC70KOR.DLL"
1817 !ELSE
1818    Delete /REBOOTOK "$INSTDIR\Common\mfc42.dll"
1819    Delete /REBOOTOK "$INSTDIR\Common\msvcp60.dll"
1820    Delete /REBOOTOK "$INSTDIR\Common\msvcrt.dll"
1821 !ENDIF
1822 !ENDIF
1823 !ENDIF
1824 !ENDIF
1825 !ENDIF
1826   
1827    IfSilent SkipDel
1828 ;  IfFileExists "$INSTDIR\Client\CellServDB" CellExists SkipDelAsk
1829 ;  CellExists:
1830   MessageBox MB_YESNO "Would you like to keep your configuration information?" IDYES SkipDel
1831   Delete "$INSTDIR\Client\CellServDB"
1832
1833 ; Only remove krb5.ini if KfW was installed
1834 !IFDEF INSTALL_KFW
1835   Delete "$WINDIR\krb5.ini"
1836 !ENDIF
1837   Delete "$INSTDIR\Client\afsdns.ini"
1838   
1839   GetTempFileName $R0
1840   File /oname=$R0 "${AFS_WININSTALL_DIR}\AdminGroup.exe"
1841   nsExec::Exec '$R0 -remove'
1842
1843   SkipDel:
1844   Delete "$WINDIR\afsd_init.log"
1845   Delete "$INSTDIR\Uninstall.exe"
1846
1847   ; Remove server
1848   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afskill.exe"
1849   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe"
1850   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosctlsvc.exe"
1851   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosserver.exe"
1852   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\buserver.exe"
1853   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\butc.exe"
1854   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fileserver.exe"
1855   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fms.exe"
1856   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\kaserver.exe"
1857   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\ptserver.exe"
1858   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\salvager.exe"
1859   Delete "$INSTDIR\Server\usr\afs\bin\ServerUninst.dll"
1860   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\upclient.exe"
1861   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\upserver.exe"
1862   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\vlserver.exe"
1863   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\volinfo.exe"
1864   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\volserver.exe"
1865
1866   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afskill.pdb"
1867   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afssvrcfg.pdb"
1868   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosctlsvc.pdb"
1869   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosserver.pdb"
1870   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\buserver.pdb"
1871   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\butc.pdb"
1872   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fileserver.pdb"
1873   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fms.pdb"
1874   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\kaserver.pdb"
1875   Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\ptserver.pdb"
1876   Delete "$INSTDIR\Server\usr\afs\bin\salvager.pdb"
1877   Delete "$INSTDIR\Server\usr\afs\bin\ServerUninst.pdb"
1878   Delete "$INSTDIR\Server\usr\afs\bin\upclient.pdb"
1879   Delete "$INSTDIR\Server\usr\afs\bin\upserver.pdb"
1880   Delete "$INSTDIR\Server\usr\afs\bin\vlserver.pdb"
1881   Delete "$INSTDIR\Server\usr\afs\bin\volinfo.pdb"
1882   Delete "$INSTDIR\Server\usr\afs\bin\volserver.pdb"
1883
1884   RMDir /r "$INSTDIR\Server\usr\afs\bin"
1885   ; do not delete the server configuration files
1886   ; or we will lose the volumes and authentication
1887   ; databases
1888   ;RmDir /r "$INSTDIR\Server\usr\afs\etc\logs"
1889   ;RmDir /r "$INSTDIR\Server\usr\afs\etc"
1890   ;RmDir /r "$INSTDIR\Server\usr\afs\local"
1891   ;RMDIR /r "$INSTDIR\Server\usr\afs\logs"
1892   
1893   Delete /REBOOTOK "$SYSDIR\afsserver.cpl"
1894   Delete /REBOOTOK "$INSTDIR\Client\Program\afs_cpa.cpl"
1895   Delete /REBOOTOK "$INSTDIR\Client\Program\afslogon.dll"
1896   Delete /REBOOTOK "$INSTDIR\Client\Program\afscpcc.exe"
1897
1898   Delete /REBOOTOK "$SYSDIR\afsserver.pdb"
1899   Delete /REBOOTOK "$INSTDIR\Client\Program\afs_cpa.pdb"
1900   Delete /REBOOTOK "$INSTDIR\Client\Program\afslogon.pdb"
1901   Delete /REBOOTOK "$INSTDIR\Client\Program\afscpcc.pdb"
1902
1903   RMDir /r "$INSTDIR\Documentation\html\CmdRef"
1904   RMDIr /r "$INSTDIR\Documentation\html"
1905   
1906   RMDir "$INSTDIR\Documentation"
1907   ; Delete DOC short cut
1908   Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.exe"
1909   Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.pdb"
1910
1911   Delete /REBOOTOK "$INSTDIR\SDK\Include\*"
1912   Delete /REBOOTOK "$INSTDIR\SDK\Include\afs\*"
1913   Delete /REBOOTOK "$INSTDIR\SDK\Include\rx\*"
1914   Delete /REBOOTOK "$INSTDIR\SDK\Sample\*"
1915   Delete /REBOOTOK "$INSTDIR\SDK\*"
1916
1917   RMDir  "$INSTDIR\SDK\Sample"
1918   RMDir  "$INSTDIR\SDK\Include\afs"
1919   RMDir  "$INSTDIR\SDK\Include\rx"
1920   RMDir  "$INSTDIR\SDK\Include"
1921   RMDir  "$INSTDIR\SDK"
1922
1923   Delete /REBOOTOK "$INSTDIR\Client\Program\*"
1924   Delete /REBOOTOK "$INSTDIR\Client\*"
1925
1926   RMDir  "$INSTDIR\Client\Program"
1927   RMDir  "$INSTDIR\Client"
1928
1929 !IFDEF DEBUG  
1930 !IFDEF CL_1500
1931    SetOutPath "$INSTDIR\Common"
1932    File /oname=vcruntime.msi "${MSVCMSI}"
1933    nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
1934    Delete "$INSTDIR\Common\vcruntime.msi"
1935 !ELSE
1936 !IFDEF CL_1400
1937    SetOutPath "$INSTDIR\Common"
1938    File /oname=vcruntime.msi "${MSVCMSI}"
1939    nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
1940    Delete "$INSTDIR\Common\vcruntime.msi"
1941 !ELSE
1942 !IFDEF CL_1310
1943    Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.dll"
1944    Delete /REBOOTOK "$INSTDIR\Common\msvcr71d.pdb"
1945    Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.dll"
1946    Delete /REBOOTOK "$INSTDIR\Common\msvcp71d.pdb"
1947    Delete /REBOOTOK "$INSTDIR\Common\mfc71d.dll"
1948    Delete /REBOOTOK "$INSTDIR\Common\mfc71d.pdb"
1949 !ELSE
1950 !IFDEF CL_1300
1951    Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.dll"
1952    Delete /REBOOTOK "$INSTDIR\Common\msvcr70d.pdb"
1953    Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.dll"
1954    Delete /REBOOTOK "$INSTDIR\Common\msvcp70d.pdb"
1955    Delete /REBOOTOK "$INSTDIR\Common\mfc70d.dll"
1956    Delete /REBOOTOK "$INSTDIR\Common\mfc70d.pdb"
1957 !ELSE
1958    Delete /REBOOTOK "$INSTDIR\Common\mfc42d.dll"
1959    Delete /REBOOTOK "$INSTDIR\Common\mfc42d.pdb"
1960    Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.dll"
1961    Delete /REBOOTOK "$INSTDIR\Common\msvcp60d.pdb"
1962    Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.dll"
1963    Delete /REBOOTOK "$INSTDIR\Common\msvcrtd.pdb"
1964 !ENDIF
1965 !ENDIF
1966 !ENDIF
1967 !ENDIF
1968 !ELSE
1969 !IFDEF CL_1500
1970    SetOutPath "$INSTDIR\Common"
1971    File /oname=vcruntime.msi "${MSVCMSI}"
1972    nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
1973    Delete "$INSTDIR\Common\vcruntime.msi"
1974 !ELSE
1975 !IFDEF CL_1400
1976    SetOutPath "$INSTDIR\Common"
1977    File /oname=vcruntime.msi "${MSVCMSI}"
1978    nsExec::Exec 'msiexec /x "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
1979    Delete "$INSTDIR\Common\vcruntime.msi"
1980 !ELSE
1981 !IFDEF CL_1310
1982    Delete /REBOOTOK "$INSTDIR\Common\mfc71.dll"
1983    Delete /REBOOTOK "$INSTDIR\Common\msvcr71.dll"
1984    Delete /REBOOTOK "$INSTDIR\Common\msvcp71.dll"
1985    Delete /REBOOTOK "$INSTDIR\Common\MFC71CHS.DLL"
1986    Delete /REBOOTOK "$INSTDIR\Common\MFC71CHT.DLL"
1987    Delete /REBOOTOK "$INSTDIR\Common\MFC71DEU.DLL"
1988    Delete /REBOOTOK "$INSTDIR\Common\MFC71ENU.DLL"
1989    Delete /REBOOTOK "$INSTDIR\Common\MFC71ESP.DLL"
1990    Delete /REBOOTOK "$INSTDIR\Common\MFC71FRA.DLL"
1991    Delete /REBOOTOK "$INSTDIR\Common\MFC71ITA.DLL"
1992    Delete /REBOOTOK "$INSTDIR\Common\MFC71JPN.DLL"
1993    Delete /REBOOTOK "$INSTDIR\Common\MFC71KOR.DLL"
1994 !ELSE
1995 !IFDEF CL_1300
1996    Delete /REBOOTOK "$INSTDIR\Common\mfc70.dll"
1997    Delete /REBOOTOK "$INSTDIR\Common\msvcr70.dll"
1998    Delete /REBOOTOK "$INSTDIR\Common\msvcp70.dll"
1999    Delete /REBOOTOK "$INSTDIR\Common\MFC70CHS.DLL"
2000    Delete /REBOOTOK "$INSTDIR\Common\MFC70CHT.DLL"
2001    Delete /REBOOTOK "$INSTDIR\Common\MFC70DEU.DLL"
2002    Delete /REBOOTOK "$INSTDIR\Common\MFC70ENU.DLL"
2003    Delete /REBOOTOK "$INSTDIR\Common\MFC70ESP.DLL"
2004    Delete /REBOOTOK "$INSTDIR\Common\MFC70FRA.DLL"
2005    Delete /REBOOTOK "$INSTDIR\Common\MFC70ITA.DLL"
2006    Delete /REBOOTOK "$INSTDIR\Common\MFC70JPN.DLL"
2007    Delete /REBOOTOK "$INSTDIR\Common\MFC70KOR.DLL"
2008 !ELSE
2009    Delete /REBOOTOK "$INSTDIR\Common\mfc42.dll"
2010    Delete /REBOOTOK "$INSTDIR\Common\msvcp60.dll"
2011    Delete /REBOOTOK "$INSTDIR\Common\msvcrt.dll"
2012 !ENDIF
2013 !ENDIF
2014 !ENDIF
2015 !ENDIF
2016 !ENDIF
2017
2018   Delete /REBOOTOK "$INSTDIR\Common\*"
2019   RMDir "$INSTDIR\Common"
2020
2021 !ifdef INSTALL_KFW
2022   ;Remove KfW files
2023   Delete /REBOOTOK "$INSTDIR\kfw\bin\*"
2024   RMDIR  /r "$INSTDIR\kfw\bin"
2025   Delete /REBOOTOK "$INSTDIR\kfw\doc\*"
2026   RMDIR  /r "$INSTDIR\kfw\doc"
2027   RMDIR  /r "$INSTDIR\kfw"
2028 !endif
2029
2030   Delete "$SMPROGRAMS\OpenAFS\Documentation.lnk"
2031
2032   ; Remove control center
2033   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAccountManager.exe"
2034   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAdmSvr.exe"
2035   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsServerManager.exe"
2036   Delete /REBOOTOK "$INSTDIR\Control Center\CCUninst.dll"
2037   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAccountManager.pdb"
2038   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAdmSvr.pdb"
2039   Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsServerManager.pdb"
2040   RMDir  "$INSTDIR\Control Center"
2041   
2042   Delete "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk"
2043   Delete "$SMPROGRAMS\OpenAFS\Client\Authentication.lnk"
2044   Delete "$SMPROGRAMS\OpenAFS\Control Center\Account Manager.lnk"
2045   Delete "$SMPROGRAMS\OpenAFS\Control Center\Server Manager.lnk"
2046   RMDIR "$SMPROGRAMS\OpenAFS\Control Center"
2047   RMDir /r "$SMPROGRAMS\OpenAFS\Documentation"
2048   RMDir /r "$SMPROGRAMS\OpenAFS\Client"
2049   RMDir /r "$SMPROGRAMS\OpenAFS"
2050   Delete "$SMSTARTUP\AFS Credentials.lnk"
2051   
2052   ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "CachePath"
2053   IfErrors +2
2054   Delete "$R0\AFSCache"
2055   Delete "C:\AFSCache"
2056
2057   DeleteRegKey HKCR "*\shellex\ContextMenuHandlers\AFS Client Shell Extension"
2058   DeleteRegKey HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32"
2059   DeleteRegKey HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
2060   DeleteRegKey HKCR "FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension"
2061   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
2062   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls" "afs_cpa"
2063
2064   ; WinLogon Event Notification
2065   DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\AfsLogon"
2066
2067   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion"
2068   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client"
2069   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion"
2070   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation"
2071   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion"
2072   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Control Center"
2073   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion"
2074   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server"
2075   DeleteRegKey /ifempty HKLM "${AFS_REGKEY_ROOT}"
2076   DeleteRegKey HKLM "${NID_PLUGIN_MGR}\Modules\OpenAFS"
2077   DeleteRegKey HKLM "${NID_PLUGIN_MGR}\Plugins\AfsCred"
2078   DeleteRegKey /ifempty HKLM "Software\MIT\NetIDMgr"
2079   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS"
2080   DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Services\NetBT\Parameters" "SmbDeviceEnabled"
2081
2082   ; Support for apps that wrote submount data directly to afsdsbmt.ini
2083   DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini"
2084
2085   RMDir  "$INSTDIR"
2086
2087 SectionEnd
2088
2089 ;--------------------------------
2090 ;Uninstaller Functions
2091
2092 Function un.onInit
2093
2094   ;Get language from registry
2095   ReadRegStr $LANGUAGE HKCU "Software\OpenAFS\AFS" "Installer Language"
2096
2097 FunctionEnd
2098
2099 Function un.onUninstSuccess
2100
2101   IfSilent SkipAsk
2102   MessageBox MB_OK "Please reboot your machine to complete uninstallation of the software"
2103   SkipAsk:
2104
2105 FunctionEnd
2106
2107 ;------------------------------
2108 ; Get the CellServDB file from the Internet
2109
2110 Function afs.GetCellServDB
2111
2112 ;Check if we should download CellServDB
2113 ReadINIStr $R0 $0 "Field 4" "State"
2114 StrCmp $R0 "1" DoDownload
2115
2116 ;Do nothing if we're keeping the existing file
2117 ReadINIStr $R0 $0 "Field 2" "State"
2118 StrCmp $R0 "1" done
2119
2120 ReadINIStr $R0 $0 "Field 6" "State"
2121 StrCmp $R0 "1" CheckOther
2122
2123 ReadINIStr $R0 $0 "Field 3" "State"
2124 StrCmp $R0 "1" UsePackaged
2125
2126 ; If none of these, grab file from other location
2127 goto UsePackaged
2128
2129 DoDownload:
2130    ReadINIStr $R0 $0 "Field 5" "State"
2131    NSISdl::download $R0 "$INSTDIR\Client\CellServDB"
2132    Pop $R0 ;Get the return value
2133    StrCmp $R0 "success" +2
2134       MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0"
2135    goto done
2136
2137 UsePackaged:
2138    SetOutPath "$INSTDIR\Client"
2139    File "CellServDB"
2140    goto done
2141    
2142 CheckOther:
2143    ReadINIStr $R0 $0 "Field 7" "State"
2144    StrCmp $R0 "" done
2145    CopyFiles $R0 "$INSTDIR\Client\CellServDB"
2146    
2147 done:
2148
2149 FunctionEnd
2150
2151 Function AddProvider
2152    Push $R0
2153    Push $R1
2154    ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder"
2155    Push $R0
2156    StrCpy $R0 "TransarcAFSDaemon"
2157    Push $R0
2158    Call StrStr
2159    Pop $R0
2160    StrCmp $R0 "" +1 DoOther
2161    ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder"   
2162    StrCpy $R0 "$R1,TransarcAFSDaemon"
2163    WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" $R0
2164 DoOther:
2165    ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder"
2166    Push $R0
2167    StrCpy $R0 "TransarcAFSDaemon"
2168    Push $R0
2169    Call StrStr
2170    Pop $R0
2171    StrCmp $R0 "" +1 End
2172    ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder"   
2173    StrCpy $R0 "$R1,TransarcAFSDaemon"
2174    WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" $R0   
2175 End:
2176    Pop $R1
2177    Pop $R0
2178 FunctionEnd
2179
2180 Function un.RemoveProvider
2181    Push $R0
2182    StrCpy $R0 "TransarcAFSDaemon"
2183    Push $R0
2184    StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder"
2185    Call un.RemoveFromProvider
2186    StrCpy $R0 "TransarcAFSDaemon"
2187    Push $R0
2188    StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order"
2189    Call un.RemoveFromProvider
2190    Pop $R0
2191 FunctionEnd
2192
2193 Function un.RemoveFromProvider
2194   Exch $0
2195   Push $1
2196   Push $2
2197   Push $3
2198   Push $4
2199   Push $5
2200   Push $6
2201
2202   ReadRegStr $1 HKLM "$R0" "ProviderOrder"
2203     StrCpy $5 $1 1 -1 # copy last char
2204     StrCmp $5 "," +2 # if last char != ,
2205       StrCpy $1 "$1," # append ,
2206     Push $1
2207     Push "$0,"
2208     Call un.StrStr ; Find `$0,` in $1
2209     Pop $2 ; pos of our dir
2210     StrCmp $2 "" unRemoveFromPath_done
2211       ; else, it is in path
2212       # $0 - path to add
2213       # $1 - path var
2214       StrLen $3 "$0,"
2215       StrLen $4 $2
2216       StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
2217       StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
2218       StrCpy $3 $5$6
2219
2220       StrCpy $5 $3 1 -1 # copy last char
2221       StrCmp $5 "," 0 +2 # if last char == ,
2222         StrCpy $3 $3 -1 # remove last char
2223
2224       WriteRegStr HKLM "$R0" "ProviderOrder" $3
2225       
2226   unRemoveFromPath_done:
2227     Pop $6
2228     Pop $5
2229     Pop $4
2230     Pop $3
2231     Pop $2
2232     Pop $1
2233     Pop $0
2234 FunctionEnd
2235
2236 Function CheckPathForAFS
2237    Push $0
2238    Push $1
2239    Push $2
2240    Push $3
2241    ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
2242    StrCpy $1 "$1;"
2243 loop:
2244    Push $1
2245    Push ";"
2246    Call StrStr
2247    Pop $0
2248    StrLen $2 $0
2249    StrCpy $3 $1 -$2
2250    IfFileExists "$3\afsd_service.exe" Error
2251    StrCpy $1 $0 32768 1
2252    StrLen $2 $1
2253    IntCmp $2 0 Done Done loop
2254    goto Done
2255 Error:
2256    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."
2257    Abort "Unable to install OpenAFS"
2258 Done:
2259    Pop $3
2260    Pop $2
2261    Pop $1
2262    Pop $0
2263 FunctionEnd
2264
2265 Function AddToUniquePath
2266    Pop $R0
2267    Push $R0
2268    Push "$R0;"
2269    ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
2270    Push "$R0;"
2271    Call StrStr
2272    Pop $R0
2273    StrCmp $R0 "" +1 Done
2274    Call AddToPath
2275 Done:
2276 FunctionEnd
2277
2278
2279 ;-------------------------------
2280 ;Do the page to get the CellServDB
2281
2282 Function AFSPageGetCellServDB
2283   ; Skip this page if we are not installing the client
2284   SectionGetFlags ${secClient} $R0
2285   IntOp $R0 $R0 & ${SF_SELECTED}
2286   StrCmp $R0 "0" Skip
2287   
2288   ; Set the install options here
2289   
2290 startOver:
2291   WriteINIStr $0 "Field 2" "Flags" "DISABLED"
2292   WriteINIStr $0 "Field 3" "State" "1"
2293   WriteINISTR $0 "Field 4" "State" "0"
2294   WriteINIStr $0 "Field 6" "State" "0"
2295   
2296   ; If there is an existing afsdcell.ini file, migrate it to CellServDB
2297   IfFileExists "$WINDIR\afsdcell.ini" +1 +3
2298   CopyFiles /SILENT "$WINDIR\afsdcell.ini" "$INSTDIR\Client\CellServDB"
2299   Delete "$WINDIR\afsdcell.ini"
2300   ; If there is an existing CellServDB file, allow the user to choose it and make it default
2301   IfFileExists "$INSTDIR\Client\CellServDB" +1 notpresent
2302   WriteINIStr $0 "Field 2" "Flags" "ENABLED"
2303   WriteINIStr $0 "Field 2" "State" "1"
2304   WriteINIStr $0 "Field 3" "State" "0"
2305   
2306   notpresent:
2307   
2308   !insertmacro MUI_HEADER_TEXT "CellServDB Configuration" "Please choose a method for installing the CellServDB file:" 
2309   InstallOptions::dialog $0
2310   Pop $R1
2311   StrCmp $R1 "cancel" exit
2312   StrCmp $R1 "back" done
2313   StrCmp $R1 "success" done
2314 exit: Quit
2315 done:
2316
2317    ; Check that if a file is set, a valid filename is entered...
2318    ReadINIStr $R0 $0 "Field 6" "State"
2319    StrCmp $R0 "1" CheckFileName
2320    
2321    ;Check if a URL is specified, one *IS* specified
2322    ReadINIStr $R0 $0 "Field 4" "State"
2323    StrCmp $R0 "1" CheckURL Skip
2324    
2325    CheckURL:
2326    ReadINIStr $R0 $0 "Field 5" "State"
2327    StrCmp $R0 "" +1 Skip
2328    MessageBox MB_OK|MB_ICONSTOP $(URLError)
2329    WriteINIStr $0 "Field 4" "State" "0"
2330    goto startOver
2331    
2332    CheckFileName:
2333    ReadINIStr $R0 $0 "Field 7" "State"
2334    IfFileExists $R0 Skip
2335
2336    MessageBox MB_OK|MB_ICONSTOP $(CellError)
2337    WriteINIStr $0 "Field 6" "State" "0"
2338    goto startOver
2339    
2340    Skip:
2341    
2342 FunctionEnd
2343
2344
2345 Function AFSPageGetCellName
2346    IfSilent good
2347   ; Skip this page if we are not installing the client
2348   SectionGetFlags ${secClient} $R0
2349   IntOp $R0 $R0 & ${SF_SELECTED}
2350   StrCmp $R0 "0" good
2351   
2352 startOver:
2353    ; We want to read in the existing parameters and make them the defaults
2354    
2355    ;AFS Crypt security
2356    ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "SecurityLevel"
2357    StrCmp $R1 "" +3
2358    WriteINIStr $1 "Field 3" "State" $R1
2359    goto +2
2360    WriteINIStr $1 "Field 3" "State" "1"
2361    
2362    ;Use DNS
2363    ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "UseDNS"
2364    StrCmp $R1 "" +3
2365    WriteINIStr $1 "Field 9" "State" $R1
2366    goto +2
2367    WriteINIStr $1 "Field 9" "State" "1"
2368    
2369    ; Use integrated logon
2370    ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "LogonOptions"
2371    StrCmp $R1 "" +3
2372    WriteINIStr $1 "Field 7" "State" $R1
2373    goto +2
2374    WriteINIStr $1 "Field 7" "State" "0"
2375    
2376    ; If this is a server install, we do NOT want to recommend the Freelance client
2377    ; And we do not need to ask for the cell name.
2378    SectionGetFlags ${secServer} $R1
2379    IntOp $R1 $R1 & ${SF_SELECTED}
2380    StrCmp $R1 "1" +1 NotServer
2381    WriteINIStr $1 "Field 6" "Text" "Enable AFS Freelance client (Not Recommended for servers)"
2382    ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient"
2383    StrCmp $R1 "" +3
2384    WriteINIStr $1 "Field 5" "State" $R1
2385    goto +2
2386    WriteINIStr $1 "Field 5" "State" "0"
2387    WriteINIStr $1 "Field 1" "Flags" "DISABLED"
2388    WriteINIStr $1 "Field 2" "Flags" "DISABLED"
2389    goto SkipServerTest
2390 NotServer:
2391    WriteINIStr $1 "Field 6" "Text" "Enable AFS Freelance client (Recommended)"
2392    ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient"
2393    StrCmp $R1 "" +3
2394    WriteINIStr $1 "Field 5" "State" $R1
2395    goto +2
2396    WriteINIStr $1 "Field 5" "State" "1"
2397    WriteINIStr $1 "Field 1" "Flags" ""
2398    WriteINIStr $1 "Field 2" "Flags" ""
2399 SkipServerTest:
2400    ; Get the current cell name, if any
2401    ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "Cell"
2402    StrCmp $R1 "" +2
2403    WriteINIStr $1 "Field 2" "State" $R1
2404   !insertmacro MUI_HEADER_TEXT "Client Cell Name Configuration" "Please enter the name for your default cell:" 
2405   InstallOptions::dialog $1
2406   Pop $R1
2407   StrCmp $R1 "cancel" exit
2408   StrCmp $R1 "back" done
2409   StrCmp $R1 "success" done
2410 exit: Quit
2411 done:
2412    ReadINIStr $R0 $1 "Field 2" "State"
2413    StrCmp $R0 "" +1 good
2414    
2415    MessageBox MB_OK|MB_ICONSTOP $(CellNameError)
2416    goto startOver
2417 good:
2418 FunctionEnd
2419
2420
2421 ;---------------------------------------------------------
2422 ;Do the page to get the afscreds.exe startup configuration
2423
2424 Function AFSPageConfigAFSCreds
2425   ; Skip this page if we are not installing the client
2426   SectionGetFlags ${secClient} $R0
2427   IntOp $R0 $R0 & ${SF_SELECTED}
2428   StrCmp $R0 "0" done
2429   
2430   ; Set the install options here
2431   
2432   !insertmacro MUI_HEADER_TEXT "AFS Credentials Configuration" "Please choose default options for configuring the AFS Credentials program:" 
2433   InstallOptions::dialog $2
2434   Pop $R1
2435   StrCmp $R1 "cancel" exit
2436   StrCmp $R1 "back" done
2437   StrCmp $R1 "success" done
2438 exit: Quit
2439 done:
2440    
2441 FunctionEnd
2442
2443
2444 ;-------------
2445 ; Common install routines for each module
2446 Function AFSCommon.Install
2447
2448 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayName" "OpenAFS for Windows"
2449 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "UninstallString" "$INSTDIR\uninstall.exe"
2450 !ifndef DEBUG
2451 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayVersion" "${AFS_VERSION}"
2452 !else
2453 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayVersion" "${AFS_VERSION} Checked/Debug"
2454 !endif
2455 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "URLInfoAbout" "http://www.openafs.org/"
2456
2457 FunctionEnd
2458
2459
2460 ;-------------------
2461 ; Get the currently installed version and place it on the stack
2462 ; Modifies: Nothing
2463 Function GetInstalledVersion
2464    Push $R0
2465    Push $R1
2466    Push $R4
2467    
2468    ReadRegStr $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "VersionString"
2469    StrCmp $R0 "" NotTransarc done
2470    
2471    
2472 NotTransarc:
2473    ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "VersionString"
2474    StrCmp $R0 "" done
2475    
2476 done:
2477    Pop $R4
2478    Pop $R1
2479    Exch $R0
2480 FunctionEnd
2481
2482 ; Functions to get each component of the version number
2483 Function GetInstalledVersionMajor
2484    Push $R0
2485    Push $R1
2486    Push $R4
2487    
2488    ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "MajorVersion"
2489    StrCmp $R0 "" NotTransarc done
2490    
2491    
2492 NotTransarc:
2493    ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "MajorVersion"
2494    StrCmp $R0 "" done
2495    
2496 done:
2497    Pop $R4
2498    Pop $R1
2499    Exch $R0
2500 FunctionEnd
2501
2502 Function GetInstalledVersionMinor
2503    Push $R0
2504    Push $R1
2505    Push $R4
2506    
2507    ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "MinorVersion"
2508    StrCmp $R0 "" NotTransarc done
2509    
2510    
2511 NotTransarc:
2512    ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "MinorVersion"
2513    StrCmp $R0 "" done
2514    
2515 done:
2516    Pop $R4
2517    Pop $R1
2518    Exch $R0
2519 FunctionEnd
2520
2521 Function GetInstalledVersionPatch
2522    Push $R0
2523    Push $R1
2524    Push $R4
2525    
2526    ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "PatchLevel"
2527    StrCmp $R0 "" NotTransarc done
2528    
2529    
2530 NotTransarc:
2531    ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "PatchLevel"
2532    StrCmp $R0 "" done
2533    
2534 done:
2535    Pop $R4
2536    Pop $R1
2537    Exch $R0
2538 FunctionEnd
2539
2540
2541
2542 ;-------------------------------
2543 ; Check if the client should be checked for default install
2544 Function ShouldClientInstall
2545    Push $R0
2546    StrCpy $R2 "AFS Client"
2547    Call GetInstalledVersion
2548    Pop $R0
2549    
2550    StrCmp $R0 "" NotInstalled
2551    ; Now we see if it's an older or newer version
2552    
2553    Call GetInstalledVersionMajor
2554    Pop $R0
2555    IntCmpU $R0 ${AFS_MAJORVERSION} +1 Upgrade Downgrade
2556
2557    Call GetInstalledVersionMinor
2558    Pop $R0
2559    IntCmpU $R0 ${AFS_MINORVERSION} +1 Upgrade Downgrade
2560    
2561    Call GetInstalledVersionPatch
2562    Pop $R0
2563    IntCmpU $R0 ${AFS_PATCHLEVEL} Reinstall Upgrade Downgrade
2564    
2565 Reinstall:
2566    StrCpy $R0 "1"
2567    Exch $R0
2568    goto end
2569    
2570 Upgrade:
2571    StrCpy $R0 "2"
2572    Exch $R0
2573    goto end
2574    
2575 Downgrade:
2576    StrCpy $R0 "3"
2577    Exch $R0
2578    goto end
2579    
2580 NotInstalled:
2581    StrCpy $R0 "0"
2582    Exch $R0
2583 end:   
2584 FunctionEnd
2585
2586 ;-------------------------------
2587 ; Check how the server options should be set
2588 Function ShouldServerInstall
2589    Push $R0
2590    StrCpy $R2 "AFS Server"
2591    Call GetInstalledVersion
2592    Pop $R0
2593    
2594    StrCmp $R0 "" NotInstalled
2595    ; Now we see if it's an older or newer version
2596
2597    Call GetInstalledVersionMajor
2598    Pop $R0
2599    IntCmpU $R0 ${AFS_MAJORVERSION} +1 Upgrade Downgrade
2600
2601    Call GetInstalledVersionMinor
2602    Pop $R0
2603    IntCmpU $R0 ${AFS_MINORVERSION} +1 Upgrade Downgrade
2604    
2605    Call GetInstalledVersionPatch
2606    Pop $R0
2607    IntCmpU $R0 ${AFS_PATCHLEVEL} Reinstall Upgrade Downgrade
2608    
2609 Reinstall:
2610    StrCpy $R0 "1"
2611    Exch $R0
2612    goto end
2613    
2614 Upgrade:
2615    StrCpy $R0 "2"
2616    Exch $R0
2617    goto end
2618    
2619 Downgrade:
2620    StrCpy $R0 "3"
2621    Exch $R0
2622    goto end
2623    
2624    
2625 NotInstalled:
2626    StrCpy $R0 "0"
2627    Exch $R0
2628 end:   
2629 FunctionEnd
2630
2631
2632 ; See if AFS Server is installed
2633 ; Returns: "1" if it is, 0 if it is not (on the stack)
2634 Function IsServerInstalled
2635    Push $R0
2636    StrCpy $R2 "AFS Server"
2637    Call GetInstalledVersion
2638    Pop $R0
2639    
2640    StrCmp $R0 "" NotInstalled
2641    
2642    StrCpy $R0 "1"
2643    Exch $R0
2644    goto end
2645    
2646 NotInstalled:
2647    StrCpy $R0 "0"
2648    Exch $R0
2649 end:   
2650 FunctionEnd
2651
2652
2653 ; See if AFS Client is installed
2654 ; Returns: "1" if it is, 0 if it is not (on the stack)
2655 Function IsClientInstalled
2656    Push $R0
2657    StrCpy $R2 "AFS Client"
2658    Call GetInstalledVersion
2659    Pop $R0
2660    
2661    StrCmp $R0 "" NotInstalled
2662    
2663    StrCpy $R0 "1"
2664    Exch $R0
2665    goto end
2666    
2667 NotInstalled:
2668    StrCpy $R0 "0"
2669    Exch $R0
2670 end:   
2671 FunctionEnd
2672
2673
2674
2675 ; See if AFS Documentation is installed
2676 ; Returns: "1" if it is, 0 if it is not (on the stack)
2677 Function IsDocumentationInstalled
2678    Push $R0
2679    StrCpy $R2 "AFS Supplemental Documentation"
2680    Call GetInstalledVersion
2681    Pop $R0
2682    
2683    StrCmp $R0 "" NotInstalled
2684    
2685    StrCpy $R0 "1"
2686    Exch $R0
2687    goto end
2688    
2689 NotInstalled:
2690    StrCpy $R0 "0"
2691    Exch $R0
2692 end:   
2693 FunctionEnd
2694
2695
2696 ; See if Control Center is installed
2697 ; Returns: "1" if it is, 0 if it is not (on the stack)
2698 Function IsControlInstalled
2699    Push $R0
2700    StrCpy $R2 "AFS Control Center"
2701    Call GetInstalledVersion
2702    Pop $R0
2703    
2704    StrCmp $R0 "" NotInstalled
2705    
2706    StrCpy $R0 "1"
2707    Exch $R0
2708    goto end
2709    
2710 NotInstalled:
2711    StrCpy $R0 "0"
2712    Exch $R0
2713 end:   
2714 FunctionEnd
2715
2716
2717 !ifdef USE_GETPARAMETERS
2718 ; GetParameters
2719 ; input, none
2720 ; output, top of stack (replaces, with e.g. whatever)
2721 ; modifies no other variables.
2722
2723 Function GetParameters
2724   Push $R0
2725   Push $R1
2726   Push $R2
2727   StrCpy $R0 $CMDLINE 1
2728   StrCpy $R1 '"'
2729   StrCpy $R2 1
2730   StrCmp $R0 '"' loop
2731     StrCpy $R1 ' ' ; we're scanning for a space instead of a quote
2732   loop:
2733     StrCpy $R0 $CMDLINE 1 $R2
2734     StrCmp $R0 $R1 loop2
2735     StrCmp $R0 "" loop2
2736     IntOp $R2 $R2 + 1
2737     Goto loop
2738   loop2:
2739     IntOp $R2 $R2 + 1
2740     StrCpy $R0 $CMDLINE 1 $R2
2741     StrCmp $R0 " " loop2
2742   StrCpy $R0 $CMDLINE "" $R2
2743   Pop $R2
2744   Pop $R1
2745   Exch $R0
2746 FunctionEnd
2747 !endif
2748
2749
2750 ;Check to see if any AFS component is installed
2751 ;Returns: Value on stack: "1" if it is, "0" if it is not
2752 Function IsAnyAFSInstalled
2753    Push $R0
2754    Push $R1
2755    Push $R2
2756    Push $R3
2757    Call IsClientInstalled
2758    Pop $R0
2759    Call IsServerInstalled
2760    Pop $R1
2761    Call IsControlInstalled
2762    Pop $R2
2763    Call IsDocumentationInstalled
2764    Pop $R3
2765    ; Now we must see if ANY of the $Rn values are 1
2766    StrCmp $R0 "1" SomethingInstalled
2767    StrCmp $R1 "1" SomethingInstalled
2768    StrCmp $R2 "1" SomethingInstalled
2769    StrCmp $R3 "1" SomethingInstalled
2770    ;Nothing installed
2771    StrCpy $R0 "0"
2772    goto end
2773 SomethingInstalled:
2774    StrCpy $R0 "1"
2775 end:
2776    Pop $R3
2777    Pop $R2
2778    Pop $R1
2779    Exch $R0
2780 FunctionEnd
2781
2782
2783 ;Install English Language Files
2784 Function AFSLangFiles
2785    ; Common files
2786    SetOutPath "$INSTDIR\Common"
2787    File "${AFS_CLIENT_BUILDDIR}\afs_config.exe"
2788   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afsauthent.dll" "$INSTDIR\Common\afsauthent.dll" "$INSTDIR"
2789   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afspthread.dll" "$INSTDIR\Common\afspthread.dll" "$INSTDIR"
2790   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afsrpc.dll"     "$INSTDIR\Common\afsrpc.dll"     "$INSTDIR"
2791   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afshcrypto.dll" "$INSTDIR\Common\afshcrypto.dll" "$INSTDIR"
2792   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afsroken.dll"   "$INSTDIR\Common\afsroken.dll"   "$INSTDIR"
2793   !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\libafsconf.dll" "$INSTDIR\Common\libafsconf.dll" "$INSTDIR"
2794   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsadminutil.dll"    "$INSTDIR\Common\afsadminutil.dll"    "$INSTDIR"
2795   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsclientadmin.dll"  "$INSTDIR\Common\afsclientadmin.dll"  "$INSTDIR" 
2796   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsprocmgmt.dll"     "$INSTDIR\Common\afsprocmgmt.dll"     "$INSTDIR" 
2797   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsvosadmin.dll"     "$INSTDIR\Common\afsvosadmin.dll"     "$INSTDIR" 
2798   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib.dll"     "$INSTDIR\Common\TaAfsAppLib.dll"     "$INSTDIR" 
2799   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsvosadmin.dll"     "$INSTDIR\Common\afsvosadmin.dll"     "$INSTDIR" 
2800   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsbosadmin.dll"     "$INSTDIR\Common\afsbosadmin.dll"     "$INSTDIR" 
2801   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afscfgadmin.dll"     "$INSTDIR\Common\afscfgadmin.dll"     "$INSTDIR" 
2802   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afskasadmin.dll"     "$INSTDIR\Common\afskasadmin.dll"     "$INSTDIR" 
2803   !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsptsadmin.dll"     "$INSTDIR\Common\afsptsadmin.dll"     "$INSTDIR" 
2804
2805  SetOutPath "$INSTDIR\Common"
2806
2807 !IFDEF DEBUG
2808 !IFDEF CL_1500
2809    File /oname=vcruntime.msi "${MSVCMSI}"
2810    nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
2811    Delete "$INSTDIR\Common\vcruntime.msi"
2812 !ELSE
2813 !IFDEF CL_1400
2814    File /oname=vcruntime.msi "${MSVCMSI}"
2815    nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
2816    Delete "$INSTDIR\Common\vcruntime.msi"
2817 !ELSE
2818 !IFDEF CL_1310
2819    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71d.dll" "$INSTDIR\Common\msvcr71d.dll" "$INSTDIR"
2820    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71d.dll" "$INSTDIR\Common\msvcp71d.dll" "$INSTDIR"
2821    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71d.dll" "$INSTDIR\Common\mfc71d.dll" "$INSTDIR"
2822    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\Common\MFC71CHS.DLL" "$INSTDIR"
2823    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\Common\MFC71CHT.DLL" "$INSTDIR"
2824    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\Common\MFC71DEU.DLL" "$INSTDIR"
2825    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\Common\MFC71ENU.DLL" "$INSTDIR"
2826    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\Common\MFC71ESP.DLL" "$INSTDIR"
2827    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\Common\MFC71FRA.DLL" "$INSTDIR"
2828    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\Common\MFC71ITA.DLL" "$INSTDIR"
2829    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\Common\MFC71JPN.DLL" "$INSTDIR"
2830    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\Common\MFC71KOR.DLL" "$INSTDIR"
2831 !ELSE
2832 !IFDEF CL_1300
2833    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70d.dll" "$INSTDIR\Common\msvcr70d.dll" "$INSTDIR"
2834    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70d.dll" "$INSTDIR\Common\msvcp70d.dll" "$INSTDIR"
2835    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70d.dll" "$INSTDIR\Common\mfc70d.dll" "$INSTDIR"
2836    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\Common\MFC70CHS.DLL" "$INSTDIR"
2837    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\Common\MFC70CHT.DLL" "$INSTDIR"
2838    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\Common\MFC70DEU.DLL" "$INSTDIR"
2839    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\Common\MFC70ENU.DLL" "$INSTDIR"
2840    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\Common\MFC70ESP.DLL" "$INSTDIR"
2841    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\Common\MFC70FRA.DLL" "$INSTDIR"
2842    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\Common\MFC70ITA.DLL" "$INSTDIR"
2843    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\Common\MFC70JPN.DLL" "$INSTDIR"
2844    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\Common\MFC70KOR.DLL" "$INSTDIR"
2845 !ELSE
2846    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42d.dll" "$INSTDIR\Common\mfc42d.dll" "$INSTDIR"
2847    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60d.dll" "$INSTDIR\Common\msvcp60d.dll" "$INSTDIR"
2848    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrtd.dll" "$INSTDIR\Common\msvcrtd.dll" "$INSTDIR"
2849 !ENDIF
2850 !ENDIF
2851 !ENDIF
2852 !ENDIF
2853 !ELSE
2854 !IFDEF CL_1500
2855    File /oname=vcruntime.msi "${MSVCMSI}"
2856    nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
2857    Delete "$INSTDIR\Common\vcruntime.msi"
2858 !ELSE
2859 !IFDEF CL_1400
2860    File /oname=vcruntime.msi "${MSVCMSI}"
2861    nsExec::Exec 'msiexec /i "$INSTDIR\Common\vcruntime.msi" /passive /norestart'
2862    Delete "$INSTDIR\Common\vcruntime.msi"
2863 !ELSE
2864 !IFDEF CL_1310
2865    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll" "$INSTDIR\Common\mfc71.dll" "$INSTDIR"
2866    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71.dll" "$INSTDIR\Common\msvcr71.dll" "$INSTDIR"
2867    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71.dll" "$INSTDIR\Common\msvcp71.dll" "$INSTDIR"
2868    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\Common\MFC71CHS.DLL" "$INSTDIR"
2869    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\Common\MFC71CHT.DLL" "$INSTDIR"
2870    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\Common\MFC71DEU.DLL" "$INSTDIR"
2871    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\Common\MFC71ENU.DLL" "$INSTDIR"
2872    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\Common\MFC71ESP.DLL" "$INSTDIR"
2873    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\Common\MFC71FRA.DLL" "$INSTDIR"
2874    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\Common\MFC71ITA.DLL" "$INSTDIR"
2875    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\Common\MFC71JPN.DLL" "$INSTDIR"
2876    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\Common\MFC71KOR.DLL" "$INSTDIR"
2877 !ELSE
2878 !IFDEF CL_1300
2879    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70.dll" "$INSTDIR\Common\mfc70.dll" "$INSTDIR"
2880    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70.dll" "$INSTDIR\Common\msvcr70.dll" "$INSTDIR"
2881    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70.dll" "$INSTDIR\Common\msvcp70.dll" "$INSTDIR"
2882    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\Common\MFC70CHS.DLL" "$INSTDIR"
2883    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\Common\MFC70CHT.DLL" "$INSTDIR"
2884    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\Common\MFC70DEU.DLL" "$INSTDIR"
2885    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\Common\MFC70ENU.DLL" "$INSTDIR"
2886    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\Common\MFC70ESP.DLL" "$INSTDIR"
2887    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\Common\MFC70FRA.DLL" "$INSTDIR"
2888    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\Common\MFC70ITA.DLL" "$INSTDIR"
2889    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\Common\MFC70JPN.DLL" "$INSTDIR"
2890    !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\Common\MFC70KOR.DLL" "$INSTDIR"
2891 !ELSE
2892    !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42.dll" "$INSTDIR\Common\mfc42.dll" "$INSTDIR"
2893    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60.dll" "$INSTDIR\Common\msvcp60.dll" "$INSTDIR"
2894    !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrt.dll" "$INSTDIR\Common\msvcrt.dll" "$INSTDIR"
2895 !ENDIF
2896 !ENDIF
2897 !ENDIF   
2898 !ENDIF
2899 !ENDIF
2900
2901    ; Cleanup old documentation as the file names may have changed
2902    DELETE "$SMPROGRAMS\OpenAFS\Documentation.lnk"
2903    RMDIR /R "$INSTDIR\Documentation"
2904
2905    StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
2906    StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman
2907    StrCmp $LANGUAGE ${LANG_SPANISH} DoSpanish
2908    StrCmp $LANGUAGE ${LANG_JAPANESE} DoJapanese
2909    StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean
2910    StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} DoPortugueseBR
2911    StrCmp $LANGUAGE ${LANG_SIMPCHINESE} DoSimpChinese
2912    StrCmp $LANGUAGE ${LANG_TRADCHINESE} DoTradChinese
2913    
2914 DoEnglish:
2915
2916    CreateDirectory "$INSTDIR\Documentation"
2917    SetOutPath "$INSTDIR\Documentation"
2918    File /oname=ReleaseNotes.chm "..\..\..\..\doc\xml\ReleaseNotesWindows\htmlhelp.chm"
2919
2920    CreateDirectory "$SMPROGRAMS\OpenAFS\Documentation"
2921    CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation\Release Notes.lnk" "$INSTDIR\Documentation\ReleaseNotes.chm"
2922
2923    SetOutPath "$INSTDIR\Client\Program"
2924    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1033.dll"    "$INSTDIR\Client\Program\afscreds_1033.dll" "$INSTDIR"
2925    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1033.dll" "$INSTDIR\Client\Program\afs_shl_ext_1033.dll" "$INSTDIR"
2926 !ifdef DEBUG
2927    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1033.pdb"
2928    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1033.pdb"
2929 !endif
2930
2931    File "..\..\doc\help\en_US\afs-light.CNT"
2932    File "..\..\doc\help\en_US\afs-light.hlp"
2933    File "..\..\doc\help\en_US\afs-nt.CNT"
2934    File "..\..\doc\help\en_US\afs-nt.HLP"
2935
2936    SetOutPath "$INSTDIR\Common"
2937    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1033.dll"           "$INSTDIR\Common\afs_config_1033.dll" "$INSTDIR"
2938    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1033.dll"              "$INSTDIR\Common\afs_cpa_1033.dll" "$INSTDIR"
2939    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1033.dll"          "$INSTDIR\Common\afseventmsg_1033.dll" "$INSTDIR"
2940   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1033.dll"      "$INSTDIR\Common\afs_setup_utils_1033.dll" "$INSTDIR"
2941    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1033.dll"            "$INSTDIR\Common\afsserver_1033.dll" "$INSTDIR"
2942    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1033.dll"            "$INSTDIR\Common\afssvrcfg_1033.dll" "$INSTDIR"
2943    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1033.dll"  "$INSTDIR\Common\TaAfsAccountManager_1033.dll" "$INSTDIR"
2944    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1033.dll"          "$INSTDIR\Common\TaAfsAppLib_1033.dll" "$INSTDIR"
2945    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1033.dll"   "$INSTDIR\Common\TaAfsServerManager_1033.dll" "$INSTDIR"
2946    File "..\..\doc\help\en_US\afs-cc.CNT"
2947    File "..\..\doc\help\en_US\afs-cc.hlp"
2948    File "..\..\doc\help\en_US\taafscfg.CNT"
2949    File "..\..\doc\help\en_US\taafscfg.hlp"
2950    File "..\..\doc\help\en_US\taafssvrmgr.CNT"
2951    File "..\..\doc\help\en_US\taafssvrmgr.hlp"
2952    File "..\..\doc\help\en_US\taafsusrmgr.CNT"
2953    File "..\..\doc\help\en_US\taafsusrmgr.hlp"
2954
2955 !ifdef DEBUG
2956    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1033.pdb"
2957    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1033.pdb"
2958    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1033.pdb"
2959    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1033.pdb"
2960    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1033.pdb"
2961    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1033.pdb"
2962    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1033.pdb"
2963    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1033.pdb"
2964 !ENDIF
2965    goto done
2966
2967 DoGerman:
2968
2969    SetOutPath "$INSTDIR\Documentation"
2970    File "..\..\doc\install\Documentation\de_DE\README.TXT"
2971    SetOutPath "$INSTDIR\Documentation\html"
2972    File "..\..\doc\install\Documentation\de_DE\html\*"
2973    SetOutPath "$INSTDIR\Documentation\html\index_files"
2974    ;File "..\..\doc\install\Documentation\de_DE\html\index_files\*"
2975    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
2976    File "..\..\doc\install\Documentation\de_DE\html\InstallGd\*"
2977    ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
2978    ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\*"
2979    ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
2980    ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\logo_files\*"
2981    ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
2982    ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\relnotes_files\*"
2983
2984    SetOutPath "$INSTDIR\Client\Program"
2985   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1032.dll"                      "$INSTDIR\Client\Program\afscreds_1032.dll" "$INSTDIR"
2986   !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1032.dll" "$INSTDIR\Client\Program\afs_shl_ext_1032.dll" "$INSTDIR"
2987 !ifdef DEBUG
2988    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1032.pdb"
2989    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1032.pdb"
2990 !endif
2991
2992    File "..\..\doc\help\de_DE\afs-light.CNT"
2993    File "..\..\doc\help\de_DE\afs-light.hlp"
2994    File "..\..\doc\help\de_DE\afs-nt.CNT"
2995    File "..\..\doc\help\de_DE\afs-nt.HLP"
2996
2997    SetOutPath "$INSTDIR\Common"
2998    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1032.dll"           "$INSTDIR\Common\afs_config_1032.dll" "$INSTDIR"
2999    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1032.dll"              "$INSTDIR\Common\afs_cpa_1032.dll" "$INSTDIR" 
3000    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1032.dll"          "$INSTDIR\Common\afseventmsg_1032.dll" "$INSTDIR" 
3001   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1032.dll"      "$INSTDIR\Common\afs_setup_utils_1032.dll" "$INSTDIR" 
3002    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1032.dll"            "$INSTDIR\Common\afsserver_1032.dll" "$INSTDIR" 
3003    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1032.dll"            "$INSTDIR\Common\afssvrcfg_1032.dll" "$INSTDIR" 
3004    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1032.dll"  "$INSTDIR\Common\TaAfsAccountManager_1032.dll" "$INSTDIR" 
3005    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1032.dll"          "$INSTDIR\Common\TaAfsAppLib_1032.dll" "$INSTDIR" 
3006    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1032.dll"   "$INSTDIR\Common\TaAfsServerManager_1032.dll" "$INSTDIR" 
3007    File "..\..\doc\help\de_DE\afs-cc.CNT"
3008    File "..\..\doc\help\de_DE\afs-cc.hlp"
3009    File "..\..\doc\help\de_DE\taafscfg.CNT"
3010    File "..\..\doc\help\de_DE\taafscfg.hlp"
3011    File "..\..\doc\help\de_DE\taafssvrmgr.CNT"
3012    File "..\..\doc\help\de_DE\taafssvrmgr.hlp"
3013    File "..\..\doc\help\de_DE\taafsusrmgr.CNT"
3014    File "..\..\doc\help\de_DE\taafsusrmgr.hlp"
3015
3016 !ifdef DEBUG
3017    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1032.pdb"
3018    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1032.pdb"
3019    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1032.pdb"
3020    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1032.pdb"
3021    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1032.pdb"
3022    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1032.pdb"
3023    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1032.pdb"
3024    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1032.pdb"
3025 !ENDIF
3026    goto done   
3027
3028 DoSpanish:
3029
3030    SetOutPath "$INSTDIR\Documentation"
3031    File "..\..\doc\install\Documentation\es_ES\README.TXT"
3032    SetOutPath "$INSTDIR\Documentation\html"
3033    ;File "..\..\doc\install\Documentation\es_ES\html\*"
3034    SetOutPath "$INSTDIR\Documentation\html\index_html"
3035    ;File "..\..\doc\install\Documentation\es_ES\html\index_files\*"
3036    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3037    ;File "..\..\doc\install\Documentation\es_ES\html\InstallGd\*"
3038    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3039    ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\*"
3040    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3041    ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\logo_files\*"
3042    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
3043    ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\relnotes_files\*"
3044
3045    SetOutPath "$INSTDIR\Client\Program"
3046    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1034.dll"     "$INSTDIR\Client\Program\afscreds_1034.dll" "$INSTDIR" 
3047    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1034.dll" "$INSTDIR\Client\Program\afs_shl_ext_1034.dll" "$INSTDIR"
3048 !ifdef DEBUG
3049    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1034.pdb"
3050    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1034.pdb"
3051 !endif
3052
3053    File "..\..\doc\help\es_ES\afs-light.CNT"
3054    File "..\..\doc\help\es_ES\afs-light.hlp"
3055    File "..\..\doc\help\es_ES\afs-nt.CNT"
3056    File "..\..\doc\help\es_ES\afs-nt.HLP"
3057
3058    SetOutPath "$INSTDIR\Common"
3059    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1034.dll"          "$INSTDIR\Common\afs_config_1034.dll" "$INSTDIR"  
3060    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1034.dll"             "$INSTDIR\Common\afs_cpa_1034.dll" "$INSTDIR"  
3061    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1034.dll"         "$INSTDIR\Common\afseventmsg_1034.dll" "$INSTDIR"  
3062   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1034.dll"     "$INSTDIR\Common\afs_setup_utils_1034.dll" "$INSTDIR"  
3063    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1034.dll"           "$INSTDIR\Common\afsserver_1034.dll" "$INSTDIR"  
3064    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1034.dll"           "$INSTDIR\Common\afssvrcfg_1034.dll" "$INSTDIR"  
3065    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1034.dll" "$INSTDIR\Common\TaAfsAccountManager_1034.dll" "$INSTDIR"  
3066    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1034.dll"         "$INSTDIR\Common\TaAfsAppLib_1034.dll" "$INSTDIR"  
3067    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1034.dll"  "$INSTDIR\Common\TaAfsServerManager_1034.dll" "$INSTDIR"  
3068    File "..\..\doc\help\es_ES\afs-cc.CNT"
3069    File "..\..\doc\help\es_ES\afs-cc.hlp"
3070    File "..\..\doc\help\es_ES\taafscfg.CNT"
3071    File "..\..\doc\help\es_ES\taafscfg.hlp"
3072    File "..\..\doc\help\es_ES\taafssvrmgr.CNT"
3073    File "..\..\doc\help\es_ES\taafssvrmgr.hlp"
3074    File "..\..\doc\help\es_ES\taafsusrmgr.CNT"
3075    File "..\..\doc\help\es_ES\taafsusrmgr.hlp"
3076
3077 !ifdef DEBUG
3078    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1034.pdb"
3079    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1034.pdb"
3080    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1034.pdb"
3081    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1034.pdb"
3082    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1034.pdb"
3083    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1034.pdb"
3084    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1034.pdb"
3085    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1034.pdb"
3086 !ENDIF
3087    goto done
3088
3089 DoJapanese:
3090
3091    SetOutPath "$INSTDIR\Documentation"
3092    File "..\..\doc\install\Documentation\ja_JP\README.TXT"
3093    SetOutPath "$INSTDIR\Documentation\html"
3094    File "..\..\doc\install\Documentation\ja_JP\html\*"
3095    SetOutPath "$INSTDIR\Documentation\html\index_files"
3096    ;File "..\..\doc\install\Documentation\ja_JP\html\index_files\*"
3097    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3098    File "..\..\doc\install\Documentation\ja_JP\html\InstallGd\*"
3099    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3100    ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\*"
3101    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3102    ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\logo_files\*"
3103    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
3104    ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\relnotes_files\*"
3105
3106    SetOutPath "$INSTDIR\Client\Program"
3107    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1041.dll"  "$INSTDIR\Client\Program\afscreds_1041.dll" "$INSTDIR"  
3108    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1041.dll" "$INSTDIR\Client\Program\afs_shl_ext_1041.dll" "$INSTDIR"
3109 !ifdef DEBUG
3110    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1041.pdb"
3111    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1041.pdb"
3112 !endif
3113
3114    File "..\..\doc\help\ja_JP\afs-light.CNT"
3115    File "..\..\doc\help\ja_JP\afs-light.hlp"
3116    File "..\..\doc\help\ja_JP\afs-nt.CNT"
3117    File "..\..\doc\help\ja_JP\afs-nt.HLP"
3118
3119    SetOutPath "$INSTDIR\Common"
3120    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1041.dll"           "$INSTDIR\Common\afs_config_1041.dll" "$INSTDIR"   
3121    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1041.dll"              "$INSTDIR\Common\afs_cpa_1041.dll" "$INSTDIR"   
3122    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1041.dll"          "$INSTDIR\Common\afseventmsg_1041.dll" "$INSTDIR"   
3123   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1041.dll"      "$INSTDIR\Common\afs_setup_utils_1041.dll" "$INSTDIR"   
3124    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1041.dll"            "$INSTDIR\Common\afsserver_1041.dll" "$INSTDIR"   
3125    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1041.dll"            "$INSTDIR\Common\afssvrcfg_1041.dll" "$INSTDIR"   
3126    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1041.dll"  "$INSTDIR\Common\TaAfsAccountManager_1041.dll" "$INSTDIR"   
3127    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1041.dll"          "$INSTDIR\Common\TaAfsAppLib_1041.dll" "$INSTDIR"   
3128    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1041.dll"   "$INSTDIR\Common\TaAfsServerManager_1041.dll" "$INSTDIR"   
3129    File "..\..\doc\help\ja_JP\afs-cc.CNT"
3130    File "..\..\doc\help\ja_JP\afs-cc.hlp"
3131    File "..\..\doc\help\ja_JP\taafscfg.CNT"
3132    File "..\..\doc\help\ja_JP\taafscfg.hlp"
3133    File "..\..\doc\help\ja_JP\taafssvrmgr.CNT"
3134    File "..\..\doc\help\ja_JP\taafssvrmgr.hlp"
3135    File "..\..\doc\help\ja_JP\taafsusrmgr.CNT"
3136    File "..\..\doc\help\ja_JP\taafsusrmgr.hlp"
3137
3138 !ifdef DEBUG
3139    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1041.pdb"
3140    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1041.pdb"
3141    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1041.pdb"
3142    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1041.pdb"
3143    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1041.pdb"
3144    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1041.pdb"
3145    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1041.pdb"
3146    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1041.pdb"
3147 !ENDIF
3148    goto done
3149    
3150 DoKorean:
3151
3152    SetOutPath "$INSTDIR\Documentation"
3153    File "..\..\doc\install\Documentation\ko_KR\README.TXT"
3154    SetOutPath "$INSTDIR\Documentation\html"
3155    File "..\..\doc\install\Documentation\ko_KR\html\*"
3156    SetOutPath "$INSTDIR\Documentation\html\index_files"
3157    ;File "..\..\doc\install\Documentation\ko_KR\html\index_files\*"
3158    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3159    File "..\..\doc\install\Documentation\ko_KR\html\InstallGd\*"
3160    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3161    File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\*"
3162    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3163    ;File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\logo_files\*"
3164    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
3165    ;File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\relnotes_files\*"
3166
3167    SetOutPath "$INSTDIR\Client\Program"
3168    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1042.dll"  "$INSTDIR\Client\Program\afscreds_1042.dll" "$INSTDIR"   
3169    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1042.dll" "$INSTDIR\Client\Program\afs_shl_ext_1042.dll" "$INSTDIR"
3170 !ifdef DEBUG
3171    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1042.pdb"
3172    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1042.pdb"
3173 !endif
3174
3175    File "..\..\doc\help\ko_KR\afs-light.CNT"
3176    File "..\..\doc\help\ko_KR\afs-light.hlp"
3177    File "..\..\doc\help\ko_KR\afs-nt.CNT"
3178    File "..\..\doc\help\ko_KR\afs-nt.HLP"
3179
3180    SetOutPath "$INSTDIR\Common"
3181    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1042.dll"           "$INSTDIR\Common\afs_config_1042.dll" "$INSTDIR"    
3182    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1042.dll"              "$INSTDIR\Common\afs_cpa_1042.dll" "$INSTDIR"    
3183    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1042.dll"          "$INSTDIR\Common\afseventmsg_1042.dll" "$INSTDIR"    
3184   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1042.dll"      "$INSTDIR\Common\afs_setup_utils_1042.dll" "$INSTDIR"    
3185    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1042.dll"            "$INSTDIR\Common\afsserver_1042.dll" "$INSTDIR"    
3186    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1042.dll"            "$INSTDIR\Common\afssvrcfg_1042.dll" "$INSTDIR"    
3187    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1042.dll"  "$INSTDIR\Common\TaAfsAccountManager_1042.dll" "$INSTDIR"    
3188    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1042.dll"          "$INSTDIR\Common\TaAfsAppLib_1042.dll" "$INSTDIR"    
3189    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1042.dll"   "$INSTDIR\Common\TaAfsServerManager_1042.dll" "$INSTDIR"    
3190    File "..\..\doc\help\ko_KR\afs-cc.CNT"
3191    File "..\..\doc\help\ko_KR\afs-cc.hlp"
3192    File "..\..\doc\help\ko_KR\taafscfg.CNT"
3193    File "..\..\doc\help\ko_KR\taafscfg.hlp"
3194    File "..\..\doc\help\ko_KR\taafssvrmgr.CNT"
3195    File "..\..\doc\help\ko_KR\taafssvrmgr.hlp"
3196    File "..\..\doc\help\ko_KR\taafsusrmgr.CNT"
3197    File "..\..\doc\help\ko_KR\taafsusrmgr.hlp"
3198
3199 !ifdef DEBUG
3200    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1042.pdb"
3201    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1042.pdb"
3202    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1042.pdb"
3203    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1042.pdb"
3204    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1042.pdb"
3205    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1042.pdb"
3206    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1042.pdb"
3207    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1042.pdb"
3208 !ENDIF
3209    goto done
3210
3211
3212 DoPortugueseBR:
3213
3214    SetOutPath "$INSTDIR\Documentation"
3215    File "..\..\doc\install\Documentation\pt_BR\README.TXT"
3216    SetOutPath "$INSTDIR\Documentation\html"
3217    File "..\..\doc\install\Documentation\pt_BR\html\*"
3218    SetOutPath "$INSTDIR\Documentation\html\index_files"
3219    ;File "..\..\doc\install\Documentation\pt_BR\html\index_files\*"
3220    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3221    File "..\..\doc\install\Documentation\pt_BR\html\InstallGd\*"
3222    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3223    File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\*"
3224    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3225    ;File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\logo_files\*"
3226    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
3227    ;File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\relnotes_files\*"
3228
3229    SetOutPath "$INSTDIR\Client\Program"
3230    !insertmacro ReplaceDLL  "${AFS_CLIENT_BUILDDIR}\afscreds_1046.dll"  "$INSTDIR\Client\Program\afscreds_1046.dll" "$INSTDIR"    
3231    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1046.dll" "$INSTDIR\Client\Program\afs_shl_ext_1046.dll" "$INSTDIR"
3232 !ifdef DEBUG
3233    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1046.pdb"
3234    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1046.pdb"
3235 !endif
3236
3237    File "..\..\doc\help\pt_BR\afs-light.CNT"
3238    File "..\..\doc\help\pt_BR\afs-light.hlp"
3239    File "..\..\doc\help\pt_BR\afs-nt.CNT"
3240    File "..\..\doc\help\pt_BR\afs-nt.HLP"
3241
3242    SetOutPath "$INSTDIR\Common"
3243    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1046.dll"           "$INSTDIR\Common\afs_config_1046.dll" "$INSTDIR"     
3244    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1046.dll"              "$INSTDIR\Common\afs_cpa_1046.dll" "$INSTDIR"     
3245    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1046.dll"          "$INSTDIR\Common\afseventmsg_1046.dll" "$INSTDIR"     
3246   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1046.dll"      "$INSTDIR\Common\afs_setup_utils_1046.dll" "$INSTDIR"     
3247    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1046.dll"            "$INSTDIR\Common\afsserver_1046.dll" "$INSTDIR"     
3248    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1046.dll"            "$INSTDIR\Common\afssvrcfg_1046.dll" "$INSTDIR"     
3249    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1046.dll"  "$INSTDIR\Common\TaAfsAccountManager_1046.dll" "$INSTDIR"     
3250    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1046.dll"          "$INSTDIR\Common\TaAfsAppLib_1046.dll" "$INSTDIR"     
3251    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1046.dll"   "$INSTDIR\Common\TaAfsServerManager_1046.dll" "$INSTDIR"     
3252    File "..\..\doc\help\pt_BR\afs-cc.CNT"
3253    File "..\..\doc\help\pt_BR\afs-cc.hlp"
3254    File "..\..\doc\help\pt_BR\taafscfg.CNT"
3255    File "..\..\doc\help\pt_BR\taafscfg.hlp"
3256    File "..\..\doc\help\pt_BR\taafssvrmgr.CNT"
3257    File "..\..\doc\help\pt_BR\taafssvrmgr.hlp"
3258    File "..\..\doc\help\pt_BR\taafsusrmgr.CNT"
3259    File "..\..\doc\help\pt_BR\taafsusrmgr.hlp"
3260
3261 !ifdef DEBUG
3262    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1046.pdb"
3263    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1046.pdb"
3264    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1046.pdb"
3265    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1046.pdb"
3266    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1046.pdb"
3267    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1046.pdb"
3268    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1046.pdb"
3269    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1046.pdb"
3270 !ENDIF
3271    goto done
3272    
3273 DoSimpChinese:
3274
3275    SetOutPath "$INSTDIR\Documentation"
3276    File "..\..\doc\install\Documentation\zh_CN\README.TXT"
3277    SetOutPath "$INSTDIR\Documentation\html"
3278    File "..\..\doc\install\Documentation\zh_CN\html\*"
3279    SetOutPath "$INSTDIR\Documentation\html\index_files"
3280    ;File "..\..\doc\install\Documentation\zh_CN\html\index_files\*"
3281    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3282    File "..\..\doc\install\Documentation\zh_CN\html\InstallGd\*"
3283    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3284    File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\*"
3285    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3286    ;File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\logo_files\*"
3287    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
3288    ;File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\relnotes_files\*"
3289
3290    SetOutPath "$INSTDIR\Client\Program"
3291    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_2052.dll"   "$INSTDIR\Client\Program\afscreds_2052.dll" "$INSTDIR"     
3292    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_2052.dll" "$INSTDIR\Client\Program\afs_shl_ext_2052.dll" "$INSTDIR"
3293 !ifdef DEBUG
3294    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_2052.pdb"
3295    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_2052.pdb"
3296 !endif
3297
3298    File "..\..\doc\help\zh_CN\afs-light.CNT"
3299    File "..\..\doc\help\zh_CN\afs-light.hlp"
3300    File "..\..\doc\help\zh_CN\afs-nt.CNT"
3301    File "..\..\doc\help\zh_CN\afs-nt.HLP"
3302
3303    SetOutPath "$INSTDIR\Common"
3304    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_2052.dll"           "$INSTDIR\Common\afs_config_2052.dll" "$INSTDIR"      
3305    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_2052.dll"              "$INSTDIR\Common\afs_cpa_2052.dll" "$INSTDIR"      
3306    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_2052.dll"          "$INSTDIR\Common\afseventmsg_2052.dll" "$INSTDIR"      
3307   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_2052.dll"      "$INSTDIR\Common\afs_setup_utils_2052.dll" "$INSTDIR"      
3308    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_2052.dll"            "$INSTDIR\Common\afsserver_2052.dll" "$INSTDIR"      
3309    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_2052.dll"            "$INSTDIR\Common\afssvrcfg_2052.dll" "$INSTDIR"      
3310    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_2052.dll"  "$INSTDIR\Common\TaAfsAccountManager_2052.dll" "$INSTDIR"      
3311    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_2052.dll"          "$INSTDIR\Common\TaAfsAppLib_2052.dll" "$INSTDIR"      
3312    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_2052.dll"   "$INSTDIR\Common\TaAfsServerManager_2052.dll" "$INSTDIR"      
3313    File "..\..\doc\help\zh_CN\afs-cc.CNT"
3314    File "..\..\doc\help\zh_CN\afs-cc.hlp"
3315    File "..\..\doc\help\zh_CN\taafscfg.CNT"
3316    File "..\..\doc\help\zh_CN\taafscfg.hlp"
3317    File "..\..\doc\help\zh_CN\taafssvrmgr.CNT"
3318    File "..\..\doc\help\zh_CN\taafssvrmgr.hlp"
3319    File "..\..\doc\help\zh_CN\taafsusrmgr.CNT"
3320    File "..\..\doc\help\zh_CN\taafsusrmgr.hlp"
3321
3322 !ifdef DEBUG
3323    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_2052.pdb"
3324    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_2052.pdb"
3325    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_2052.pdb"
3326    ;File "${AFS_SERVER_BUILDDIR}\afsserver_2052.pdb"
3327    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_2052.pdb"
3328    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_2052.pdb"
3329    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_2052.pdb"
3330    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_2052.pdb"
3331 !ENDIF
3332    goto done
3333    
3334 DoTradChinese:
3335
3336    SetOutPath "$INSTDIR\Documentation"
3337    File "..\..\doc\install\Documentation\zh_TW\README.TXT"
3338    SetOutPath "$INSTDIR\Documentation\html"
3339    File "..\..\doc\install\Documentation\zh_TW\html\*"
3340    SetOutPath "$INSTDIR\Documentation\html\index_files"
3341    ;File "..\..\doc\install\Documentation\zh_TW\html\index_files\*"
3342    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
3343    File "..\..\doc\install\Documentation\zh_TW\html\InstallGd\*"
3344    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
3345    File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\*"
3346    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\logo_files"
3347    ;File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\logo_files\*"
3348    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes\relnotes_files"
3349    ;File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\relnotes_files\*"
3350
3351    SetOutPath "$INSTDIR\Client\Program"
3352    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1028.dll"  "$INSTDIR\Client\Program\_1028.dll" "$INSTDIR"      
3353    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1028.dll" "$INSTDIR\Client\Program\afs_shl_ext_1028.dll" "$INSTDIR"
3354 !ifdef DEBUG
3355    ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1028.pdb"
3356    ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1028.pdb"
3357 !endif
3358
3359    File "..\..\doc\help\zh_TW\afs-light.CNT"
3360    File "..\..\doc\help\zh_TW\afs-light.hlp"
3361    File "..\..\doc\help\zh_TW\afs-nt.CNT"
3362    File "..\..\doc\help\zh_TW\afs-nt.HLP"
3363
3364    SetOutPath "$INSTDIR\Common"
3365    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1028.dll"           "$INSTDIR\Common\afs_config_1028.dll" "$INSTDIR"       
3366    !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1028.dll"              "$INSTDIR\Common\afs_cpa_1028.dll" "$INSTDIR"       
3367    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1028.dll"          "$INSTDIR\Common\afseventmsg_1028.dll" "$INSTDIR"       
3368   ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1028.dll"      "$INSTDIR\Common\afs_setup_utils_1028.dll" "$INSTDIR"       
3369    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1028.dll"            "$INSTDIR\Common\afsserver_1028.dll" "$INSTDIR"       
3370    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1028.dll"            "$INSTDIR\Common\afssvrcfg_1028.dll" "$INSTDIR"       
3371    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1028.dll"  "$INSTDIR\Common\TaAfsAccountManager_1028.dll" "$INSTDIR"       
3372    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1028.dll"          "$INSTDIR\Common\TaAfsAppLib_1028.dll" "$INSTDIR"       
3373    !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1028.dll"   "$INSTDIR\Common\TaAfsServerManager_1028.dll" "$INSTDIR"       
3374    File "..\..\doc\help\zh_TW\afs-cc.CNT"
3375    File "..\..\doc\help\zh_TW\afs-cc.hlp"
3376    File "..\..\doc\help\zh_TW\taafscfg.CNT"
3377    File "..\..\doc\help\zh_TW\taafscfg.hlp"
3378    File "..\..\doc\help\zh_TW\taafssvrmgr.CNT"
3379    File "..\..\doc\help\zh_TW\taafssvrmgr.hlp"
3380    File "..\..\doc\help\zh_TW\taafsusrmgr.CNT"
3381    File "..\..\doc\help\zh_TW\taafsusrmgr.hlp"
3382
3383 !ifdef DEBUG
3384    ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1028.pdb"
3385    ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1028.pdb"
3386    ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1028.pdb"
3387    ;File "${AFS_SERVER_BUILDDIR}\afsserver_1028.pdb"
3388    ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1028.pdb"
3389    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1028.pdb"
3390    ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1028.pdb"
3391    ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1028.pdb"
3392 !ENDIF
3393    goto done
3394    
3395 done:
3396
3397    ; Write start menu shortcut
3398    SetOutPath "$SMPROGRAMS\OpenAFS"
3399    CreateDirectory "$SMPROGRAMS\OpenAFS\Documentation"
3400    CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation\Reference Manual.lnk" "$INSTDIR\Documentation\html\CmdRef\index.html"
3401    CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation\Administrator Guide.lnk" "$INSTDIR\Documentation\AdminGuide.chm"
3402    CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation\User Guide.lnk" "$INSTDIR\Documentation\UserGuide.chm"
3403
3404 FunctionEnd
3405
3406
3407
3408 ;====================================================
3409 ; AddToPath - Adds the given dir to the search path.
3410 ;        Input - head of the stack
3411 ;        Note - Win9x systems requires reboot
3412 ;====================================================
3413 Function AddToPath
3414   Exch $0
3415   Push $1
3416   Push $2
3417   Push $3
3418
3419   # don't add if the path doesn't exist
3420   IfFileExists $0 "" AddToPath_done
3421
3422   ReadEnvStr $1 PATH
3423   Push "$1;"
3424   Push "$0;"
3425   Call StrStr
3426   Pop $2
3427   StrCmp $2 "" "" AddToPath_done
3428   Push "$1;"
3429   Push "$0\;"
3430   Call StrStr
3431   Pop $2
3432   StrCmp $2 "" "" AddToPath_done
3433   GetFullPathName /SHORT $3 $0
3434   Push "$1;"
3435   Push "$3;"
3436   Call StrStr
3437   Pop $2
3438   StrCmp $2 "" "" AddToPath_done
3439   Push "$1;"
3440   Push "$3\;"
3441   Call StrStr
3442   Pop $2
3443   StrCmp $2 "" "" AddToPath_done
3444
3445   Call IsNT
3446   Pop $1
3447   StrCmp $1 1 AddToPath_NT
3448     ; Not on NT
3449     StrCpy $1 $WINDIR 2
3450     FileOpen $1 "$1\autoexec.bat" a
3451     FileSeek $1 -1 END
3452     FileReadByte $1 $2
3453     IntCmp $2 26 0 +2 +2 # DOS EOF
3454       FileSeek $1 -1 END # write over EOF
3455     FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
3456     FileClose $1
3457     SetRebootFlag true
3458     Goto AddToPath_done
3459
3460   AddToPath_NT:
3461     ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
3462     StrCpy $2 $1 1 -1 # copy last char
3463     StrCmp $2 ";" 0 +2 # if last char == ;
3464       StrCpy $1 $1 -1 # remove last char
3465     StrCmp $1 "" AddToPath_NTdoIt
3466       StrCpy $0 "$1;$0"
3467     AddToPath_NTdoIt:
3468       WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $0
3469       SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
3470
3471   AddToPath_done:
3472     Pop $3
3473     Pop $2
3474     Pop $1
3475     Pop $0
3476 FunctionEnd
3477
3478 ;====================================================
3479 ; RemoveFromPath - Remove a given dir from the path
3480 ;     Input: head of the stack
3481 ;====================================================
3482 Function un.RemoveFromPath
3483   Exch $0
3484   Push $1
3485   Push $2
3486   Push $3
3487   Push $4
3488   Push $5
3489   Push $6
3490
3491   IntFmt $6 "%c" 26 # DOS EOF
3492
3493   Call un.IsNT
3494   Pop $1
3495   StrCmp $1 1 unRemoveFromPath_NT
3496     ; Not on NT
3497     StrCpy $1 $WINDIR 2
3498     FileOpen $1 "$1\autoexec.bat" r
3499     GetTempFileName $4
3500     FileOpen $2 $4 w
3501     GetFullPathName /SHORT $0 $0
3502     StrCpy $0 "SET PATH=%PATH%;$0"
3503     Goto unRemoveFromPath_dosLoop
3504
3505     unRemoveFromPath_dosLoop:
3506       FileRead $1 $3
3507       StrCpy $5 $3 1 -1 # read last char
3508       StrCmp $5 $6 0 +2 # if DOS EOF
3509         StrCpy $3 $3 -1 # remove DOS EOF so we can compare
3510       StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
3511       StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
3512       StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
3513       StrCmp $3 "" unRemoveFromPath_dosLoopEnd
3514       FileWrite $2 $3
3515       Goto unRemoveFromPath_dosLoop
3516       unRemoveFromPath_dosLoopRemoveLine:
3517         SetRebootFlag true
3518         Goto unRemoveFromPath_dosLoop
3519
3520     unRemoveFromPath_dosLoopEnd:
3521       FileClose $2
3522       FileClose $1
3523       StrCpy $1 $WINDIR 2
3524       Delete "$1\autoexec.bat"
3525       CopyFiles /SILENT $4 "$1\autoexec.bat"
3526       Delete $4
3527       Goto unRemoveFromPath_done
3528
3529   unRemoveFromPath_NT:
3530     ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
3531     StrCpy $5 $1 1 -1 # copy last char
3532     StrCmp $5 ";" +2 # if last char != ;
3533       StrCpy $1 "$1;" # append ;
3534     Push $1
3535     Push "$0;"
3536     Call un.StrStr ; Find `$0;` in $1
3537     Pop $2 ; pos of our dir
3538     StrCmp $2 "" unRemoveFromPath_done
3539       ; else, it is in path
3540       # $0 - path to add
3541       # $1 - path var
3542       StrLen $3 "$0;"
3543       StrLen $4 $2
3544       StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
3545       StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
3546       StrCpy $3 $5$6
3547
3548       StrCpy $5 $3 1 -1 # copy last char
3549       StrCmp $5 ";" 0 +2 # if last char == ;
3550         StrCpy $3 $3 -1 # remove last char
3551
3552       WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3
3553       SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
3554
3555   unRemoveFromPath_done:
3556     Pop $6
3557     Pop $5
3558     Pop $4
3559     Pop $3
3560     Pop $2
3561     Pop $1
3562     Pop $0
3563 FunctionEnd
3564
3565 ;====================================================
3566 ; IsNT - Returns 1 if the current system is NT, 0
3567 ;        otherwise.
3568 ;     Output: head of the stack
3569 ;====================================================
3570 !macro IsNT un
3571 Function ${un}IsNT
3572   Push $0
3573   ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
3574   StrCmp $0 "" 0 IsNT_yes
3575   ; we are not NT.
3576   Pop $0
3577   Push 0
3578   Return
3579
3580   IsNT_yes:
3581     ; NT!!!
3582     Pop $0
3583     Push 1
3584 FunctionEnd
3585 !macroend
3586 !insertmacro IsNT ""
3587 !insertmacro IsNT "un."
3588
3589 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3590 ; Uninstall stuff
3591 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3592 ;====================================================
3593 ; StrStr - Finds a given string in another given string.
3594 ;               Returns -1 if not found and the pos if found.
3595 ;          Input: head of the stack - string to find
3596 ;                      second in the stack - string to find in
3597 ;          Output: head of the stack
3598 ;====================================================
3599 !macro StrStr un
3600 Function ${un}StrStr
3601 Exch $R1 ; st=haystack,old$R1, $R1=needle
3602   Exch    ; st=old$R1,haystack
3603   Exch $R2 ; st=old$R1,old$R2, $R2=haystack
3604   Push $R3
3605   Push $R4
3606   Push $R5
3607   StrLen $R3 $R1
3608   StrCpy $R4 0
3609   ; $R1=needle
3610   ; $R2=haystack
3611   ; $R3=len(needle)
3612   ; $R4=cnt
3613   ; $R5=tmp
3614   loop:
3615     StrCpy $R5 $R2 $R3 $R4
3616     StrCmp $R5 $R1 done
3617     StrCmp $R5 "" done
3618     IntOp $R4 $R4 + 1
3619     Goto loop
3620 done:
3621   StrCpy $R1 $R2 "" $R4
3622   Pop $R5
3623   Pop $R4
3624   Pop $R3
3625   Pop $R2
3626   Exch $R1
3627 FunctionEnd
3628 !macroend
3629 !insertmacro StrStr ""
3630 !insertmacro StrStr "un."
3631
3632
3633 !ifdef ADDSHAREDDLLUSED
3634 ; AddSharedDLL
3635  ;
3636  ; Increments a shared DLLs reference count.
3637  ; Use by passing one item on the stack (the full path of the DLL).
3638  ;
3639  ; Usage:
3640  ;   Push $SYSDIR\myDll.dll
3641  ;   Call AddSharedDLL
3642  ;
3643
3644  Function AddSharedDLL
3645    Exch $R1
3646    Push $R0
3647    ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
3648    IntOp $R0 $R0 + 1
3649    WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0
3650    Pop $R0
3651    Pop $R1
3652  FunctionEnd
3653
3654  
3655 ; un.RemoveSharedDLL
3656  ;
3657  ; Decrements a shared DLLs reference count, and removes if necessary.
3658  ; Use by passing one item on the stack (the full path of the DLL).
3659  ; Note: for use in the main installer (not the uninstaller), rename the
3660  ; function to RemoveSharedDLL.
3661  ;
3662  ; Usage:
3663  ;   Push $SYSDIR\myDll.dll
3664  ;   Call un.RemoveSharedDLL
3665  ;
3666
3667  Function un.RemoveSharedDLL
3668    Exch $R1
3669    Push $R0
3670    ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
3671    StrCmp $R0 "" remove
3672      IntOp $R0 $R0 - 1
3673      IntCmp $R0 0 rk rk uk
3674      rk:
3675        DeleteRegValue HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
3676      goto Remove
3677      uk:
3678        WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0
3679      Goto noremove
3680    remove:
3681      Delete /REBOOTOK $R1
3682    noremove:
3683    Pop $R0
3684    Pop $R1
3685  FunctionEnd
3686 !endif
3687
3688
3689 ; Installs the loopback adpater and disables it on Windows 2000
3690 Function afs.InstallMSLoopback
3691    GetTempFileName $R0
3692    File /oname=$R0 "${AFS_WININSTALL_DIR}\afsloopback.dll"
3693    nsExec::Exec "rundll32.exe $R0 doLoopBackEntry AFS 10.254.254.253 255.255.255.252"
3694    Delete $R0
3695 FunctionEnd
3696
3697 Function afs.isLoopbackInstalled
3698    SetOutPath $TEMP
3699    File "${AFS_WININSTALL_DIR}\afsloopback.dll"
3700    System::Call "$TEMP\afsloopback.dll::IsLoopbackInstalled() i().r11"
3701    Delete "$TEMP\afsloopback.dll"
3702 FunctionEnd
3703
3704
3705 ; GetWindowsVersion
3706 ;
3707 ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
3708 ; Updated by Joost Verburg
3709 ;
3710 ; Returns on top of stack
3711 ;
3712 ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003, Vista/2008)
3713 ; or
3714 ; '' (Unknown Windows Version)
3715 ;
3716 ; Usage:
3717 ;   Call GetWindowsVersion
3718 ;   Pop $R0
3719 ;   ; at this point $R0 is "NT 4.0" or whatnot
3720
3721 Function GetWindowsVersion
3722
3723   Push $R0
3724   Push $R1
3725
3726   ClearErrors
3727
3728   ReadRegStr $R0 HKLM \
3729   "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
3730
3731   IfErrors 0 lbl_winnt
3732   
3733   ; we are not NT
3734   ReadRegStr $R0 HKLM \
3735   "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
3736
3737   StrCpy $R1 $R0 1
3738   StrCmp $R1 '4' 0 lbl_error
3739
3740   StrCpy $R1 $R0 3
3741
3742   StrCmp $R1 '4.0' lbl_win32_95
3743   StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
3744
3745   lbl_win32_95:
3746     StrCpy $R0 '95'
3747   Goto lbl_done
3748
3749   lbl_win32_98:
3750     StrCpy $R0 '98'
3751   Goto lbl_done
3752
3753   lbl_win32_ME:
3754     StrCpy $R0 'ME'
3755   Goto lbl_done
3756
3757   lbl_winnt:
3758
3759   StrCpy $R1 $R0 1
3760
3761   StrCmp $R1 '3' lbl_winnt_x
3762   StrCmp $R1 '4' lbl_winnt_x
3763
3764   StrCpy $R1 $R0 3
3765
3766   StrCmp $R1 '5.0' lbl_winnt_2000
3767   StrCmp $R1 '5.1' lbl_winnt_XP
3768   StrCmp $R1 '5.2' lbl_winnt_2003
3769   StrCmp $R1 '6.0' lbl_winnt_vista lbl_error
3770
3771   lbl_winnt_x:
3772     StrCpy $R0 "NT $R0" 6
3773   Goto lbl_done
3774
3775   lbl_winnt_2000:
3776     Strcpy $R0 '2000'
3777   Goto lbl_done
3778
3779   lbl_winnt_XP:
3780     Strcpy $R0 'XP'
3781   Goto lbl_done
3782
3783   lbl_winnt_2003:
3784     Strcpy $R0 '2003'
3785   Goto lbl_done
3786
3787   lbl_winnt_vista:
3788     Strcpy $R0 'Vista'
3789   Goto lbl_done
3790
3791   lbl_error:
3792     Strcpy $R0 ''
3793   lbl_done:
3794
3795   Pop $R1
3796   Exch $R0
3797
3798 FunctionEnd
3799
3800
3801 ; Author: Lilla (lilla@earthlink.net) 2003-06-13
3802 ; function IsUserAdmin uses plugin \NSIS\PlusgIns\UserInfo.dll
3803 ; This function is based upon code in \NSIS\Contrib\UserInfo\UserInfo.nsi
3804 ; This function was tested under NSIS 2 beta 4 (latest CVS as of this writing).
3805 ;
3806 ; Usage:
3807 ;   Call IsUserAdmin
3808 ;   Pop $R0   ; at this point $R0 is "true" or "false"
3809 ;
3810 Function IsUserAdmin
3811 Push $R0
3812 Push $R1
3813 Push $R2
3814
3815 ClearErrors
3816 UserInfo::GetName
3817 IfErrors Win9x
3818 Pop $R1
3819 UserInfo::GetAccountType
3820 Pop $R2
3821
3822 StrCmp $R2 "Admin" 0 Continue
3823 ; Observation: I get here when running Win98SE. (Lilla)
3824 ; The functions UserInfo.dll looks for are there on Win98 too, 
3825 ; but just don't work. So UserInfo.dll, knowing that admin isn't required
3826 ; on Win98, returns admin anyway. (per kichik)
3827 ; MessageBox MB_OK 'User "$R1" is in the Administrators group'
3828 StrCpy $R0 "true"
3829 Goto Done
3830
3831 Continue:
3832 ; You should still check for an empty string because the functions
3833 ; UserInfo.dll looks for may not be present on Windows 95. (per kichik)
3834 StrCmp $R2 "" Win9x
3835 StrCpy $R0 "false"
3836 ;MessageBox MB_OK 'User "$R1" is in the "$R2" group'
3837 Goto Done
3838
3839 Win9x:
3840 ; comment/message below is by UserInfo.nsi author:
3841 ; This one means you don't need to care about admin or
3842 ; not admin because Windows 9x doesn't either
3843 ;MessageBox MB_OK "Error! This DLL can't run under Windows 9x!"
3844 StrCpy $R0 "false"
3845
3846 Done:
3847 ;MessageBox MB_OK 'User= "$R1"  AccountType= "$R2"  IsUserAdmin= "$R0"'
3848
3849 Pop $R2
3850 Pop $R1
3851 Exch $R0
3852 FunctionEnd
3853
3854 ; GetParent
3855  ; input, top of stack  (e.g. C:\Program Files\Poop)
3856  ; output, top of stack (replaces, with e.g. C:\Program Files)
3857  ; modifies no other variables.
3858  ;
3859  ; Usage:
3860  ;   Push "C:\Program Files\Directory\Whatever"
3861  ;   Call GetParent
3862  ;   Pop $R0
3863  ;   ; at this point $R0 will equal "C:\Program Files\Directory"
3864
3865 Function GetParent
3866
3867   Exch $R0
3868   Push $R1
3869   Push $R2
3870   Push $R3
3871   
3872   StrCpy $R1 0
3873   StrLen $R2 $R0
3874   
3875   loop:
3876     IntOp $R1 $R1 + 1
3877     IntCmp $R1 $R2 get 0 get
3878     StrCpy $R3 $R0 1 -$R1
3879     StrCmp $R3 "\" get
3880   Goto loop
3881   
3882   get:
3883     StrCpy $R0 $R0 -$R1
3884     
3885     Pop $R3
3886     Pop $R2
3887     Pop $R1
3888     Exch $R0
3889     
3890 FunctionEnd
3891
3892
3893 ;--------------------------------
3894 ;Handle what must and what must not be installed
3895 Function .onSelChange
3896    ; If they install the server, they MUST install the client
3897    SectionGetFlags ${secServer} $R0
3898    IntOp $R0 $R0 & ${SF_SELECTED}
3899    StrCmp $R0 "1" MakeClientSelected
3900    
3901    ; If they install the control center, we'll give them the client.
3902    ; It may not be required, but it's a bit more useful
3903    SectionGetFlags ${secControl} $R0
3904    IntOp $R0 $R0 & ${SF_SELECTED}
3905    StrCmp $R0 "1" MakeClientSelected
3906    goto end
3907    
3908 MakeClientSelected:
3909    SectionGetFlags ${secClient} $R0
3910    IntOp $R0 $R0 | ${SF_SELECTED}
3911    SectionSetFlags ${secClient} $R0
3912    
3913 end:
3914 FunctionEnd
3915
3916 Function RegWriteMultiStr
3917 !define HKEY_CLASSES_ROOT        0x80000000
3918 !define HKEY_CURRENT_USER        0x80000001
3919 !define HKEY_LOCAL_MACHINE       0x80000002
3920 !define HKEY_USERS               0x80000003
3921 !define HKEY_PERFORMANCE_DATA    0x80000004
3922 !define HKEY_PERFORMANCE_TEXT    0x80000050
3923 !define HKEY_PERFORMANCE_NLSTEXT 0x80000060
3924 !define HKEY_CURRENT_CONFIG      0x80000005
3925 !define HKEY_DYN_DATA            0x80000006
3926
3927 !define KEY_QUERY_VALUE          0x0001
3928 !define KEY_SET_VALUE            0x0002
3929 !define KEY_CREATE_SUB_KEY       0x0004
3930 !define KEY_ENUMERATE_SUB_KEYS   0x0008
3931 !define KEY_NOTIFY               0x0010
3932 !define KEY_CREATE_LINK          0x0020
3933
3934 !define REG_NONE                 0
3935 !define REG_SZ                   1
3936 !define REG_EXPAND_SZ            2
3937 !define REG_BINARY               3
3938 !define REG_DWORD                4
3939 !define REG_DWORD_LITTLE_ENDIAN  4
3940 !define REG_DWORD_BIG_ENDIAN     5
3941 !define REG_LINK                 6
3942 !define REG_MULTI_SZ             7
3943
3944 !define RegCreateKey             "Advapi32::RegCreateKeyA(i, t, *i) i"
3945 !define RegSetValueEx            "Advapi32::RegSetValueExA(i, t, i, i, i, i) i"
3946 !define RegCloseKey              "Advapi32::RegCloseKeyA(i) i"
3947
3948   Exch $R0
3949   Push $1
3950   Push $2
3951   Push $9
3952
3953   SetPluginUnload alwaysoff
3954   ; Create a buffer for the multi_sz value
3955   System::Call "*(&t${NSIS_MAX_STRLEN}) i.r1"
3956   ; Open/create the registry key
3957   System::Call "${RegCreateKey}(${HKEY_LOCAL_MACHINE}, '$REG_SUB_KEY', .r0) .r9"
3958   ; Failed?
3959   IntCmp $9 0 write
3960     MessageBox MB_OK|MB_ICONSTOP "Can't create registry key! ($9)"
3961     Goto noClose
3962
3963   write:
3964     ; Fill in the buffer with our strings
3965     StrCpy $2 $1                            ; Initial position
3966
3967     StrLen $9 '$REG_DATA_1'                 ; Length of first string
3968     IntOp $9 $9 + 1                         ; Plus null
3969     System::Call "*$2(&t$9 '$REG_DATA_1')"  ; Place the string
3970     IntOp $2 $2 + $9                        ; Advance to the next position
3971
3972     StrCmp '$REG_DATA_2' "" terminate
3973     StrLen $9 '$REG_DATA_2'                 ; Length of second string
3974     IntOp $9 $9 + 1                         ; Plus null
3975     System::Call "*$2(&t$9 '$REG_DATA_2')"  ; Place the string
3976     IntOp $2 $2 + $9                        ; Advance to the next position
3977
3978     StrCmp '$REG_DATA_3' "" terminate
3979     StrLen $9 '$REG_DATA_3'                 ; Length of third string
3980     IntOp $9 $9 + 1                         ; Plus null
3981     System::Call "*$2(&t$9 '$REG_DATA_3')"  ; Place the string
3982     IntOp $2 $2 + $9                        ; Advance to the next position
3983
3984     StrCmp '$REG_DATA_4' "" terminate
3985     StrLen $9 '$REG_DATA_4'                 ; Length of third string
3986     IntOp $9 $9 + 1                         ; Plus null
3987     System::Call "*$2(&t$9 '$REG_DATA_4')"  ; Place the string
3988     IntOp $2 $2 + $9                        ; Advance to the next position
3989
3990   terminate:
3991     System::Call "*$2(&t1 '')"              ; Place the terminating null
3992     IntOp $2 $2 + 1                         ; Advance to the next position
3993
3994     ; Create/write the value
3995     IntOp $2 $2 - $1                        ; Total length
3996     System::Call "${RegSetValueEx}(r0, '$REG_VALUE', 0, ${REG_MULTI_SZ}, r1, r2) .r9"
3997     ; Failed?
3998     IntCmp $9 0 done
3999       MessageBox MB_OK|MB_ICONSTOP "Can't set key value! ($9)"
4000       Goto done
4001
4002   done:
4003     ; Close the registry key
4004     System::Call "${RegCloseKey}(r0)"
4005
4006 noClose:
4007   ; Clear the buffer
4008   SetPluginUnload manual
4009   System::Free $1
4010
4011   Pop $9
4012   Pop $2
4013   Pop $1
4014   Exch $R0
4015 FunctionEnd
4016
4017 Function CreateDesktopIni
4018    WriteIniStr "$INSTDIR\Desktop.ini" ".ShellClassInfo" "IconFile" "client\program\afsd_service.exe"
4019    WriteIniStr "$INSTDIR\Desktop.ini" ".ShellClassInfo" "IconIndex" "0"
4020    SetFileAttributes "$INSTDIR\Desktop.ini" HIDDEN|SYSTEM
4021    SetFileAttributes "$INSTDIR\" READONLY
4022 FunctionEnd