1433033b7278ee8c000addabe7c456b43d7d7464
[openafs.git] / src / WINNT / install / NSIS / OpenAFS.nsi
1 ;OpenAFS Install Script for NSIS
2 ;
3 ; Written by Rob Murawski <rsm4@ieee.org>
4 ;
5 ;Based on:
6 ;NSIS Modern User Interface version 1.63
7 ;MultiLanguage Example Script
8 ;Written by Joost Verburg
9
10 !define MUI_PRODUCT "OpenAFS for Windows" ;Define your own software name here
11 !define MUI_VERSION "1.2.11" ;Define your own software version here
12 !define MUI_MAJORVERSION 1
13 !define MUI_MINORVERSION 2
14 !define MUI_PATCHLEVEL 110
15
16
17 !include "MUI.nsh"
18 !include Sections.nsh
19
20 ;--------------------------------
21 ;Configuration
22
23   ;General
24   OutFile "OpenAFSforWindows.exe"
25   SilentInstall normal
26   !define MUI_ICON "..\..\client_cpa\afs_conf.ico"
27   !define MUI_UNICON "c:\Program Files\NSIS\Contrib\Icons\normal-uninstall.ico"
28   !define AFS_COMPANY_NAME "OpenAFS"
29   !define AFS_PRODUCT_NAME "OpenAFS"
30   !define AFS_REGKEY_ROOT "Software\OpenAFS"
31   CRCCheck force
32
33   ;Folder selection page
34   InstallDir "$PROGRAMFILES\OpenAFS\AFS"
35   
36   ;Remember install folder
37   InstallDirRegKey HKCU "Software\OpenAFS\AFS" ""
38   
39   ;Remember the installer language
40   !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" 
41   !define MUI_LANGDLL_REGISTRY_KEY "Software\OpenAFS" 
42   !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
43   
44   ;Where are the files?
45   !define AFS_DESTDIR "..\..\..\..\obj\DEST\free"
46   !define AFS_CLIENT_BUILDDIR "${AFS_DESTDIR}\root.client\usr\vice\etc"
47   !define AFS_WININSTALL_DIR "${AFS_DESTDIR}\WinInstall\Config"
48   !define AFS_BUILD_INCDIR "${AFS_DESTDIR}\include"
49   !define AFS_CLIENT_LIBDIR "${AFS_DESTDIR}\lib"
50   !define AFS_SERVER_BUILDDIR "${AFS_DESTDIR}\root.server\usr\afs\bin"
51   !define SDK_DIR "X:"
52   
53 ;--------------------------------
54 ;Modern UI Configuration
55
56   !define MUI_CUSTOMPAGECOMMANDS
57   !define MUI_WELCOMEPAGE
58   !define MUI_COMPONENTSPAGE
59   !define MUI_COMPONENTSPAGE_SMALLDESC
60   !define MUI_DIRECTORYPAGE
61
62   !define MUI_ABORTWARNING
63   !define MUI_FINISHPAGE
64   
65   !define MUI_UNINSTALLER
66   !define MUI_UNCONFIRMPAGE
67
68   
69   !insertmacro MUI_PAGECOMMAND_WELCOME
70   !insertmacro MUI_PAGECOMMAND_COMPONENTS
71   !insertmacro MUI_PAGECOMMAND_DIRECTORY
72   Page custom AFSPageGetCellServDB
73   !insertmacro MUI_PAGECOMMAND_INSTFILES
74   !insertmacro MUI_PAGECOMMAND_FINISH
75   
76 ;--------------------------------
77 ;Languages
78
79   !insertmacro MUI_LANGUAGE "English"
80   ;!insertmacro MUI_LANGUAGE "French"
81   !insertmacro MUI_LANGUAGE "German"
82   !insertmacro MUI_LANGUAGE "Spanish"
83   !insertmacro MUI_LANGUAGE "SimpChinese"
84   !insertmacro MUI_LANGUAGE "TradChinese"    
85   !insertmacro MUI_LANGUAGE "Japanese"
86   ;!insertmacro MUI_LANGUAGE "Korean"
87   ;!insertmacro MUI_LANGUAGE "Italian"
88   ;!insertmacro MUI_LANGUAGE "Dutch"
89   ;!insertmacro MUI_LANGUAGE "Danish"
90   ;!insertmacro MUI_LANGUAGE "Greek"
91   ;!insertmacro MUI_LANGUAGE "Russian"
92   !insertmacro MUI_LANGUAGE "PortugueseBR"
93   ;!insertmacro MUI_LANGUAGE "Polish"
94   ;!insertmacro MUI_LANGUAGE "Ukrainian"
95   ;!insertmacro MUI_LANGUAGE "Czech"
96   ;!insertmacro MUI_LANGUAGE "Slovak"
97   ;!insertmacro MUI_LANGUAGE "Croatian"
98   ;!insertmacro MUI_LANGUAGE "Bulgarian"
99   ;!insertmacro MUI_LANGUAGE "Hungarian"
100   ;!insertmacro MUI_LANGUAGE "Thai"
101   ;!insertmacro MUI_LANGUAGE "Romanian"
102   ;!insertmacro MUI_LANGUAGE "Macedonian"
103   ;!insertmacro MUI_LANGUAGE "Turkish"
104   
105 ;--------------------------------
106 ;Language Strings
107     
108   ;Descriptions
109   LangString DESC_SecCopyUI ${LANG_ENGLISH} "OpenAFS for Windows: English"
110   ;LangString DESC_SecCopyUI ${LANG_FRENCH} "OpenAFS for Windows: French"
111   LangString DESC_SecCopyUI ${LANG_GERMAN} "OpenAFS for Windows: German"
112   LangString DESC_SecCopyUI ${LANG_SPANISH} "OpenAFS for Windows: Spanish"
113   LangString DESC_SecCopyUI ${LANG_SIMPCHINESE} "OpenAFS for Windows: Simplified Chinese"
114   LangString DESC_SecCopyUI ${LANG_TRADCHINESE} "OpenAFS for Windows: Traditional Chinese description"
115   LangString DESC_SecCopyUI ${LANG_JAPANESE} "OpenAFS for Windows: Japanese description"
116   LangString DESC_SecCopyUI ${LANG_KOREAN} "OpenAFS for Windows: Korean description"
117   ;LangString DESC_SecCopyUI ${LANG_ITALIAN} "OpenAFS for Windows: Italian description"
118   ;LangString DESC_SecCopyUI ${LANG_DUTCH} "OpenAFS for Windows: Dutch description"
119   ;LangString DESC_SecCopyUI ${LANG_DANISH} "OpenAFS for Windows: Danish description"
120   ;LangString DESC_SecCopyUI ${LANG_GREEK} "OpenAFS for Windows: Greek description"
121   ;LangString DESC_SecCopyUI ${LANG_RUSSIAN} "OpenAFS for Windows: Russian description"
122   LangString DESC_SecCopyUI ${LANG_PORTUGUESEBR} "OpenAFS for Windows: Portuguese (Brasil) description"
123   ;LangString DESC_SecCopyUI ${LANG_POLISH} "OpenAFS for Windows: Polish description"
124   ;LangString DESC_SecCopyUI ${LANG_UKRAINIAN} "OpenAFS for Windows: Ukrainian description"
125   ;LangString DESC_SecCopyUI ${LANG_CZECH} "OpenAFS for Windows: Czechian description"
126   ;LangString DESC_SecCopyUI ${LANG_SLOVAK} "OpenAFS for Windows: Slovakian description"
127   ;LangString DESC_SecCopyUI ${LANG_CROATIAN} "OpenAFS for Windows: Slovakian description"
128   ;LangString DESC_SecCopyUI ${LANG_BULGARIAN} "OpenAFS for Windows: Bulgarian description"
129   ;LangString DESC_SecCopyUI ${LANG_HUNGARIAN} "OpenAFS for Windows: Hungarian description"
130   ;LangString DESC_SecCopyUI ${LANG_THAI} "OpenAFS for Windows: Thai description"
131   ;LangString DESC_SecCopyUI ${LANG_ROMANIAN} "OpenAFS for Windows: Romanian description"
132   ;LangString DESC_SecCopyUI ${LANG_MACEDONIAN} "OpenAFS for Windows: Macedonian description"
133   ;LangString DESC_SecCopyUI ${LANG_TURKISH} "OpenAFS for Windows: Turkish description"
134
135   LangString DESC_SecClient ${LANG_ENGLISH} "OpenAFS Client: Allows you to access AFS from your Windows PC."
136   LangString DESC_SecClient ${LANG_GERMAN} "OpenAFS Client: Allows you to access AFS from your Windows PC."
137   LangString DESC_SecClient ${LANG_SPANISH} "OpenAFS Client: Allows you to access AFS from your Windows PC."
138   LangString DESC_SecClient ${LANG_SIMPCHINESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
139   LangString DESC_SecClient ${LANG_TRADCHINESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
140   LangString DESC_SecClient ${LANG_JAPANESE} "OpenAFS Client: Allows you to access AFS from your Windows PC."
141   LangString DESC_SecClient ${LANG_KOREAN} "OpenAFS Client: Allows you to access AFS from your Windows PC."
142   LangString DESC_SecClient ${LANG_PORTUGUESEBR} "OpenAFS Client: Allows you to access AFS from your Windows PC."
143   
144   LangString DESC_SecServer ${LANG_ENGLISH} "OpenAFS Server: Allows you to run an AFS file server."
145   LangString DESC_SecServer ${LANG_GERMAN} "OpenAFS Server: Allows you to run an AFS file server."
146   LangString DESC_SecServer ${LANG_SPANISH} "OpenAFS Server: Allows you to run an AFS file server."
147   LangString DESC_SecServer ${LANG_SIMPCHINESE} "OpenAFS Server: Allows you to run an AFS file server."
148   LangString DESC_SecServer ${LANG_TRADCHINESE} "OpenAFS Server: Allows you to run an AFS file server."
149   LangString DESC_SecServer ${LANG_JAPANESE} "OpenAFS Server: Allows you to run an AFS file server."
150   LangString DESC_SecServer ${LANG_KOREAN} "OpenAFS Server: Allows you to run an AFS file server."
151   LangString DESC_SecServer ${LANG_PORTUGUESEBR} "OpenAFS Server: Allows you to run an AFS file server."
152   
153   LangString DESC_SecControl ${LANG_ENGLISH} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
154   LangString DESC_SecControl ${LANG_GERMAN} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
155   LangString DESC_SecControl ${LANG_SPANISH} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
156   LangString DESC_SecControl ${LANG_SIMPCHINESE} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
157   LangString DESC_SecControl ${LANG_TRADCHINESE} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
158   LangString DESC_SecControl ${LANG_JAPANESE} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
159   LangString DESC_SecControl ${LANG_KOREAN} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
160   LangString DESC_SecControl ${LANG_PORTUGUESEBR} "OpenAFS Control Center: GUI utilities for managing and configuring AFS."
161   
162   LangString DESC_SecDocs ${LANG_ENGLISH} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
163   LangString DESC_SecDocs ${LANG_GERMAN} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
164   LangString DESC_SecDocs ${LANG_SPANISH} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
165   LangString DESC_SecDocs ${LANG_SIMPCHINESE} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
166   LangString DESC_SecDocs ${LANG_TRADCHINESE} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
167   LangString DESC_SecDocs ${LANG_JAPANESE} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
168   LangString DESC_SecDocs ${LANG_KOREAN} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
169   LangString DESC_SecDocs ${LANG_PORTUGUESEBR} "OpenAFS Supplemental Documentation: Additional documentation for using OpenAFS."
170   
171 ; Popup error messages
172   LangString CellError ${LANG_ENGLISH} "You must specify a valid CellServDB file to copy during install"
173   LangString CellError ${LANG_GERMAN} "You must specify a valid CellServDB file to copy during the install"
174   LangString CellError ${LANG_SPANISH} "You must specify a valid CellServDB file to copy during the install"
175   LangString CellError ${LANG_SIMPCHINESE} "You must specify a valid CellServDB file to copy during the install"
176   LangString CellError ${LANG_TRADCHINESE} "You must specify a valid CellServDB file to copy during the install"
177   LangString CellError ${LANG_JAPANESE} "You must specify a valid CellServDB file to copy during the install"
178   LangString CellError ${LANG_KOREAN} "You must specify a valid CellServDB file to copy during the install"
179   LangString CellError ${LANG_PORTUGUESEBR} "You must specify a valid CellServDB file to copy during the install"
180   
181   
182 ; Upgrade/re-install strings
183    LangString UPGRADE_CLIENT ${LANG_ENGLISH} "Upgrade AFS Client"
184    
185    
186    LangString REINSTALL_SERVER ${LANG_ENGLISH} "Re-install AFS Server"
187   
188 ;--------------------------------
189
190 ;--------------------------------
191 ;Reserve Files
192   
193   ;Things that need to be extracted on first (keep these lines before any File command!)
194   ;Only useful for BZIP2 compression
195   !insertmacro MUI_RESERVEFILE_LANGDLL
196   
197 ;--------------------------------
198 ;Installer Sections
199
200 ;----------------------
201 ; OpenAFS CLIENT
202 Section "AFS Client" SecClient
203
204    ; Do client components
205   SetOutPath "$INSTDIR\Client\Program"
206   File "${AFS_CLIENT_BUILDDIR}\afsshare.exe"
207   File "${AFS_BUILD_INCDIR}\afs\cm_config.h"
208   File "${AFS_CLIENT_BUILDDIR}\libosi.dll"
209   File "${AFS_BUILD_INCDIR}\afs\kautils.h"
210   File "${AFS_CLIENT_BUILDDIR}\libafsconf.dll"
211   File "${AFS_CLIENT_BUILDDIR}\klog.exe"
212   File "${AFS_CLIENT_BUILDDIR}\tokens.exe"
213   File "${AFS_CLIENT_BUILDDIR}\unlog.exe"
214   File "${AFS_CLIENT_BUILDDIR}\fs.exe"
215   File "${AFS_CLIENT_BUILDDIR}\libafsconf.dll"
216   File "${AFS_CLIENT_LIBDIR}\afsauthent.lib"
217   File "${AFS_CLIENT_BUILDDIR}\afscreds.exe"
218   File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.dll"
219   File "${AFS_BUILD_INCDIR}\afs\auth.h"
220   File "${AFS_CLIENT_BUILDDIR}\afsd_service.exe"
221   File "${AFS_CLIENT_BUILDDIR}\afslogon.dll"
222   File "${AFS_CLIENT_BUILDDIR}\symlink.exe"
223   File "${AFS_DESTDIR}\bin\kpasswd.exe"
224   File "${AFS_SERVER_BUILDDIR}\pts.exe"
225   File "${AFS_SERVER_BUILDDIR}\bos.exe"
226   File "${AFS_SERVER_BUILDDIR}\kas.exe"
227   File "${AFS_SERVER_BUILDDIR}\vos.exe"
228   File "${AFS_SERVER_BUILDDIR}\udebug.exe"
229   File "${AFS_DESTDIR}\bin\translate_et.exe"
230   File "${AFS_DESTDIR}\etc\rxdebug.exe"
231   File "${AFS_DESTDIR}\etc\backup.exe"
232   
233   
234   ; Client_headers
235    SetOutPath "$INSTDIR\Client\Program\Include"
236    File "${AFS_BUILD_INCDIR}\lock.h"
237    File "${AFS_BUILD_INCDIR}\lwp.h"
238    File "${AFS_BUILD_INCDIR}\preempt.h"
239    File "${AFS_BUILD_INCDIR}\timer.h"
240    File "${AFS_BUILD_INCDIR}\des.h"
241    File "${AFS_BUILD_INCDIR}\des_conf.h"
242    File "${AFS_BUILD_INCDIR}\mit-cpyright.h"
243    ;File "${AFS_BUILD_INCDIR}\des-odd.h"
244    File "${AFS_BUILD_INCDIR}\crypt.h"
245    File "${AFS_BUILD_INCDIR}\pthread.h"
246    File "${AFS_BUILD_INCDIR}\dbrpc.h"
247    File "${AFS_BUILD_INCDIR}\basic.h"
248    File "${AFS_BUILD_INCDIR}\osidebug.h"
249    File "${AFS_BUILD_INCDIR}\osiltype.h"
250    File "${AFS_BUILD_INCDIR}\osistatl.h"
251    File "${AFS_BUILD_INCDIR}\trylock.h"
252    File "${AFS_BUILD_INCDIR}\main.h"
253    File "${AFS_BUILD_INCDIR}\osibasel.h"
254    File "${AFS_BUILD_INCDIR}\osifd.h"
255    File "${AFS_BUILD_INCDIR}\osiqueue.h"
256    File "${AFS_BUILD_INCDIR}\osiutils.h"
257    File "${AFS_BUILD_INCDIR}\osi.h"
258    File "${AFS_BUILD_INCDIR}\osidb.h"
259    File "${AFS_BUILD_INCDIR}\osilog.h"
260    File "${AFS_BUILD_INCDIR}\osisleep.h"
261    File "${AFS_BUILD_INCDIR}\perf.h"
262    File "${AFS_BUILD_INCDIR}\ubik.h"
263    File "${AFS_BUILD_INCDIR}\ubik_int.h"
264    
265    
266    
267    SetOutPath "$INSTDIR\Client\Program\Include\afs"
268    File "${AFS_BUILD_INCDIR}\afs\afs_args.h"
269    File "${AFS_BUILD_INCDIR}\afs\debug.h"
270    File "${AFS_BUILD_INCDIR}\afs\param.h"
271    File "${AFS_BUILD_INCDIR}\afs\afs_sysnames.h"
272    ;File "${AFS_BUILD_INCDIR}\afs\permit_xprt.h"
273    File "${AFS_BUILD_INCDIR}\afs\stds.h"
274    File "${AFS_BUILD_INCDIR}\afs\icl.h"
275    File "${AFS_BUILD_INCDIR}\afs\procmgmt.h"
276    File "${AFS_BUILD_INCDIR}\afs\afsutil.h"
277    File "${AFS_BUILD_INCDIR}\afs\assert.h"
278    File "${AFS_BUILD_INCDIR}\afs\dirent.h"
279    File "${AFS_BUILD_INCDIR}\afs\errors.h"
280    File "${AFS_BUILD_INCDIR}\afs\itc.h"
281    File "${AFS_BUILD_INCDIR}\afs\vice.h"
282    File "${AFS_BUILD_INCDIR}\afs\pthread_glock.h"
283    File "${AFS_BUILD_INCDIR}\afs\errmap_nt.h"
284    File "${AFS_BUILD_INCDIR}\afs\dirpath.h"
285    File "${AFS_BUILD_INCDIR}\afs\ktime.h"
286    File "${AFS_BUILD_INCDIR}\afs\fileutil.h"
287    File "${AFS_BUILD_INCDIR}\afs\secutil_nt.h"
288    File "${AFS_BUILD_INCDIR}\afs\com_err.h"
289    File "${AFS_BUILD_INCDIR}\afs\error_table.h"
290    ;File "${AFS_BUILD_INCDIR}\afs\mit_sipb-cr.h"
291    File "${AFS_BUILD_INCDIR}\afs\cmd.h"
292    File "${AFS_BUILD_INCDIR}\afs\rxgen_consts.h"
293    File "${AFS_BUILD_INCDIR}\afs\afsint.h"
294    File "${AFS_BUILD_INCDIR}\afs\afscbint.h"
295    File "${AFS_BUILD_INCDIR}\afs\audit.h"
296    File "${AFS_BUILD_INCDIR}\afs\acl.h"
297    File "${AFS_BUILD_INCDIR}\afs\prs_fs.h"
298    File "${AFS_BUILD_INCDIR}\afs\afsd.h"
299    File "${AFS_BUILD_INCDIR}\afs\cm.h"
300    File "${AFS_BUILD_INCDIR}\afs\cm_buf.h"
301    File "${AFS_BUILD_INCDIR}\afs\cm_cell.h"
302    File "${AFS_BUILD_INCDIR}\afs\cm_config.h"
303    File "${AFS_BUILD_INCDIR}\afs\cm_conn.h"
304    File "${AFS_BUILD_INCDIR}\afs\cm_ioctl.h"
305    File "${AFS_BUILD_INCDIR}\afs\cm_scache.h"
306    File "${AFS_BUILD_INCDIR}\afs\cm_server.h"
307    File "${AFS_BUILD_INCDIR}\afs\cm_user.h"
308    File "${AFS_BUILD_INCDIR}\afs\cm_utils.h"
309    File "${AFS_BUILD_INCDIR}\afs\fs_utils.h"
310    File "${AFS_BUILD_INCDIR}\afs\krb.h"
311    File "${AFS_BUILD_INCDIR}\afs\krb_prot.h"
312    File "${AFS_BUILD_INCDIR}\afs\smb.h"
313    File "${AFS_BUILD_INCDIR}\afs\smb3.h"
314    File "${AFS_BUILD_INCDIR}\afs\smb_iocons.h"
315    File "${AFS_BUILD_INCDIR}\afs\smb_ioctl.h"
316    File "${AFS_BUILD_INCDIR}\afs\afsrpc.h"
317    File "${AFS_BUILD_INCDIR}\afs\afssyscalls.h"
318    File "${AFS_BUILD_INCDIR}\afs\pioctl_nt.h"
319    File "${AFS_BUILD_INCDIR}\afs\auth.h"
320    File "${AFS_BUILD_INCDIR}\afs\cellconfig.h"
321    File "${AFS_BUILD_INCDIR}\afs\keys.h"
322    File "${AFS_BUILD_INCDIR}\afs\ptserver.h"
323    File "${AFS_BUILD_INCDIR}\afs\ptint.h"
324    File "${AFS_BUILD_INCDIR}\afs\pterror.h"
325    File "${AFS_BUILD_INCDIR}\afs\ptint.h"
326    File "${AFS_BUILD_INCDIR}\afs\pterror.h"
327    File "${AFS_BUILD_INCDIR}\afs\ptclient.h"
328    File "${AFS_BUILD_INCDIR}\afs\prserver.h"
329    File "${AFS_BUILD_INCDIR}\afs\print.h"
330    File "${AFS_BUILD_INCDIR}\afs\prerror.h"
331    File "${AFS_BUILD_INCDIR}\afs\prclient.h"
332    File "${AFS_BUILD_INCDIR}\afs\kautils.h"
333    File "${AFS_BUILD_INCDIR}\afs\kauth.h"
334    File "${AFS_BUILD_INCDIR}\afs\kaport.h"
335    File "${AFS_BUILD_INCDIR}\afs\vl_opcodes.h"
336    File "${AFS_BUILD_INCDIR}\afs\vlserver.h"
337    File "${AFS_BUILD_INCDIR}\afs\vldbint.h"
338    File "${AFS_BUILD_INCDIR}\afs\usd.h"
339    File "${AFS_BUILD_INCDIR}\afs\bubasics.h"
340    File "${AFS_BUILD_INCDIR}\afs\butc.h"
341    File "${AFS_BUILD_INCDIR}\afs\bumon.h"
342    File "${AFS_BUILD_INCDIR}\afs\butm.h"
343    File "${AFS_BUILD_INCDIR}\afs\tcdata.h"
344    File "${AFS_BUILD_INCDIR}\afs\budb.h"
345    ;File "${AFS_BUILD_INCDIR}\afs\budb_errors.h"
346    File "${AFS_BUILD_INCDIR}\afs\budb_client.h"
347    File "${AFS_BUILD_INCDIR}\afs\dir.h"
348    File "${AFS_BUILD_INCDIR}\afs\fssync.h"
349    File "${AFS_BUILD_INCDIR}\afs\ihandle.h"
350    File "${AFS_BUILD_INCDIR}\afs\nfs.h"
351    File "${AFS_BUILD_INCDIR}\afs\ntops.h"
352    File "${AFS_BUILD_INCDIR}\afs\partition.h"
353    File "${AFS_BUILD_INCDIR}\afs\viceinode.h"
354    File "${AFS_BUILD_INCDIR}\afs\vnode.h"
355    File "${AFS_BUILD_INCDIR}\afs\volume.h"
356    File "${AFS_BUILD_INCDIR}\afs\voldefs.h"
357    File "${AFS_BUILD_INCDIR}\afs\volser.h"
358    File "${AFS_BUILD_INCDIR}\afs\volint.h"
359    File "${AFS_BUILD_INCDIR}\afs\fs_stats.h"
360    File "${AFS_BUILD_INCDIR}\afs\bosint.h"
361    File "${AFS_BUILD_INCDIR}\afs\bnode.h"
362    
363    
364    SetOutPath "$INSTDIR\Client\Program\Include\rx"
365    File "${AFS_BUILD_INCDIR}\rx\rx.h"
366    File "${AFS_BUILD_INCDIR}\rx\rx_packet.h"
367    File "${AFS_BUILD_INCDIR}\rx\rx_user.h"
368    File "${AFS_BUILD_INCDIR}\rx\rx_event.h"
369    File "${AFS_BUILD_INCDIR}\rx\rx_queue.h"
370    File "${AFS_BUILD_INCDIR}\rx\rx_globals.h"
371    File "${AFS_BUILD_INCDIR}\rx\rx_clock.h"
372    File "${AFS_BUILD_INCDIR}\rx\rx_misc.h"
373    File "${AFS_BUILD_INCDIR}\rx\rx_multi.h"
374    File "${AFS_BUILD_INCDIR}\rx\rx_null.h"
375    File "${AFS_BUILD_INCDIR}\rx\rx_lwp.h"
376    File "${AFS_BUILD_INCDIR}\rx\rx_pthread.h"
377    File "${AFS_BUILD_INCDIR}\rx\rx_xmit_nt.h"
378    File "${AFS_BUILD_INCDIR}\rx\xdr.h"
379    File "${AFS_BUILD_INCDIR}\rx\rxkad.h"
380    
381    
382
383    ; Client Sample
384    SetOutPath "$INSTDIR\Client\Program\Sample"
385    File "..\..\afsd\sample\token.c"
386    
387    ; Client Common
388    SetOutPath "$INSTDIR\Common"
389    File "${AFS_CLIENT_BUILDDIR}\afs_config.exe"
390    File "${AFS_CLIENT_LIBDIR}\afsrpc.dll"
391    File "${AFS_CLIENT_LIBDIR}\afsauthent.dll"
392    File "${AFS_CLIENT_LIBDIR}\afspthread.dll"
393    File "${AFS_SERVER_BUILDDIR}\afsprocmgmt.dll"
394    File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib.dll"
395    File "${AFS_SERVER_BUILDDIR}\afsadminutil.dll"
396    File "${AFS_SERVER_BUILDDIR}\afsclientadmin.dll"
397    File "${AFS_SERVER_BUILDDIR}\afsvosadmin.dll"
398    
399    ; Do SYSTEM32 DIR
400    SetOutPath "$SYSDIR"
401    File "${AFS_CLIENT_BUILDDIR}\afs_cpa.cpl"
402    ;File "${SDK_DIR}\REDIST\msvcrt.dll"
403    ;File "${SDK_DIR}\REDIST\mfc42.dll"
404    
405   ; Do WINDOWSDIR components
406   ; Get AFS CellServDB file
407   Call afs.GetCellServDB
408   
409   ReadINIStr $R0 $0 "Field 2" "State"
410   StrCmp $R0 "1" UsePkg DontUsePkg
411  UsePkg:
412    SetOutPath "$WINDIR"
413    File "afsdcell.ini"
414 DontUsePkg:
415    ReadINIStr $R0 $0 "Field 6" "State"
416    StrCmp $R0 "1" UseFile DontUseFile
417 UseFile:
418    ReadINIStr $R0 $0 "Field 7" "State"
419    CopyFiles $R0 "$WINDIR\afsdcell.ini"
420 DontUseFile:
421    
422   ;Store install folder
423   WriteRegStr HKCU "${AFS_REGKEY_ROOT}\Client" "" $INSTDIR
424   Call AFSCommon.Install
425   
426   
427   ; Write registry entries
428   WriteRegStr HKCR "*\shellex\ContextMenuHandlers\AFS Client Shell Extension" "(Default)" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
429   WriteRegStr HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" "(Default)" "AFS Client Shell Extension"
430   WriteRegStr HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32" "(Default)" "$INSTDIR\Client\Program\afs_shl_ext.dll"
431   WriteRegStr HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32" "ThreadingModel" "Apartment"
432   WriteRegStr HKCR "FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension" "(Default)" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
433   
434   ; AFS Reg entries
435   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "VersionString" ${MUI_VERSION}
436   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MajorVersion" ${MUI_MAJORVERSION}
437   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MinorVersion" ${MUI_MINORVERSION}
438   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PatchLevel" ${MUI_PATCHLEVEL}
439   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "VersionString" ${MUI_VERSION}
440   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "MajorVersion" ${MUI_MAJORVERSION}
441   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "MinorVersion" ${MUI_MINORVERSION}
442   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${MUI_VERSION}" "PatchLevel" ${MUI_PATCHLEVEL}
443
444   ; Daemon entries
445   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\OpenAFSDaemon" "(Default)" ""
446   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\OpenAFSDaemon\NetworkProvider" "AuthentProviderPath" "$INSTDIR\Client\Program\afslogon.dll"
447   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\OpenAFSDaemon\NetworkProvider" "Class" 2
448   WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\OpenAFSDaemon\NetworkProvider" "LogonOptions" 0
449   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\OpenAFSDaemon\NetworkProvider" "LogonScript" "$INSTDIR\Client\Program\afscreds.exe -:%s -x"
450   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\OpenAFSDaemon\NetworkProvider" "Name" "OpenAFSDaemon"
451   WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\OpenAFSDaemon\NetworkProvider" "ProviderPath" "$INSTDIR\Client\Program\afslogon.dll"
452   
453   ;Write start menu entries
454   CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
455   CreateShortCut "$SMPROGRAMS\OpenAFS\Client\Authentication.lnk" "$INSTDIR\Client\Programs\afscreds.exe"
456   CreateShortCut "$SMSTARTUP\AFS Credentials.lnk" "$INSTDIR\Client\Programs\afscreds.exe"
457
458   ; Create the AFS service
459   GetTempFileName $R0
460   File /oname=$R0 "${AFS_WININSTALL_DIR}\Service.exe"
461   nsExec::Exec "$R0 OpenAFSDaemon $INSTDIR\Client\Porgram\afsd_service.exe ""OpenAFS Client Service"""
462   Delete $R0
463   
464   WriteUninstaller "$INSTDIR\Uninstall.exe"
465   
466 SectionEnd
467
468 ;------------------------
469 ; OpenAFS SERVER  
470 Section "AFS Server" SecServer
471
472    SetOutPath "$INSTDIR\Server\usr\afs\bin"  
473   File "${NSISDIR}\Contrib\UIs\modern.exe"
474   
475   ;Store install folder
476   WriteRegStr HKCU "${AFS_REGKEY_ROOT}\Server" "" $INSTDIR
477   
478   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "VersionString" ${MUI_VERSION}
479   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${MUI_VERSION}" "VersionString" ${MUI_VERSION}
480
481   WriteUninstaller "$INSTDIR\Uninstall.exe"
482
483 SectionEnd
484
485
486 ;----------------------------
487 ; OpenAFS Control Center
488 Section "AFS Control Center" SecControl
489
490    SetOutPath "$INSTDIR\Control"
491   File "${NSISDIR}\Contrib\UIs\modern.exe"
492    
493   ;Store install folder
494   WriteRegStr HKCU "${AFS_REGKEY_ROOT}\Control" "" $INSTDIR
495   
496   WriteUninstaller "$INSTDIR\Uninstall.exe"
497
498 SectionEnd   
499
500
501 ;----------------------------
502 ; OpenAFS Supplemental Documentation
503 Section "Supplemental Documentation" SecDocs
504
505    StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
506    StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman
507    StrCmp $LANGUAGE ${LANG_SPANISH} DoSpanish
508    StrCmp $LANGUAGE ${LANG_JAPANESE} DoJapanese
509    ;StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean
510    StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} DoPortugueseBR
511    StrCmp $LANGUAGE ${LANG_SIMPCHINESE} DoSimpChinese
512    StrCmp $LANGUAGE ${LANG_TRADCHINESE} DoTradChinese
513    
514    
515 DoEnglish:
516    SetOutPath "$INSTDIR\Documentation"
517    File "..\..\doc\install\Documentation\en_US\README.TXT"
518    SetOutPath "$INSTDIR\Documentation\html"
519    File "..\..\doc\install\Documentation\en_US\html\*"
520    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
521    File "..\..\doc\install\Documentation\en_US\html\CmdRef\*"
522    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
523    File "..\..\doc\install\Documentation\en_US\html\InstallGd\*"
524    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
525    File "..\..\doc\install\Documentation\en_US\html\ReleaseNotes\*"
526    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
527    File "..\..\doc\install\Documentation\en_US\html\SysAdminGd\*"
528    goto DoneLanguage
529    
530 DoGerman:
531    SetOutPath "$INSTDIR\Documentation"
532    File "..\..\doc\install\Documentation\de_DE\README.TXT"
533    SetOutPath "$INSTDIR\Documentation\html"
534    File "..\..\doc\install\Documentation\de_DE\html\*"
535    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
536    ;File "..\..\doc\install\Documentation\de_DE\html\CmdRef\*"
537    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
538    File "..\..\doc\install\Documentation\de_DE\html\InstallGd\*"
539    ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
540    ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\*"
541    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
542    ;File "..\..\doc\install\Documentation\de_DE\html\SysAdminGd\*"
543    goto DoneLanguage
544    
545 DoSpanish:
546    SetOutPath "$INSTDIR\Documentation"
547    File "..\..\doc\install\Documentation\es_ES\README.TXT"
548    SetOutPath "$INSTDIR\Documentation\html"
549    File "..\..\doc\install\Documentation\es_ES\html\*"
550    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
551    ;File "..\..\doc\install\Documentation\es_ES\html\CmdRef\*"
552    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
553    File "..\..\doc\install\Documentation\es_ES\html\InstallGd\*"
554    ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
555    ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\*"
556    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
557    ;File "..\..\doc\install\Documentation\es_ES\html\SysAdminGd\*"
558    goto DoneLanguage
559
560 DoJapanese:
561    SetOutPath "$INSTDIR\Documentation"
562    File "..\..\doc\install\Documentation\ja_JP\README.TXT"
563    SetOutPath "$INSTDIR\Documentation\html"
564    File "..\..\doc\install\Documentation\ja_JP\html\*"
565    SetOutPath "$INSTDIR\Documentation\html\CmdRef"
566    File "..\..\doc\install\Documentation\ja_JP\html\CmdRef\*"
567    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
568    File "..\..\doc\install\Documentation\ja_JP\html\InstallGd\*"
569    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
570    File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\*"
571    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
572    File "..\..\doc\install\Documentation\ja_JP\html\SysAdminGd\*"
573    goto DoneLanguage
574    
575 DoKorean:
576    SetOutPath "$INSTDIR\Documentation"
577    File "..\..\doc\install\Documentation\ko_KR\README.TXT"
578    SetOutPath "$INSTDIR\Documentation\html"
579    File "..\..\doc\install\Documentation\ko_KR\html\*"
580    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
581    ;File "..\..\doc\install\Documentation\ko_KR\html\CmdRef\*"
582    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
583    File "..\..\doc\install\Documentation\ko_KR\html\InstallGd\*"
584    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
585    File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\*"
586    SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
587    File "..\..\doc\install\Documentation\ko_KR\html\SysAdminGd\*"
588    goto DoneLanguage
589    
590 DoPortugueseBR:
591    SetOutPath "$INSTDIR\Documentation"
592    File "..\..\doc\install\Documentation\pt_BR\README.TXT"
593    SetOutPath "$INSTDIR\Documentation\html"
594    File "..\..\doc\install\Documentation\pt_BR\html\*"
595    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
596    ;File "..\..\doc\install\Documentation\pt_BR\html\CmdRef\*"
597    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
598    File "..\..\doc\install\Documentation\pt_BR\html\InstallGd\*"
599    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
600    File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\*"
601    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
602    ;File "..\..\doc\install\Documentation\pt_BR\html\SysAdminGd\*"
603    goto DoneLanguage
604
605 DoSimpChinese:
606    SetOutPath "$INSTDIR\Documentation"
607    File "..\..\doc\install\Documentation\zh_CN\README.TXT"
608    SetOutPath "$INSTDIR\Documentation\html"
609    File "..\..\doc\install\Documentation\zh_CN\html\*"
610    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
611    ;File "..\..\doc\install\Documentation\zh_CN\html\CmdRef\*"
612    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
613    File "..\..\doc\install\Documentation\zh_CN\html\InstallGd\*"
614    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
615    File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\*"
616    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
617    ;File "..\..\doc\install\Documentation\zh_CN\html\SysAdminGd\*"
618    goto DoneLanguage
619    
620 DoTradChinese:
621    SetOutPath "$INSTDIR\Documentation"
622    File "..\..\doc\install\Documentation\zh_TW\README.TXT"
623    SetOutPath "$INSTDIR\Documentation\html"
624    File "..\..\doc\install\Documentation\zh_TW\html\*"
625    ;SetOutPath "$INSTDIR\Documentation\html\CmdRef"
626    ;File "..\..\doc\install\Documentation\zh_TW\html\CmdRef\*"
627    SetOutPath "$INSTDIR\Documentation\html\InstallGd"
628    File "..\..\doc\install\Documentation\zh_TW\html\InstallGd\*"
629    SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes"
630    File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\*"
631    ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd"
632    ;File "..\..\doc\install\Documentation\zh_TW\html\SysAdminGd\*"
633    goto DoneLanguage
634    
635    
636 DoneLanguage:
637    ;Store install folder
638   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation" "" $INSTDIR
639   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "VersionString" ${MUI_VERSION}
640   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MajorVersion" ${MUI_MAJORVERSION}
641   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MinorVersion" ${MUI_MINORVERSION}
642   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "PatchLevel" ${MUI_PATCHLEVEL}
643   WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${MUI_VERSION}" "VersionString" ${MUI_VERSION}
644   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${MUI_VERSION}" "MajorVersion" ${MUI_MAJORVERSION}
645   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${MUI_VERSION}" "MinorVersion" ${MUI_MINORVERSION}
646   WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${MUI_VERSION}" "PatchLevel" ${MUI_PATCHLEVEL}
647
648   ; Write start menu shortcut
649   SetOutPath "$SMPROGRAMS\OpenAFS"
650   CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation.lnk" "$INSTDIR\Documentation\html\index.htm"
651   
652   
653   WriteUninstaller "$INSTDIR\Uninstall.exe"
654   CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe"
655 SectionEnd  
656   
657 ;Display the Finish header
658 ;Insert this macro after the sections if you are not using a finish page
659 ;!insertmacro MUI_SECTIONS_FINISHHEADER
660
661 ;--------------------------------
662 ;Installer Functions
663
664 Function .onInit
665
666   !insertmacro MUI_LANGDLL_DISPLAY
667   
668   ; Set the default install options
669         Push $0
670
671    Call ShouldClientInstall
672    Pop $R2
673    
674    StrCmp $R2 "0" NoClient
675    StrCmp $R2 "2" UpgradeClient
676    
677         StrCpy $1 ${secClient} ; Gotta remember which section we are at now...
678         SectionGetFlags ${secClient} $0
679         IntOp $0 $0 | ${SF_SELECTED}
680         SectionSetFlags ${secClient} $0
681         # !insertmacro SelectSection ${secClient}
682    goto skipClient
683 NoClient:
684         StrCpy $1 ${secClient} ; Gotta remember which section we are at now...
685         SectionGetFlags ${secClient} $0
686         IntOp $0 $0 | ${SECTION_OFF}
687         SectionSetFlags ${secClient} $0
688    goto skipClient
689 UpgradeClient:
690         SectionGetFlags ${secClient} $0
691         IntOp $0 $0 | ${SF_SELECTED}
692         SectionSetFlags ${secClient} $0
693    SectionSetText ${secClient} $(UPGRADE_CLIENT)
694    goto skipClient
695
696    
697 skipClient:   
698    
699    
700    Call IsServerInstalled
701    Pop $R2
702    StrCmp $R2 "0" NoServer
703    
704         SectionGetFlags ${secServer} $0
705         IntOp $0 $0 & ${SF_SELECTED}
706         SectionSetFlags ${secServer} $0
707         # !insertmacro UnselectSection ${secServer}
708    goto skipServer
709
710 NoServer:
711         SectionGetFlags ${secServer} $0
712         IntOp $0 $0 & ${SECTION_OFF}
713         SectionSetFlags ${secServer} $0
714         # !insertmacro UnselectSection ${secServer}
715    
716 skipServer:   
717         SectionGetFlags ${secControl} $0
718         IntOp $0 $0 & ${SECTION_OFF}
719         SectionSetFlags ${secControl} $0
720         # !insertmacro UnselectSection ${secControl}
721
722         SectionGetFlags ${secDocs} $0
723         IntOp $0 $0 | ${SF_SELECTED}
724         SectionSetFlags ${secDocs} $0
725         # !insertmacro UnselectSection ${secDocs}
726
727         Pop $0
728   
729   
730   
731   GetTempFilename $0
732   File /oname=$0 CellServPage.ini
733    
734   
735 FunctionEnd
736
737
738
739
740
741 ;--------------------------------
742 ; These are our cleanup functions
743 Function .onInstFailed
744 Delete $0
745
746 FunctionEnd
747
748 Function .onInstSuccess
749 Delete $0
750
751 FunctionEnd
752
753
754 ;--------------------------------
755 ;Descriptions
756
757 !insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
758   !insertmacro MUI_DESCRIPTION_TEXT ${SecServer} $(DESC_SecServer)
759   !insertmacro MUI_DESCRIPTION_TEXT ${SecClient} $(DESC_SecClient)
760   !insertmacro MUI_DESCRIPTION_TEXT ${SecControl} $(DESC_SecControl)
761   !insertmacro MUI_DESCRIPTION_TEXT ${SecDocs} $(DESC_SecDocs)
762 !insertmacro MUI_FUNCTIONS_DESCRIPTION_END
763  
764 ;--------------------------------
765 ;Uninstaller Section
766
767 Section "Uninstall"
768   
769   Delete "$INSTDIR\modern.exe"
770   Delete "$INSTDIR\Client\modern.exe"
771   Delete "$INSTDIR\Control_Center\modern.exe"
772   Delete "$INSTDIR\Documentation\README.TXT"
773   Delete "$INSTDIR\Documentation\html\*"
774   Delete "$INSTDIR\Documentation\html\CmdRef\*"
775   Delete "$INSTDIR\Documentation\html\InstallGd\*"
776   Delete "$INSTDIR\Documentation\html\ReleaseNotes\*"
777   Delete "$INSTDIR\Documentation\html\SysAdminGd\*"
778
779
780   Delete "$WINDIR\afsdcell.ini"
781   
782   Delete "$INSTDIR\Uninstall.exe"
783
784   RMDir "$INSTDIR\Client"
785   RMDir "$INSTDIR\Server"
786   
787   RMDir "$INSTDIR\Documentation\html\CmdRef"
788   RMDir "$INSTDIR\Documentation\html\InstallGd"
789   RMDir "$INSTDIR\Documentation\html\ReleaseNotes"
790   RMDir "$INSTDIR\Documentation\html\SysAdminGd"
791   RMDIr "$INSTDIR\Documentation\html"
792   
793   RMDir "$INSTDIR\Documentation"
794   ; Delete DOC short cut
795   Delete "$SMPROGRAMS\OpenAFS\Documentation.lnk"
796
797   RMDir "$INSTDIR\Control Center"
798   RMDir "$INSTDIR"
799
800   Delete "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk"
801   RMDir "$SMPROGRAMS\OpenAFS"
802   
803   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client"
804   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation"
805   DeleteRegKey /ifempty HKLM "${AFS_REGKEY_ROOT}"
806   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS"
807
808   ;Display the Finish header
809   !insertmacro MUI_UNFINISHHEADER
810
811 SectionEnd
812
813 ;--------------------------------
814 ;Uninstaller Functions
815
816 Function un.onInit
817
818   ;Get language from registry
819   ReadRegStr $LANGUAGE HKCU "Software\OpenAFS\AFS" "Installer Language"
820   
821 FunctionEnd
822
823
824 ;------------------------------
825 ; Get the CellServDB file from the Internet
826
827 Function afs.GetCellServDB
828
829 ;Check if we should download CellServDB
830 ReadINIStr $R0 $0 "Field 4" "State"
831 StrCmp $R0 "0" done
832
833    ReadINIStr $R0 $0 "Field 5" "State"
834    NSISdl::download $R0 "$WINDIR\afsdcell.ini"
835    Pop $R0 ;Get the return value
836    StrCmp $R0 "success" +2
837       MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0"
838
839 done:
840
841 FunctionEnd
842
843
844
845 ;-------------------------------
846 ;Do the page to get the CellServDB
847
848 Function AFSPageGetCellServDB
849   ; Set the install options here
850   
851 startOver:
852   WriteINIStr $0 "Field 2" "Flags" "DISABLED"
853   WriteINIStr $0 "Field 3" "State" "1"
854   
855   InstallOptions::dialog $0
856   Pop $R1
857   StrCmp $R1 "cancel" exit
858   StrCmp $R1 "back" done
859   StrCmp $R1 "success" done
860 exit: Quit
861 done:
862
863    ; Check that if a file is set, a filename is entered...
864    ReadINIStr $R0 $0 "Field 6" "State"
865    StrCmp $R0 "1" CheckFileName Skip
866 CheckFileName:
867    ReadINIStr $R0 $0 "Field 7" "State"
868    IfFileExists $R0 Skip
869
870    MessageBox MB_OK|MB_ICONSTOP $(CellError)
871    WriteINIStr $0 "Field 6" "State" "0"
872    goto startOver
873    
874    Skip:
875    
876 FunctionEnd
877
878 ;-------------
879 ; Common install routines for each module
880 Function AFSCommon.Install
881
882 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayName" "OpenAFS for Windows"
883 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "UninstallString" "$INSTDIR\uninstall.exe"
884 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayVersion" "${MUI_VERSION}"
885 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "URLInfoAbout" "http://www.openafs.org/"
886
887 FunctionEnd
888
889
890 ; Check if install should be silent
891 Function IsSilent
892   Push $0
893   Push $CMDLINE
894   Push "/S"
895   Call StrStr
896   Pop $0
897   StrCpy $0 $0 3
898   StrCmp $0 "/S" silent
899   StrCmp $0 "/S " silent
900     StrCpy $0 0
901     Goto notsilent
902   silent: StrCpy $0 1
903   notsilent: Exch $0
904 FunctionEnd
905
906
907 ; StrStr function
908 Function StrStr
909   Exch $R1 ; st=haystack,old$R1, $R1=needle
910   Exch    ; st=old$R1,haystack
911   Exch $R2 ; st=old$R1,old$R2, $R2=haystack
912   Push $R3
913   Push $R4
914   Push $R5
915   StrLen $R3 $R1
916   StrCpy $R4 0
917   ; $R1=needle
918   ; $R2=haystack
919   ; $R3=len(needle)
920   ; $R4=cnt
921   ; $R5=tmp
922   loop:
923     StrCpy $R5 $R2 $R3 $R4
924     StrCmp $R5 $R1 done
925     StrCmp $R5 "" done
926     IntOp $R4 $R4 + 1
927     Goto loop
928   done:
929   StrCpy $R1 $R2 "" $R4
930   Pop $R5
931   Pop $R4
932   Pop $R3
933   Pop $R2
934   Exch $R1
935 FunctionEnd
936
937 ;-------------------
938 ; Get the currently installed version and place it on the stack
939 ; Modifies: Nothing
940 Function GetInstalledVersion
941    Push $R0
942    Push $R1
943    Push $R4
944    
945    ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "VersionString"
946    StrCmp $R0 "" NotTransarc
947    
948    
949 NotTransarc:
950    ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "VersionString"
951    StrCmp $R0 "" done
952    
953 done:
954    Pop $R4
955    Pop $R1
956    Exch $R0
957 FunctionEnd
958
959
960 ;-------------------------------
961 ; Check if the client should be checked for default install
962 Function ShouldClientInstall
963    Push $R0
964    StrCpy $R2 "Client"
965    Call GetInstalledVersion
966    Pop $R0
967    
968    StrCmp $R0 "" NotInstalled
969    
970    StrCpy $R0 "0"
971    Exch $R0
972    goto end
973    
974 NotInstalled:
975    StrCpy $R0 "1"
976    Exch $R0
977 end:   
978 FunctionEnd
979
980
981 ; See if AFS Client is installed
982 Function IsServerInstalled
983    Push $R0
984    StrCpy $R2 "AFS Server"
985    Call GetInstalledVersion
986    Pop $R0
987    
988    StrCmp $R0 "" NotInstalled
989    
990    StrCpy $R0 "1"
991    Exch $R0
992    goto end
993    
994 NotInstalled:
995    StrCpy $R0 "0"
996    Exch $R0
997 end:   
998 FunctionEnd
999
1000
1001 ; See if AFS Server is installed
1002 Function IsClientInstalled
1003    Push $R0
1004    StrCpy $R2 "AFS Client"
1005    Call GetInstalledVersion
1006    Pop $R0
1007    
1008    StrCmp $R0 "" NotInstalled
1009    
1010    StrCpy $R0 "1"
1011    Exch $R0
1012    goto end
1013    
1014 NotInstalled:
1015    StrCpy $R0 "0"
1016    Exch $R0
1017 end:   
1018 FunctionEnd
1019
1020
1021
1022 ; See if AFS Documentation is installed
1023 Function IsDocumentationInstalled
1024    Push $R0
1025    StrCpy $R2 "AFS Supplemental Documentation"
1026    Call GetInstalledVersion
1027    Pop $R0
1028    
1029    StrCmp $R0 "" NotInstalled
1030    
1031    StrCpy $R0 "1"
1032    Exch $R0
1033    goto end
1034    
1035 NotInstalled:
1036    StrCpy $R0 "0"
1037    Exch $R0
1038 end:   
1039 FunctionEnd
1040
1041
1042 ; See if COntrol Center is installed
1043 Function IsControlInstalled
1044    Push $R0
1045    StrCpy $R2 "Control_Center"
1046    Call GetInstalledVersion
1047    Pop $R0
1048    
1049    StrCmp $R0 "" NotInstalled
1050    
1051    StrCpy $R0 "1"
1052    Exch $R0
1053    goto end
1054    
1055 NotInstalled:
1056    StrCpy $R0 "0"
1057    Exch $R0
1058 end:   
1059 FunctionEnd
1060
1061
1062 ; GetParameters
1063 ; input, none
1064 ; output, top of stack (replaces, with e.g. whatever)
1065 ; modifies no other variables.
1066
1067 Function GetParameters
1068   Push $R0
1069   Push $R1
1070   Push $R2
1071   StrCpy $R0 $CMDLINE 1
1072   StrCpy $R1 '"'
1073   StrCpy $R2 1
1074   StrCmp $R0 '"' loop
1075     StrCpy $R1 ' ' ; we're scanning for a space instead of a quote
1076   loop:
1077     StrCpy $R0 $CMDLINE 1 $R2
1078     StrCmp $R0 $R1 loop2
1079     StrCmp $R0 "" loop2
1080     IntOp $R2 $R2 + 1
1081     Goto loop
1082   loop2:
1083     IntOp $R2 $R2 + 1
1084     StrCpy $R0 $CMDLINE 1 $R2
1085     StrCmp $R0 " " loop2
1086   StrCpy $R0 $CMDLINE "" $R2
1087   Pop $R2
1088   Pop $R1
1089   Exch $R0
1090 FunctionEnd
1091
1092
1093 ;Check to see if any AFS component is installed
1094 Function IsAnyAFSInstalled
1095
1096 FunctionEnd
1097
1098
1099 ;Install English Language Files
1100 Function AFSLangFiles
1101    StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
1102 ;   StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman
1103 ;   StrCmp $LANGUAGE ${LANG_SPANISH} DoSpanish
1104 ;   StrCmp $LANGUAGE ${LANG_JAPANESE} DoJapanese
1105    ;StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean
1106 ;   StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} DoPortugueseBR
1107 ;   StrCmp $LANGUAGE ${LANG_SIMPCHINESE} DoSimpChinese
1108 ;   StrCmp $LANGUAGE ${LANG_TRADCHINESE} DoTradChinese
1109    
1110 DoEnglish:
1111    SetOutPath "$INSTDIR\Common"
1112    File "${AFS_SERVER_BUILDDIR}\afseventmsg_1033.dll"
1113    ;File "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1033.dll"
1114    File "${AFS_SERVER_BUILDDIR}\afsserver_1033.dll"
1115    
1116
1117 FunctionEnd