1 ////////////////////////////////////////////////////////////////////////////////
3 // Copyright (C) 1998 OpenAFS
4 // All rights reserved.
7 // File Name: Setup.rul
9 // Description: InstallShield script
11 ////////////////////////////////////////////////////////////////////////////////
14 // Include header files
20 ////////////////////// string defines ////////////////////////////
22 // If the user places a file with this name in the same directory as
23 // the setup files, only the client component will be available for
24 // install. The contents of this file are not used.
25 #define ALLOW_ONLY_CLIENT_FLAG_FILENAME "setup.co"
28 #define RELEASE_TYPE_GA "GA"
29 #define RELEASE_TYPE_BETA "Beta"
31 // Client logon dll names
32 #define FULL_CLIENT_LOGON_DLL "Client\\PROGRAM\\afslogon.dll"
33 #define LIGHT_CLIENT_LOGON_DLL "Client\\PROGRAM\\afslog95.dll"
35 // Uninstall log file names for each component
36 #define SERVER_UNINST_LOGFILE_NAME "Server_Uninst.isu"
37 #define CLIENT_UNINST_LOGFILE_NAME "Client_Uninst.isu"
38 #define LIGHT_CLIENT_UNINST_LOGFILE_NAME "Light_Client_Uninst.isu"
39 #define CC_UNINST_LOGFILE_NAME "CC_Uninst.isu"
40 #define DOCS_UNINST_LOGFILE_NAME "Docs_Uninst.isu"
42 // Uninstall dll names for each component
43 #define SERVER_UNINST_DLL_NAME "ServerUninst.dll"
44 #define CLIENT_UNINST_DLL_NAME "ClientUninst.dll"
45 #define CC_UNINST_DLL_NAME "CCUninst.dll"
46 #define LIGHT_CLIENT_UNINST_DLL_NAME "LightClientUninst.dll"
47 #define DOCS_UNINST_DLL_NAME "DocsUninst.dll"
49 // These are the components the user sees
50 #define CLIENT_COMP_NAME "Client"
51 #define LIGHT_CLIENT_COMP_NAME "Light_Client"
52 #define SERVER_COMP_NAME "Server"
53 #define CC_COMP_NAME "Control_Center"
55 // Light Client platform components
56 #define LIGHT95_CLIENT_COMP_NAME "Light_Client\\Win95"
57 #define LIGHT98_CLIENT_COMP_NAME "Light_Client\\Win98"
59 // This is added to autoexec.bat on Win95 systems
60 #define LIGHT95_CLIENT_PROTSEQ "AFS_RPC_PROTSEQ=ncacn_ip_tcp"
62 // Language components
63 #define LANG_COMP_NAME "Languages"
64 #define LANG_ENGLISH_COMP_NAME "Languages\\Lang_English"
65 #define LANG_SIMP_CHINESE_COMP_NAME "Languages\\Lang_Simp_Chinese"
66 #define LANG_TRAD_CHINESE_COMP_NAME "Languages\\Lang_Trad_Chinese"
67 #define LANG_KOREAN_COMP_NAME "Languages\\Lang_Korean"
68 #define LANG_JAPANESE_COMP_NAME "Languages\\Lang_Japanese"
69 #define LANG_GERMAN_COMP_NAME "Languages\\Lang_German"
70 #define LANG_SPANISH_COMP_NAME "Languages\\Lang_Spanish"
71 #define LANG_PORTUGUESE_COMP_NAME "Languages\\Lang_Portuguese"
73 // Documentation components
74 #define DOCS_COMP_NAME "Documentation"
75 #define DOCS_ENGLISH_COMP_NAME "Documentation\\English"
76 #define DOCS_JAPANESE_COMP_NAME "Documentation\\Japanese"
77 #define DOCS_KOREAN_COMP_NAME "Documentation\\Korean"
78 #define DOCS_SIMP_CHINESE_COMP_NAME "Documentation\\Simp_Chinese"
79 #define DOCS_TRAD_CHINESE_COMP_NAME "Documentation\\Trad_Chinese"
80 #define DOCS_GERMAN_COMP_NAME "Documentation\\German"
81 #define DOCS_SPANISH_COMP_NAME "Documentation\\Spanish"
82 #define DOCS_PORTUGUESE_COMP_NAME "Documentation\\Portuguese"
84 // Readme files components
85 #define README_COMP_NAME "Readme"
86 #define README_ENGLISH_COMP_NAME "Readme\\English"
87 #define README_JAPANESE_COMP_NAME "Readme\\Japanese"
88 #define README_KOREAN_COMP_NAME "Readme\\Korean"
89 #define README_SIMP_CHINESE_COMP_NAME "Readme\\Simp_Chinese"
90 #define README_TRAD_CHINESE_COMP_NAME "Readme\\Trad_Chinese"
91 #define README_GERMAN_COMP_NAME "Readme\\German"
92 #define README_SPANISH_COMP_NAME "Readme\\Spanish"
93 #define README_PORTUGUESE_COMP_NAME "Readme\\Portuguese"
96 #define LICENSE_ENGLISH_FILENAME "License\\en_US.rtf"
97 #define LICENSE_JAPANESE_FILENAME "License\\ja_JP.rtf"
98 #define LICENSE_KOREAN_FILENAME "License\\ko_KR.rtf"
99 #define LICENSE_SIMP_CHINESE_FILENAME "License\\zh_CN.rtf"
100 #define LICENSE_TRAD_CHINESE_FILENAME "License\\zh_TW.rtf"
101 #define LICENSE_GERMAN_FILENAME "License\\de_DE.rtf"
102 #define LICENSE_SPANISH_FILENAME "License\\es_ES.rtf"
103 #define LICENSE_PORTUGUESE_FILENAME "License\\pt_BR.rtf"
105 #define SETUP_UTILS_DLL_PATH "InstallUtils.dll"
107 // Some registry keys
108 #define MSUNINSTALL_KEY "\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
109 #define COMPANY_REG_KEY "Software\\TransarcCorporation\\"
110 #define CONFIG_INFO_KEY "Software\\AfsPreservedConfigInfo"
112 #define CLIENT_SERVICE_NAME "TransarcAFSDaemon"
114 // Client help file names
115 #define CLIENT_HELP_FILE_NAME "Common\\afs-nt.hlp"
116 #define LIGHT_CLIENT_HELP_FILE_NAME "Common\\afs-light.hlp"
118 #define MAX_STRING_LEN 512
121 #define ACTION_NONE 0
122 #define ACTION_INSTALL 1
123 #define ACTION_REINSTALL 2
124 #define ACTION_UPGRADE 3
125 #define ACTION_DOWNGRADE 4
127 // Documenation start menu info
128 #define DOCUMENTATION_CMD_PATH "Documentation\\Html\\index.htm"
129 #define DOCUMENTATION_ARGS ""
131 #define DOCUMENTATION_LICENSE_PATH "Documentation\\Html\\license.rtf"
133 // Application start menu info
134 #define CFG_WIZARD_CMD_PATH "Server\\usr\\afs\\bin\\afssvrcfg.exe"
135 #define CFG_WIZARD_ARGS "/wizard"
136 #define CREDS_TOOL_CMD_PATH "Client\\Program\\afscreds.exe"
137 #define CREDS_TOOL_ARGS "/show"
138 #define CLIENT_HELP_CMD_PATH "Common\\afs-nt.hlp"
139 #define CLIENT_HELP_ARGS ""
140 #define LIGHT_CLIENT_HELP_CMD_PATH "Common\\afs-light.hlp"
141 #define LIGHT_CLIENT_HELP_ARGS ""
142 #define SERVER_MANAGER_CMD_PATH "Control Center\\TaAfsServerManager.exe"
143 #define SERVER_MANAGER_ARGS ""
144 #define ACCT_MANAGER_CMD_PATH "Control Center\\TaAfsAccountManager.exe"
145 #define ACCT_MANAGER_ARGS ""
147 #define CELLSERVDB_FILENAME "afsdcell.ini"
157 //////////////////// installation declarations ///////////////////
165 string szReleaseType[32];
170 // NOTE: There is a problem with the IS registry set functionality in that if
171 // you specify to write a value under an existing key, at uninstall time
172 // not just the value will be removed, but the KEY AND ALL ITS SUBKEYS
173 // will also be removed. So the registry sets can only be used to
174 // create entries in the registry that are for values under keys that
177 // There are some values that we need to create that live under existing
178 // NT keys, so when we create them we must turn off logging. The
179 // szNoLogRegistrySets tell us which to create without logging.
183 string szCompName[64];
184 string szCompanyName[64];
185 string szProductName[128];
186 VERINFO Ver; // Version of this product
187 VERINFO iVer; // Verison of this product that is already installed
188 string szProductKey[128];
190 string szUninstDllName[64];
191 string szUninstLogfileName[64];
192 string szUninstKey[128];
193 string szAppPath[256]; // Below TARGETDIR
194 string szBinPath[256]; // Path to binaries and uninstall dll
195 BOOL bAddToPath; // TRUE if bin path should be added to path env var
196 string szUninstDisplayName[128];
197 string szRegistrySets[256]; // Comma separated list of registry sets to install
198 string szNoLogRegistrySets[256]; // Comma separated list of registry sets to install without logging
200 BOOL bInstallSucceeded;
205 // ----- DLL function prototypes -----
208 // ----- DLL prototypes -----
210 // your DLL prototypes
211 prototype int InstallUtils.InstallServerService(string);
212 prototype int InstallUtils.InstallClientService(string);
213 prototype int InstallUtils.AddToPath(string);
214 prototype int InstallUtils.AddToNetworkProviderOrder(string);
215 prototype int InstallUtils.CheckIfAdmin();
216 prototype int InstallUtils.SetSilentMode();
217 prototype int InstallUtils.WriteToInstallErrorLog(string);
218 prototype int InstallUtils.RestoreConfigInfo(int);
219 prototype int InstallUtils.Eradicate34Client();
220 prototype int InstallUtils.Upgrade34ClientConfigInfo();
221 prototype int InstallUtils.IsWin98();
222 prototype int InstallUtils.ShowLicense(string,string);
225 // ---- script function prototypes -----
227 // generated by the Project Wizard
228 prototype ShowDialogs();
229 prototype MoveFileData();
230 prototype HandleMoveDataError( NUMBER );
231 prototype ProcessBeforeDataMove(APPINFO POINTER);
232 prototype ProcessAfterDataMove();
233 prototype SetupRegistry();
234 prototype CleanUpInstall();
235 prototype SetupInstall();
236 prototype SetupScreen();
237 prototype CheckRequirements();
238 prototype DialogShowSdWelcome();
239 prototype DialogShowSdAskDestPath();
240 prototype DialogShowSdSetupType();
241 prototype DialogShowSdSelectFolder();
242 prototype DialogShowSdFinishReboot();
244 // your script function prototypes
245 prototype FixTargetPaths();
246 prototype SetupAppInfo();
247 prototype LocalizeComponents();
248 prototype LocalizeComponentStatusText (STRING);
249 prototype InstallApp(APPINFO POINTER);
250 prototype DialogShowSdAskComponentDialog();
251 prototype ShowIsSelected(string);
252 prototype ShowSelectedComponents();
253 prototype ConfigClientService();
254 prototype ConfigServerService();
255 prototype AddPath(string);
256 prototype AddBinPaths();
257 prototype ConfigUninstallDLL(APPINFO POINTER);
258 prototype CreateServerDirs();
259 prototype SetUserVars();
260 prototype SetNetworkProviderOrder();
261 prototype CreateRegistrySets(string);
262 prototype ConfigAfsCreds();
263 prototype GetLicenseFilename(BYREF string);
264 prototype GetNlsComps(BYREF string, BYREF string, BYREF string, BYREF string);
265 prototype DetectInstalledComponents();
266 prototype IsAppInstalled(APPINFO POINTER);
267 prototype ProcessCompsOnCmdLn(string);
268 prototype ParseCommandLine();
269 prototype GetVersionNumber(string);
270 prototype GetInstallAction(string, BOOL, string, string, string, string, APPINFO POINTER);
271 prototype GetInstallActions();
272 prototype ClientSelectedOrInstalled();
273 prototype RenameUninstDll(APPINFO POINTER);
274 prototype RemoveInstalledBits(string);
275 prototype PrepareForWSPPInstall();
276 prototype CreateStartMenuEntries();
277 prototype ShowError(string, int);
278 prototype GetDateTimeString(BYREF string);
279 prototype OnlyInstallingDocs();
280 prototype CreateDirs();
281 prototype AddShortCut(string, string, string, string);
282 prototype CheckCopyCellServDB();
283 prototype RestorePreviousConfigs();
284 prototype RemoveCurrentVersion(APPINFO POINTER);
285 prototype DoesConfigInfoExist(APPINFO POINTER);
286 prototype UnselectComps();
287 prototype AnyNonUpgradableSoftwareInstalled();
288 prototype RemoveAllCurrentVersions();
289 prototype AppVersionOk(BOOL, BOOL, APPINFO POINTER);
290 prototype SetupVerInfo(APPINFO POINTER, string, string, string, string, string, string, BOOL);
291 prototype NotUpgradable(APPINFO POINTER);
292 prototype CompareVersions(APPINFO POINTER);
294 // ----- global variables ------
296 // generated by the Project Wizard
297 BOOL bWin95, bWin98, bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
299 STRING svName, svCompany, svSerial;
305 // your global variables
306 APPINFO appFullClient;
307 APPINFO appLightClient;
309 APPINFO appControlCenter;
311 APPINFO POINTER pApp;
313 BOOL bFullClientSel, bServerSel, bCcSel, bLightClientSel, bDocsSel;
314 string szCommonBinPath;
316 BOOL bClientInstalled, bServerInstalled, bCcInstalled, bLightClientInstalled, bDocsInstalled;
317 string szLangComp, szReadmeComp, szDocsComp;
321 BOOL bPreinstallReplace;
324 ///////////////////////////////////////////////////////////////////////////////
328 // The setup begins here by hiding the visible setup
329 // window. This is done to allow all the titles, images, etc. to
330 // be established before showing the main window. The setup is
331 // then performed in a series of calls to script defined functions,
332 // with error checking at each step.
334 ///////////////////////////////////////////////////////////////////////////////
336 Disable( BACKGROUND );
338 if (UseDLL(SUPPORTDIR ^ SETUP_UTILS_DLL_PATH) < 0) then
339 ShowError(@SETUPUTILS_NOT_FOUND, SEVERE);
340 bInstallAborted = TRUE;
352 LocalizeComponents();
354 DetectInstalledComponents();
356 // Can't upgrade, downgrade, or reinstall the light client, so if it is
357 // already installed, we must abort. This is because on Win9x, we can't
358 // move in-use files, and so we can't silently uninstall the light client,
359 // which upgrade, downgrade, and reinstall require.
360 if (bLightClientInstalled && !bWinNT) then
361 ShowError(@LIGHT_CLIENT_ALREADY_INSTALLED_MSG, SEVERE);
362 bInstallAborted = TRUE;
366 if (AnyNonUpgradableSoftwareInstalled()) then
367 ShowError(@NON_UPGRADABLE_SOFTWARE_INSTALLED_ERROR_MSG, SEVERE);
368 bInstallAborted = TRUE;
374 if (bWSPPInstall) then
375 SetSilentMode(); // Tells the InstallUtils dll to run silently
376 PrepareForWSPPInstall();
378 // Ask user what to install
380 if (ShowDialogs()<0) goto end_install;
383 // The AFS path must not contain spaces. AFS code will break if it does.
384 LongPathToShortPath(TARGETDIR);
386 // Determine which comps to install to get the proper NLS files.
387 GetNlsComps(szLangComp, szReadmeComp, szDocsComp, szCodePage);
393 // Uninstall current versions before we install
394 RemoveAllCurrentVersions();
396 // Install the Client
397 if (bFullClientSel) then
398 pApp = &appFullClient;
399 if (InstallApp(pApp) < 0) goto end_install;
402 // Install the Light Client
403 if (bLightClientSel) then
404 pApp = &appLightClient;
405 if (InstallApp(pApp) < 0) goto end_install;
407 EzBatchAddString(LIGHT95_CLIENT_PROTSEQ, "", AFTER | REPLACE);
411 // Install the Server
414 if (InstallApp(pApp) < 0) goto end_install;
418 // Install the Control Center
420 pApp = &appControlCenter;
421 if (InstallApp(pApp) < 0) goto end_install;
426 appDocs.szCompName = szDocsComp;
428 if (InstallApp(pApp) < 0) goto end_install;
431 // If we installed the server, then configure the bos service
433 if (ConfigServerService() < 0) goto end_install;
436 // If we installed the full client, then configure the client service
437 // and add the NetworkProviderOrder value.
438 if (bFullClientSel) then
439 if (ConfigClientService() < 0) goto end_install;
440 // I'm commenting out the line below. This will result in integrated
441 // login being off after an install. If you want it to be on after an
442 // install, then uncomment the line.
443 // if (SetNetworkProviderOrder() < 0) goto end_install;
446 if (bFullClientSel || bLightClientSel) then
450 RestorePreviousConfigs();
452 AddPath(szCommonBinPath);
454 // If not only installing docs, then set BATCH_INSTALL to true,
455 // which will cause setup to want to reboot the computer.
456 if (OnlyInstallingDocs() == FALSE) then
457 BATCH_INSTALL = TRUE;
460 CreateStartMenuEntries();
462 if (bFullClientSel || bLightClientSel || bCcSel) then
463 CheckCopyCellServDB();
468 UnUseDLL(SUPPORTDIR ^ SETUP_UTILS_DLL_PATH);
472 // If an unrecoverable error occurred, clean up
473 // the partial installation. Otherwise, exit normally.
474 if (bInstallAborted) then
480 ///////////////////////////////////////////////////////////////////////////////
482 // Function: ShowDialogs
484 // Purpose: This function manages the display and navigation of
485 // the standard dialogs that exist in a setup.
487 ///////////////////////////////////////////////////////////////////////////////
488 function ShowDialogs()
490 STRING szTargetLicense;
491 STRING szSourceLicense;
494 // beginning of dialogs label
497 nResult = DialogShowSdWelcome();
498 if (nResult = BACK) goto Dlg_Start;
501 szTargetLicense = DOCUMENTATION_LICENSE_PATH;
502 GetLicenseFilename (szSourceLicense);
503 Disable( DIALOGCACHE );
504 nResult = ShowLicense(szTargetLicense,szSourceLicense);
505 if (nResult = 0) then
508 Enable( DIALOGCACHE );
511 nResult = DialogShowSdAskComponentDialog();
512 if (nResult = BACK) goto Dlg_License;
515 nResult = DialogShowSdSelectFolder();
516 if (nResult = BACK) goto Dlg_SdCompDlg;
523 ///////////////////////////////////////////////////////////////////////////////
525 // Function: NotUpgradable
527 // Purpose: This function will return TRUE if the passed in version is not
530 ///////////////////////////////////////////////////////////////////////////////
531 function NotUpgradable(pApp)
533 // The 3.5 beta is not upgradable
534 // if ((pApp->iVer.nMajorVersion = 3) && (pApp->iVer.nMinorVersion = 5) && (pApp->iVer.nPatchLevel = 0) && (pApp->iVer.szReleaseType = RELEASE_TYPE_BETA)) then
542 ///////////////////////////////////////////////////////////////////////////////
544 // Function: AnyNonUpgradableSoftwareInstalled
546 // Purpose: This function will return TRUE if any non-upgradable software is
549 ///////////////////////////////////////////////////////////////////////////////
550 function AnyNonUpgradableSoftwareInstalled()
552 if (NotUpgradable(&appFullClient) ||
553 NotUpgradable(&appServer) ||
554 NotUpgradable(&appControlCenter) ||
555 NotUpgradable(&appLightClient) ||
556 NotUpgradable(&appDocs))
565 ///////////////////////////////////////////////////////////////////////////////
567 // Function: UnselectComps
569 // Purpose: This function unselects all of the componenets so that we can
570 // completely control what gets installed. We will select each
571 // component at the time when we want to install it.
573 ///////////////////////////////////////////////////////////////////////////////
574 function UnselectComps()
576 ComponentSelectItem(MEDIA, SERVER_COMP_NAME, FALSE);
577 ComponentSelectItem(MEDIA, CLIENT_COMP_NAME, FALSE);
578 ComponentSelectItem(MEDIA, LIGHT_CLIENT_COMP_NAME, FALSE);
579 ComponentSelectItem(MEDIA, CC_COMP_NAME, FALSE);
580 ComponentSelectItem(MEDIA, DOCS_COMP_NAME, FALSE);
581 ComponentSelectItem(MEDIA, LANG_COMP_NAME, FALSE);
582 ComponentSelectItem(MEDIA, LANG_ENGLISH_COMP_NAME, FALSE);
583 ComponentSelectItem(MEDIA, LANG_SIMP_CHINESE_COMP_NAME, FALSE);
584 ComponentSelectItem(MEDIA, LANG_TRAD_CHINESE_COMP_NAME, FALSE);
585 ComponentSelectItem(MEDIA, LANG_KOREAN_COMP_NAME, FALSE);
586 ComponentSelectItem(MEDIA, LANG_JAPANESE_COMP_NAME, FALSE);
587 ComponentSelectItem(MEDIA, LANG_GERMAN_COMP_NAME, FALSE);
588 ComponentSelectItem(MEDIA, LANG_SPANISH_COMP_NAME, FALSE);
589 ComponentSelectItem(MEDIA, LANG_PORTUGUESE_COMP_NAME, FALSE);
590 ComponentSelectItem(MEDIA, README_COMP_NAME, FALSE);
591 ComponentSelectItem(MEDIA, README_ENGLISH_COMP_NAME, FALSE);
592 ComponentSelectItem(MEDIA, README_JAPANESE_COMP_NAME, FALSE);
593 ComponentSelectItem(MEDIA, README_KOREAN_COMP_NAME, FALSE);
594 ComponentSelectItem(MEDIA, README_SIMP_CHINESE_COMP_NAME, FALSE);
595 ComponentSelectItem(MEDIA, README_TRAD_CHINESE_COMP_NAME, FALSE);
596 ComponentSelectItem(MEDIA, README_GERMAN_COMP_NAME, FALSE);
597 ComponentSelectItem(MEDIA, README_SPANISH_COMP_NAME, FALSE);
598 ComponentSelectItem(MEDIA, README_PORTUGUESE_COMP_NAME, FALSE);
599 ComponentSelectItem(MEDIA, DOCS_ENGLISH_COMP_NAME, FALSE);
600 ComponentSelectItem(MEDIA, DOCS_JAPANESE_COMP_NAME, FALSE);
601 ComponentSelectItem(MEDIA, DOCS_KOREAN_COMP_NAME, FALSE);
602 ComponentSelectItem(MEDIA, DOCS_SIMP_CHINESE_COMP_NAME, FALSE);
603 ComponentSelectItem(MEDIA, DOCS_TRAD_CHINESE_COMP_NAME, FALSE);
604 ComponentSelectItem(MEDIA, DOCS_GERMAN_COMP_NAME, FALSE);
605 ComponentSelectItem(MEDIA, DOCS_SPANISH_COMP_NAME, FALSE);
606 ComponentSelectItem(MEDIA, DOCS_PORTUGUESE_COMP_NAME, FALSE);
610 ///////////////////////////////////////////////////////////////////////////////
612 // Function: DoesConfigInfoExist
614 // Purpose: This function determines if config info exists for an app.
616 ///////////////////////////////////////////////////////////////////////////////
617 function DoesConfigInfoExist(pApp)
619 RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
621 if (RegDBKeyExist(CONFIG_INFO_KEY ^ pApp->szProductName) = 1) then
629 ///////////////////////////////////////////////////////////////////////////////
631 // Function: RestorePreviousConfigs
633 // Purpose: This function restores config info for the apps we just installed.
635 ///////////////////////////////////////////////////////////////////////////////
636 function RestorePreviousConfigs()
638 if (appServer.bInstallSucceeded && DoesConfigInfoExist(&appServer)) then
639 RestoreConfigInfo(SERVER);
642 if (appFullClient.bInstallSucceeded) then
643 if (appFullClient.iVer.szTitle = "3.4a") then
644 Upgrade34ClientConfigInfo();
645 elseif (DoesConfigInfoExist(&appFullClient) = TRUE) then
646 RestoreConfigInfo(CLIENT);
650 if (appLightClient.bInstallSucceeded && DoesConfigInfoExist(&appLightClient)) then
651 RestoreConfigInfo(LCLIENT);
654 // Only restore control center info if client not installed
655 if (appControlCenter.bInstallSucceeded && !bClientInstalled && !appFullClient.bInstallSucceeded
656 && DoesConfigInfoExist(&appControlCenter))
658 RestoreConfigInfo(CC);
663 ///////////////////////////////////////////////////////////////////////////////
665 // Function: OnlyInstallingDocs
667 // Purpose: This function determines if only the doc files are being installed.
669 ///////////////////////////////////////////////////////////////////////////////
670 function OnlyInstallingDocs()
672 if (!bServerSel && !bFullClientSel && !bLightClientSel && !bCcSel && bDocsSel) then
680 ///////////////////////////////////////////////////////////////////////////////
682 // Function: CreateDirs
684 // Purpose: This function creates directories that we don't want IS to make.
686 ///////////////////////////////////////////////////////////////////////////////
687 function CreateDirs()
689 // Turn off logging. It shouldn't be on when this func is called, but we
690 // turn it off anyway just to make sure. We turn it off so that IS won't
691 // try to delete the dirs we are about to make during an uninstall. If
692 // we don't do this, then the first app installed that uses one of these
693 // dirs will think that it owns that dir and won't know that other apps
697 // Create the target dir and the shared dirs
698 CreateDir(TARGETDIR);
699 CreateDir(TARGETDIR ^ "Documentation");
700 CreateDir(TARGETDIR ^ "Documentation\\Html");
701 CreateDir(TARGETDIR ^ "Documentation\\Html\\InstallGd");
702 CreateDir(TARGETDIR ^ "Documentation\\Html\\ReleaseNotes");
704 // We need to manually create the Server dir so that if we have to leave
705 // it behind during an uninstall (so that config info is preserved), IS
706 // won't complain that it can't be deleted.
708 CreateDir(TARGETDIR ^ "Server\\usr\\afs\\bin");
711 // Docs don't use the common dir
712 if (OnlyInstallingDocs() = FALSE) then
713 CreateDir(TARGETDIR ^ "Common");
718 ///////////////////////////////////////////////////////////////////////////////
720 // Function: PrepareForWSPPInstall
722 // Purpose: This function decides what to install when doing a WSPP install.
724 ///////////////////////////////////////////////////////////////////////////////
725 function PrepareForWSPPInstall()
727 SHELL_OBJECT_FOLDER = @WSPP_FOLDER_NAME;
729 // Never install the Docs during a WSPP install
730 appDocs.nInstallAction = ACTION_NONE;
732 // If we have been told to replace any preinstalled software, then set
733 // our reinstall mechanism in motion.
734 if (bPreinstallReplace) then
735 if (bCcInstalled && bCcSel) then
736 appControlCenter.nInstallAction = ACTION_REINSTALL;
738 if (bClientInstalled && bFullClientSel) then
739 appFullClient.nInstallAction = ACTION_REINSTALL;
741 if (bServerInstalled && bServerSel) then
742 appServer.nInstallAction = ACTION_REINSTALL;
744 if (bLightClientInstalled && bLightClientSel) then
745 appLightClient.nInstallAction = ACTION_REINSTALL;
748 // If we have been told to not install something that is already
749 // installed, then do just that.
750 if (bCcInstalled && bCcSel) then
753 if (bClientInstalled && bFullClientSel) then
754 bFullClientSel = FALSE;
756 if (bServerInstalled && bServerSel) then
759 if (bLightClientInstalled && bLightClientSel) then
760 bLightClientSel = FALSE;
766 ///////////////////////////////////////////////////////////////////////////////
768 // Function: RemoveCurrentVersion
770 // Purpose: This function removes the currently installed version of the app.
771 // It provides a message to the user so they know what is going on.
773 ///////////////////////////////////////////////////////////////////////////////
774 function RemoveCurrentVersion(pApp)
780 switch(pApp->nInstallAction)
781 case ACTION_REINSTALL: szFormat = @REINSTALL_PREP_MSG;
782 case ACTION_UPGRADE: szFormat = @UPGRADE_PREP_MSG;
783 case ACTION_DOWNGRADE: szFormat = @DOWNGRADE_PREP_MSG;
786 if (szFormat == "") then
790 Sprintf(szMsg, szFormat, pApp->szProductName);
792 if (!bWSPPInstall) then
793 SdShowMsg(szMsg, TRUE);
796 RemoveInstalledBits(pApp->szProductName);
798 if (!bWSPPInstall) then
799 SdShowMsg(szMsg, FALSE);
804 ///////////////////////////////////////////////////////////////////////////////
806 // Function: RemoveAllCurrentVersions
808 // Purpose: This function removes the current install of all apps that are
809 // begin reinstalled, upgraded, or downgraded.
811 ///////////////////////////////////////////////////////////////////////////////
812 function RemoveAllCurrentVersions()
814 if (bFullClientSel) then
815 RemoveCurrentVersion(&appFullClient);
819 RemoveCurrentVersion(&appServer);
823 RemoveCurrentVersion(&appControlCenter);
826 if (bLightClientSel) then
827 RemoveCurrentVersion(&appLightClient);
832 ///////////////////////////////////////////////////////////////////////////////
834 // Function: InstallApp
836 // Purpose: This function installs an application that is part of a suite.
838 ///////////////////////////////////////////////////////////////////////////////
839 function InstallApp(pApp)
842 if (pApp->nInstallAction = ACTION_NONE) then
846 // Start fresh with nothing selected
849 // Select the comps we want to install. We will install the passed in app
850 // as well as the comps that are shared by all the apps. Because of weird
851 // IS stuff, the app comp must be selected last else IS will autoselect
852 // things we don't want.
853 ComponentSelectItem(MEDIA, szReadmeComp, TRUE);
855 // Lang comps are shared by all apps except the docs app
856 if (pApp != &appDocs) then
857 ComponentSelectItem(MEDIA, szLangComp, TRUE);
860 // Select the app's component
861 ComponentSelectItem(MEDIA, pApp->szCompName, TRUE);
863 // MessageBox("Install app: " + pApp->szCompName, INFORMATION);
865 nResult = ProcessBeforeDataMove(pApp);
866 if (nResult < 0) goto error;
868 nResult = MoveFileData();
869 if (nResult < 0) goto error;
871 nResult = ProcessAfterDataMove();
872 if (nResult < 0) goto error;
874 nResult = CreateRegistrySets(pApp->szRegistrySets);
875 if (nResult < 0) goto error;
879 nResult = CreateRegistrySets(pApp->szNoLogRegistrySets);
880 if (nResult < 0) goto error;
882 nResult = ConfigUninstallDLL(pApp);
883 if (nResult < 0) goto error;
885 AddPath(pApp->szBinPath);
887 // Now unselect it again
888 ComponentSelectItem(MEDIA, pApp->szCompName, FALSE);
890 pApp->bInstallSucceeded = TRUE;
899 ///////////////////////////////////////////////////////////////////////////////
901 // Function: ProcessBeforeDataMove
903 // Purpose: This function performs any necessary operations prior to the
904 // actual file transfer.
906 ///////////////////////////////////////////////////////////////////////////////
907 function ProcessBeforeDataMove(pApp)
911 // Create app information and App Paths registry keys.
912 InstallationInfo(pApp->szCompanyName, pApp->szProductName, pApp->Ver.szTitle, pApp->szProductKey);
914 svLogFile = pApp->szUninstLogfileName;
916 // Create the uninstall reg key and open the log file
917 nResult = DeinstallStart(TARGETDIR, svLogFile, pApp->szUninstKey, 0 );
918 if (nResult < 0) then
919 ShowError( @ERROR_UNINSTSETUP, WARNING );
922 szAppPath = pApp->szAppPath;
924 // Fill in reg values for this apps reg key and uninstall reg key
925 RegDBSetItem( REGDB_APPPATH, szAppPath );
926 RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ pApp->szProductKey);
927 RegDBSetItem( REGDB_UNINSTALL_NAME, pApp->szUninstDisplayName);
934 function ShowIsSelected(comp)
938 nSel = ComponentIsItemSelected(MEDIA , comp);
940 str = comp + " is selected.";
941 MessageBox(str, INFORMATION);
943 str = comp + " is not selected.";
948 function ShowSelectedComponents()
950 // Visible components
951 ShowIsSelected(CLIENT_COMP_NAME);
952 ShowIsSelected(LIGHT_CLIENT_COMP_NAME);
953 ShowIsSelected(SERVER_COMP_NAME);
954 ShowIsSelected(CC_COMP_NAME);
955 ShowIsSelected(DOCS_COMP_NAME);
957 // Language components
958 ShowIsSelected(LANG_COMP_NAME);
959 ShowIsSelected(LANG_ENGLISH_COMP_NAME);
960 ShowIsSelected(LANG_SIMP_CHINESE_COMP_NAME);
961 ShowIsSelected(LANG_TRAD_CHINESE_COMP_NAME);
962 ShowIsSelected(LANG_KOREAN_COMP_NAME);
963 ShowIsSelected(LANG_JAPANESE_COMP_NAME);
964 ShowIsSelected(LANG_GERMAN_COMP_NAME);
965 ShowIsSelected(LANG_SPANISH_COMP_NAME);
966 ShowIsSelected(LANG_PORTUGUESE_COMP_NAME);
968 // Documentation components
969 ShowIsSelected(DOCS_ENGLISH_COMP_NAME);
970 ShowIsSelected(DOCS_JAPANESE_COMP_NAME);
971 ShowIsSelected(DOCS_KOREAN_COMP_NAME);
972 ShowIsSelected(DOCS_SIMP_CHINESE_COMP_NAME);
973 ShowIsSelected(DOCS_TRAD_CHINESE_COMP_NAME);
974 ShowIsSelected(DOCS_GERMAN_COMP_NAME);
975 ShowIsSelected(DOCS_SPANISH_COMP_NAME);
976 ShowIsSelected(DOCS_PORTUGUESE_COMP_NAME);
978 // Readme files components
979 ShowIsSelected(README_COMP_NAME);
980 ShowIsSelected(README_ENGLISH_COMP_NAME);
981 ShowIsSelected(README_JAPANESE_COMP_NAME);
982 ShowIsSelected(README_KOREAN_COMP_NAME);
983 ShowIsSelected(README_SIMP_CHINESE_COMP_NAME);
984 ShowIsSelected(README_TRAD_CHINESE_COMP_NAME);
985 ShowIsSelected(README_GERMAN_COMP_NAME);
986 ShowIsSelected(README_SPANISH_COMP_NAME);
987 ShowIsSelected(README_PORTUGUESE_COMP_NAME);
992 ///////////////////////////////////////////////////////////////////////////////
994 // Function: MoveFileData
996 // Purpose: This function handles the file transfer for
999 ///////////////////////////////////////////////////////////////////////////////
1000 function MoveFileData()
1001 NUMBER nResult, nDisk;
1004 if (!bWSPPInstall) then
1005 Enable( INDVFILESTATUS );
1006 SetStatusWindow( 0, "" );
1007 Disable( DIALOGCACHE );
1009 StatusUpdate( ON, 100 );
1012 nResult = ComponentMoveData( MEDIA, nDisk, 0 );
1014 // Reinit this call so the progress indicator resets
1015 ComponentMoveData("", nDisk, 0);
1017 HandleMoveDataError( nResult );
1025 ///////////////////////////////////////////////////////////////////////////////
1027 // Function: HandleMoveDataError
1029 // Purpose: This function handles the error (if any) during the file transfer
1032 ///////////////////////////////////////////////////////////////////////////////
1033 function HandleMoveDataError( nResult )
1034 STRING szErrMsg, svComponent , svFileGroup , svFile;
1045 ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult );
1046 szErrMsg = @ERROR_MOVEDATA + "\n\n" +
1047 @ERROR_COMPONENT + " " + svComponent + "\n" +
1048 @ERROR_FILEGROUP + " " + svFileGroup + "\n" +
1049 @ERROR_FILE + " " + svFile;
1050 Sprintf(szMsg, szErrMsg, nResult);
1051 ShowError(szMsg, SEVERE);
1052 bInstallAborted = TRUE;
1059 ///////////////////////////////////////////////////////////////////////////////
1061 // Function: ProcessAfterDataMove
1063 // Purpose: This function performs any necessary operations needed after
1064 // all files have been transferred.
1066 ///////////////////////////////////////////////////////////////////////////////
1067 function ProcessAfterDataMove()
1068 STRING szReferenceFile;
1072 // TO DO : update self-registered files and other processes that
1073 // should be performed after the files have been transferred.
1075 // DeinstallSetReference specifies a file to be checked before
1076 // uninstallation. If the file is in use, uninstallation will not proceed.
1078 // szReferenceFile = svDir ^ pApp->szProductKey; // TO DO : If your file is in a
1079 // subfolder of svDir add that here
1081 // DeinstallSetReference( szReferenceFile );
1087 ///////////////////////////////////////////////////////////////////////////////
1089 // Function: CleanUpInstall
1091 // Purpose: This cleans up the setup. Anything that should
1092 // be released or deleted at the end of the setup should
1095 ///////////////////////////////////////////////////////////////////////////////
1096 function CleanUpInstall()
1099 if (bInstallAborted) then
1103 if (!bWSPPInstall) then
1104 DialogShowSdFinishReboot();
1107 if (BATCH_INSTALL) then // ensure locked files are properly transferred
1108 CommitSharedFiles(0);
1115 ///////////////////////////////////////////////////////////////////////////////
1117 // Function: GetLicenseFilename
1119 // Purpose: This will determine the full path to the appropriate-language
1120 // license on the CD. Will default to English if the locale cannot
1123 ///////////////////////////////////////////////////////////////////////////////
1124 function GetLicenseFilename(szLicense)
1125 number MajorLanguage;
1127 MajorLanguage = SELECTED_LANGUAGE & 255;
1129 switch(MajorLanguage)
1130 case ISLANG_CHINESE:
1131 if (SELECTED_LANGUAGE == ISLANG_CHINESE_TAIWAN) then
1132 szLicense = SRCDIR ^ LICENSE_TRAD_CHINESE_FILENAME;
1134 szLicense = SRCDIR ^ LICENSE_SIMP_CHINESE_FILENAME;
1138 szLicense = SRCDIR ^ LICENSE_KOREAN_FILENAME;
1140 case ISLANG_JAPANESE:
1141 szLicense = SRCDIR ^ LICENSE_JAPANESE_FILENAME;
1144 szLicense = SRCDIR ^ LICENSE_GERMAN_FILENAME;
1146 case ISLANG_PORTUGUESE:
1147 szLicense = SRCDIR ^ LICENSE_PORTUGUESE_FILENAME;
1149 case ISLANG_SPANISH:
1150 szLicense = SRCDIR ^ LICENSE_SPANISH_FILENAME;
1153 szLicense = SRCDIR ^ LICENSE_ENGLISH_FILENAME;
1161 ///////////////////////////////////////////////////////////////////////////////
1163 // Function: GetLanguageComp
1165 // Purpose: This will determine which language the locale is set to. Uses
1166 // this info to determine which lang, readme, and doc comps to
1167 // install. Will default to English if the locale cannot be
1170 ///////////////////////////////////////////////////////////////////////////////
1171 function GetNlsComps(szLangComp, szReadmeComp, szDocsComp, szCodePage)
1172 number MajorLanguage;
1174 MajorLanguage = SELECTED_LANGUAGE & 255;
1176 switch(MajorLanguage)
1177 case ISLANG_CHINESE:
1178 if (SELECTED_LANGUAGE == ISLANG_CHINESE_TAIWAN) then
1179 szLangComp = LANG_TRAD_CHINESE_COMP_NAME;
1180 szReadmeComp = README_TRAD_CHINESE_COMP_NAME;
1181 szDocsComp = DOCS_TRAD_CHINESE_COMP_NAME;
1182 szCodePage = "1028";
1184 szLangComp = LANG_SIMP_CHINESE_COMP_NAME;
1185 szReadmeComp = README_SIMP_CHINESE_COMP_NAME;
1186 szDocsComp = DOCS_SIMP_CHINESE_COMP_NAME;
1187 szCodePage = "2052";
1191 szLangComp = LANG_KOREAN_COMP_NAME;
1192 szReadmeComp = README_KOREAN_COMP_NAME;
1193 szDocsComp = DOCS_KOREAN_COMP_NAME;
1194 szCodePage = "1042";
1196 case ISLANG_JAPANESE:
1197 szLangComp = LANG_JAPANESE_COMP_NAME;
1198 szReadmeComp = README_JAPANESE_COMP_NAME;
1199 szDocsComp = DOCS_JAPANESE_COMP_NAME;
1200 szCodePage = "1041";
1203 szLangComp = LANG_GERMAN_COMP_NAME;
1204 szReadmeComp = README_GERMAN_COMP_NAME;
1205 szDocsComp = DOCS_GERMAN_COMP_NAME;
1206 szCodePage = "1032";
1208 case ISLANG_PORTUGUESE:
1209 szLangComp = LANG_PORTUGUESE_COMP_NAME;
1210 szReadmeComp = README_PORTUGUESE_COMP_NAME;
1211 szDocsComp = DOCS_PORTUGUESE_COMP_NAME;
1212 szCodePage = "1046";
1214 case ISLANG_SPANISH:
1215 szLangComp = LANG_SPANISH_COMP_NAME;
1216 szReadmeComp = README_SPANISH_COMP_NAME;
1217 szDocsComp = DOCS_SPANISH_COMP_NAME;
1218 szCodePage = "1034";
1221 szLangComp = LANG_ENGLISH_COMP_NAME;
1222 szReadmeComp = README_ENGLISH_COMP_NAME;
1223 szDocsComp = DOCS_ENGLISH_COMP_NAME;
1224 szCodePage = "1033";
1232 ///////////////////////////////////////////////////////////////////////////////
1234 // Function: SetupVerInfo
1236 // Purpose: This will initialize the VERINFO structures for a product.
1238 ///////////////////////////////////////////////////////////////////////////////
1239 function SetupVerInfo(pApp, szMajor, szMinor, szPatchLevel, szBetaLevel, szReleaseType, szTitle, bInstalledVerInfo)
1245 StrToNum(nMajor, szMajor);
1246 StrToNum(nMinor, szMinor);
1247 StrToNum(nPatchLevel, szPatchLevel);
1248 StrToNum(nBetaLevel, szBetaLevel);
1250 if (bInstalledVerInfo) then
1251 pApp->iVer.nMajorVersion = nMajor;
1252 pApp->iVer.nMinorVersion = nMinor;
1253 pApp->iVer.nPatchLevel = nPatchLevel;
1254 pApp->iVer.nBetaLevel = nBetaLevel;
1255 pApp->iVer.szReleaseType = szReleaseType;
1256 pApp->iVer.szTitle = szTitle;
1258 pApp->Ver.nMajorVersion = nMajor;
1259 pApp->Ver.nMinorVersion = nMinor;
1260 pApp->Ver.nPatchLevel = nPatchLevel;
1261 pApp->Ver.nBetaLevel = nBetaLevel;
1262 pApp->Ver.szReleaseType = szReleaseType;
1263 pApp->Ver.szTitle = szTitle;
1269 ///////////////////////////////////////////////////////////////////////////////
1271 // Function: FixTargetPaths
1273 // Purpose: This function updates the CommonBinPath and app paths if you
1274 // choose to install to a different directory
1276 ///////////////////////////////////////////////////////////////////////////////
1277 function FixTargetPaths()
1279 // The AFS path must not contain spaces. AFS code will break if it does.
1280 LongPathToShortPath(TARGETDIR);
1282 szCommonBinPath = TARGETDIR ^ "Common";
1285 appFullClient.szAppPath = TARGETDIR ^ "Client";
1286 appFullClient.szBinPath = TARGETDIR ^ "Client\\Program";
1289 appLightClient.szAppPath = TARGETDIR ^ "Client";
1290 appLightClient.szBinPath = TARGETDIR ^ "Client\\Program";
1293 appServer.szAppPath = TARGETDIR ^ "Server";
1294 appServer.szBinPath = TARGETDIR ^ "Server\\usr\\afs\\bin";
1297 appControlCenter.szAppPath = TARGETDIR ^ "Control Center";
1298 appControlCenter.szBinPath = TARGETDIR ^ "Control Center";
1301 appDocs.szAppPath = TARGETDIR ^ "Documentation";
1302 appDocs.szBinPath = TARGETDIR ^ "Documentation";
1307 ///////////////////////////////////////////////////////////////////////////////
1309 // Function: SetupAppInfo
1311 // Purpose: This will initialize the APPINFO structures for each product
1312 // that we can install.
1314 ///////////////////////////////////////////////////////////////////////////////
1315 function SetupAppInfo()
1318 szCommonBinPath = TARGETDIR ^ "Common";
1321 appFullClient.szCompName = CLIENT_COMP_NAME; // Component name
1322 appFullClient.szCompanyName = @COMPANY_NAME;
1323 appFullClient.szProductName = @PRODUCT_NAME_CLIENT;
1324 appFullClient.szProductKey = @PRODUCT_KEY_CLIENT;
1325 appFullClient.bUseUninstDLL = TRUE;
1326 appFullClient.szUninstDllName = CLIENT_UNINST_DLL_NAME;
1327 appFullClient.szUninstLogfileName = CLIENT_UNINST_LOGFILE_NAME;
1328 appFullClient.szUninstKey = @UNINST_KEY_CLIENT;
1329 appFullClient.szAppPath = TARGETDIR ^ "Client";
1330 appFullClient.szBinPath = TARGETDIR ^ "Client\\Program";
1331 appFullClient.bAddToPath = TRUE;
1332 appFullClient.szUninstDisplayName = @UNINST_DISPLAY_NAME_CLIENT;
1333 appFullClient.szRegistrySets = "Client,Full_Client";
1334 appFullClient.szNoLogRegistrySets = "Client_NoUninstall,WinNT_Client_NoUninstall";
1335 appFullClient.bInstallSucceeded = FALSE;
1336 SetupVerInfo(&appFullClient, @PRODUCT_VERSION_MAJOR, @PRODUCT_VERSION_MINOR, @PRODUCT_VERSION_PATCH_LEVEL, @PRODUCT_VERSION_BETA_LEVEL, @PRODUCT_VERSION_RELEASE_TYPE, @PRODUCT_VERSION_TITLE, FALSE);
1340 appLightClient.szCompName = LIGHT95_CLIENT_COMP_NAME;
1341 elseif (bWin98) then
1342 appLightClient.szCompName = LIGHT98_CLIENT_COMP_NAME;
1344 appLightClient.szCompanyName = @COMPANY_NAME;
1345 appLightClient.szProductName = @PRODUCT_NAME_LIGHT_CLIENT;
1346 appLightClient.szProductKey = @PRODUCT_KEY_LIGHT_CLIENT;
1347 appLightClient.bUseUninstDLL = TRUE;
1348 appLightClient.szUninstDllName = LIGHT_CLIENT_UNINST_DLL_NAME;
1349 appLightClient.szUninstLogfileName = LIGHT_CLIENT_UNINST_LOGFILE_NAME;
1350 appLightClient.szUninstKey = @UNINST_KEY_LIGHT_CLIENT;
1351 appLightClient.szAppPath = TARGETDIR ^ "Client";
1352 appLightClient.szBinPath = TARGETDIR ^ "Client\\Program";
1353 appLightClient.bAddToPath = TRUE;
1354 appLightClient.szUninstDisplayName = @UNINST_DISPLAY_NAME_LIGHT_CLIENT;
1355 appLightClient.szRegistrySets = "Client,LightClient";
1356 appLightClient.szNoLogRegistrySets = "Client_NoUninstall";
1357 appLightClient.bInstallSucceeded = FALSE;
1358 SetupVerInfo(&appLightClient, @PRODUCT_VERSION_MAJOR, @PRODUCT_VERSION_MINOR, @PRODUCT_VERSION_PATCH_LEVEL, @PRODUCT_VERSION_BETA_LEVEL, @PRODUCT_VERSION_RELEASE_TYPE, @PRODUCT_VERSION_TITLE, FALSE);
1361 appServer.szCompName = SERVER_COMP_NAME;
1362 appServer.szCompanyName = @COMPANY_NAME;
1363 appServer.szProductName = @PRODUCT_NAME_SERVER;
1364 appServer.szProductKey = @PRODUCT_KEY_SERVER;
1365 appServer.bUseUninstDLL = TRUE;
1366 appServer.szUninstDllName = SERVER_UNINST_DLL_NAME;
1367 appServer.szUninstLogfileName = SERVER_UNINST_LOGFILE_NAME;
1368 appServer.szUninstKey = @UNINST_KEY_SERVER;
1369 appServer.szAppPath = TARGETDIR ^ "Server";
1370 appServer.szBinPath = TARGETDIR ^ "Server\\usr\\afs\\bin";
1371 appServer.bAddToPath = TRUE;
1372 appServer.szUninstDisplayName = @UNINST_DISPLAY_NAME_SERVER;
1373 appServer.szRegistrySets = "Server";
1374 appServer.szNoLogRegistrySets = "";
1375 appServer.bInstallSucceeded = FALSE;
1376 SetupVerInfo(&appServer, @PRODUCT_VERSION_MAJOR, @PRODUCT_VERSION_MINOR, @PRODUCT_VERSION_PATCH_LEVEL, @PRODUCT_VERSION_BETA_LEVEL, @PRODUCT_VERSION_RELEASE_TYPE, @PRODUCT_VERSION_TITLE, FALSE);
1379 appControlCenter.szCompName = CC_COMP_NAME;
1380 appControlCenter.szCompanyName = @COMPANY_NAME;
1381 appControlCenter.szProductName = @PRODUCT_NAME_CC;
1382 appControlCenter.szProductKey = @PRODUCT_KEY_CC;
1383 appControlCenter.bUseUninstDLL = TRUE;
1384 appControlCenter.szUninstDllName = CC_UNINST_DLL_NAME;
1385 appControlCenter.szUninstLogfileName = CC_UNINST_LOGFILE_NAME;
1386 appControlCenter.szUninstKey = @UNINST_KEY_CC;
1387 appControlCenter.szAppPath = TARGETDIR ^ "Control Center";
1388 appControlCenter.szBinPath = TARGETDIR ^ "Control Center";
1389 appControlCenter.bAddToPath = TRUE;
1390 appControlCenter.szUninstDisplayName = @UNINST_DISPLAY_NAME_CC;
1391 appControlCenter.szRegistrySets = "Control_Center";
1392 appControlCenter.szNoLogRegistrySets = "";
1393 appControlCenter.bInstallSucceeded = FALSE;
1394 SetupVerInfo(&appControlCenter, @PRODUCT_VERSION_MAJOR, @PRODUCT_VERSION_MINOR, @PRODUCT_VERSION_PATCH_LEVEL, @PRODUCT_VERSION_BETA_LEVEL, @PRODUCT_VERSION_RELEASE_TYPE, @PRODUCT_VERSION_TITLE, FALSE);
1397 appDocs.szCompName = DOCS_COMP_NAME;
1398 appDocs.szCompanyName = @COMPANY_NAME;
1399 appDocs.szProductName = @PRODUCT_NAME_DOCS;
1400 appDocs.szProductKey = @PRODUCT_KEY_DOCS;
1401 appDocs.bUseUninstDLL = TRUE;
1402 appDocs.szUninstDllName = DOCS_UNINST_DLL_NAME;
1403 appDocs.szUninstLogfileName = DOCS_UNINST_LOGFILE_NAME;
1404 appDocs.szUninstKey = @UNINST_KEY_DOCS;
1405 appDocs.szAppPath = TARGETDIR ^ "Documentation";
1406 appDocs.szBinPath = TARGETDIR ^ "Documentation";
1407 appDocs.bAddToPath = FALSE;
1408 appDocs.szUninstDisplayName = @UNINST_DISPLAY_NAME_DOCS;
1409 appDocs.szRegistrySets = "Docs";
1410 appDocs.szNoLogRegistrySets = "";
1411 appDocs.bInstallSucceeded = FALSE;
1412 SetupVerInfo(&appDocs, @PRODUCT_VERSION_MAJOR, @PRODUCT_VERSION_MINOR, @PRODUCT_VERSION_PATCH_LEVEL, @PRODUCT_VERSION_BETA_LEVEL, @PRODUCT_VERSION_RELEASE_TYPE, @PRODUCT_VERSION_TITLE, FALSE);
1416 ///////////////////////////////////////////////////////////////////////////////
1418 // Function: SetupInstall
1420 // Purpose: This will initialize the setup. Any general initialization
1421 // needed for the installation should be performed here.
1423 ///////////////////////////////////////////////////////////////////////////////
1424 function SetupInstall()
1426 Enable( CORECOMPONENTHANDLING );
1428 bInstallAborted = FALSE;
1430 // Create list of end user selections to be displayed by DialogShowSdStartCopy()
1432 svDir = PROGRAMFILES ^ @DEFAULT_INSTALL_DIR;
1436 SdProductName( @PRODUCT_NAME );
1438 Enable( DIALOGCACHE );
1440 SetDialogTitle(DLG_ASK_YESNO, @TITLE_CAPTIONBAR);
1441 SetDialogTitle(DLG_MSG_INFORMATION, @TITLE_CAPTIONBAR);
1442 SetDialogTitle(DLG_MSG_WARNING, @TITLE_CAPTIONBAR);
1443 SetDialogTitle(DLG_MSG_SEVERE, @TITLE_CAPTIONBAR);
1444 SetDialogTitle(DLG_USER_CAPTION, @TITLE_CAPTIONBAR);
1447 ///////////////////////////////////////////////////////////////////////////////
1449 // Function: SetupScreen
1451 // Purpose: This function establishes the screen look. This includes
1452 // colors, fonts, and text to be displayed.
1454 ///////////////////////////////////////////////////////////////////////////////
1455 function SetupScreen()
1457 Enable( FULLWINDOWMODE );
1458 SetTitle( @TITLE_MAIN, 24, WHITE );
1460 SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text.
1462 Enable( BACKGROUND );
1468 ///////////////////////////////////////////////////////////////////////////////
1470 // Function: CheckRequirements
1472 // Purpose: This function checks all minimum requirements for the
1473 // application being installed. If any fail, then the user
1474 // is informed and the setup is terminated.
1476 ///////////////////////////////////////////////////////////////////////////////
1477 function CheckRequirements()
1478 NUMBER nvDx, nvDy, nvResult;
1484 bIsShellExplorer = FALSE;
1486 // Check screen resolution.
1487 GetExtents( nvDx, nvDy );
1489 if (nvDy < 480) then
1490 ShowError( @ERROR_VGARESOLUTION, WARNING );
1494 // set 'setup' operation mode
1495 bIs32BitSetup = TRUE;
1496 GetSystemInfo( ISTYPE, nvResult, svResult );
1497 if (nvResult = 16) then
1498 bIs32BitSetup = FALSE; // running 16-bit setup
1499 return 0; // no additional information required
1502 // --- 32-bit testing after this point ---
1504 // Determine the target system's operating system.
1505 GetSystemInfo( OS, nvResult, svResult );
1507 if (nvResult = IS_WINDOWSNT) then
1508 // Running Windows NT.
1511 // If the user is not an admin, then abort
1512 if (CheckIfAdmin() = -1) then
1513 ShowError(@MUST_BE_AN_ADMIN_MSG, SEVERE);
1517 // Check to see if the shell being used is EXPLORER shell.
1518 if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
1519 if (nvResult >= 4) then
1520 bIsShellExplorer = TRUE;
1524 elseif (nvResult = IS_WINDOWS95) then
1525 // IS puts us here even for Win98
1526 if (IsWin98() = 0) then
1532 bIsShellExplorer = TRUE;
1537 ///////////////////////////////////////////////////////////////////////////////
1539 // Function: DialogShowSdWelcome
1541 // Purpose: This function handles the standard welcome dialog.
1544 ///////////////////////////////////////////////////////////////////////////////
1545 function DialogShowSdWelcome()
1547 STRING szTitle, szMsg;
1553 nResult = SdWelcome( szTitle, szMsg );
1559 ///////////////////////////////////////////////////////////////////////////////
1561 // Function: DialogShowSdAskDestPath
1563 // Purpose: This function asks the user for the destination folder.
1565 ///////////////////////////////////////////////////////////////////////////////
1566 function DialogShowSdAskDestPath()
1568 STRING szTitle, szMsg;
1574 nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 );
1583 ///////////////////////////////////////////////////////////////////////////////
1585 // Function: GetVersionNumber
1587 // Purpose: This function converts a version number string into an integer.
1589 ///////////////////////////////////////////////////////////////////////////////
1590 function GetVersionNumber(szVerion)
1596 // This code assumes a majorversion.minorversion format.
1599 // This will get everything up to the '.'
1600 StrToNum(nMajorVersion, szVer);
1602 // Delete the part of the string we just converted
1603 StrSub(szVer, szVer, StrFind(szVer, ".") + 1, 64);
1605 // Now convert the part after the '.'
1606 StrToNum(nMinorVersion, szVer);
1608 // Turn in into a single number
1609 nVersion = (nMajorVersion * 10) + nMinorVersion;
1615 ///////////////////////////////////////////////////////////////////////////////
1617 // Function: CompareVersions
1619 // Purpose: This function compares an apps two version info structures and
1620 // determines if one is greater than the other, or if they are equal.
1622 ///////////////////////////////////////////////////////////////////////////////
1623 function CompareVersions(pApp)
1626 // Compare major versions
1627 nResult = pApp->Ver.nMajorVersion - pApp->iVer.nMajorVersion;
1628 if (nResult > 0) then return 1; endif;
1629 if (nResult < 0) then return -1; endif;
1631 // Major versions are equal, move on to minor versions
1632 nResult = pApp->Ver.nMinorVersion - pApp->iVer.nMinorVersion;
1633 if (nResult > 0) then return 1; endif;
1634 if (nResult < 0) then return -1; endif;
1636 // Minor versions are equal, move on to patch level.
1637 nResult = pApp->Ver.nPatchLevel - pApp->iVer.nPatchLevel;
1638 if (nResult > 0) then return 1; endif;
1639 if (nResult < 0) then return -1; endif;
1641 // Patch levels are equal, move on to release type.
1642 if ((pApp->Ver.szReleaseType = RELEASE_TYPE_GA) && (pApp->iVer.szReleaseType = RELEASE_TYPE_BETA)) then return 1; endif;
1643 if ((pApp->Ver.szReleaseType = RELEASE_TYPE_BETA) && (pApp->iVer.szReleaseType = RELEASE_TYPE_GA)) then return -1; endif;
1645 // Release types are equal. Special handling now required:
1647 // If this is a GA release, then there is no more info to look at, and the versions are equal.
1648 if (pApp->Ver.szReleaseType = RELEASE_TYPE_GA) then return 0; endif;
1650 // We have a Beta release, so we still have some info to check. Compare the beta release levels.
1651 nResult = pApp->Ver.nBetaLevel - pApp->iVer.nBetaLevel;
1652 if (nResult > 0) then return 1; endif;
1653 if (nResult < 0) then return -1; endif;
1655 // Beta versions are equal.
1660 ///////////////////////////////////////////////////////////////////////////////
1662 // Function: GetInstallAction
1664 // Purpose: This function decides what install action to perform for a
1665 // component and sets the display name accordingly.
1667 ///////////////////////////////////////////////////////////////////////////////
1668 function GetInstallAction(szCompName, bInstalled, szInstallMsg, szUpgradeMsg, szDowngradeMsg, szReinstallMsg, pApp)
1669 string szDisplayName;
1675 if (bInstalled) then
1676 nResult = CompareVersions(pApp);
1678 if (nResult = 0) then
1679 szDisplayName = szReinstallMsg;
1680 pApp->nInstallAction = ACTION_REINSTALL;
1682 elseif (nResult > 0) then
1683 szDisplayName = szUpgradeMsg;
1684 pApp->nInstallAction = ACTION_UPGRADE;
1685 Sprintf(szVerMsg, " %s", pApp->iVer.szTitle);
1687 else // Trying to install old version on top of new version
1688 szDisplayName = szDowngradeMsg;
1689 pApp->nInstallAction = ACTION_DOWNGRADE;
1690 Sprintf(szVerMsg, " %s", pApp->iVer.szTitle);
1693 szDisplayName = szInstallMsg;
1694 pApp->nInstallAction = ACTION_INSTALL;
1697 szDisplayName = szDisplayName + szVerMsg;
1699 ComponentSetData(MEDIA, szCompName, COMPONENT_FIELD_DISPLAYNAME, 0, szDisplayName);
1705 ///////////////////////////////////////////////////////////////////////////////
1707 // Function: GetInstallActions
1709 // Purpose: This function decides what install action to perform for each
1710 // component and sets the display name accordingly.
1712 ///////////////////////////////////////////////////////////////////////////////
1713 function GetInstallActions()
1715 // Decide what to do for each component and then set the display names appropriately
1716 GetInstallAction(CLIENT_COMP_NAME, bClientInstalled, @INSTALL_CLIENT_MSG, @UPGRADE_CLIENT_MSG, @DOWNGRADE_CLIENT_MSG, @REINSTALL_CLIENT_MSG, &appFullClient);
1717 GetInstallAction(SERVER_COMP_NAME, bServerInstalled, @INSTALL_SERVER_MSG, @UPGRADE_SERVER_MSG, @DOWNGRADE_SERVER_MSG, @REINSTALL_SERVER_MSG, &appServer);
1718 GetInstallAction(CC_COMP_NAME, bCcInstalled, @INSTALL_CC_MSG, @UPGRADE_CC_MSG, @DOWNGRADE_CC_MSG, @REINSTALL_CC_MSG, &appControlCenter);
1719 GetInstallAction(LIGHT_CLIENT_COMP_NAME, bLightClientInstalled, @INSTALL_LIGHT_CLIENT_MSG, @UPGRADE_LIGHT_CLIENT_MSG, @DOWNGRADE_LIGHT_CLIENT_MSG, @REINSTALL_LIGHT_CLIENT_MSG, &appLightClient);
1720 GetInstallAction(DOCS_COMP_NAME, bDocsInstalled, @INSTALL_DOCS_MSG, @UPGRADE_DOCS_MSG, @DOWNGRADE_DOCS_MSG, @REINSTALL_DOCS_MSG, &appDocs);
1723 ///////////////////////////////////////////////////////////////////////////////
1725 // Function: ClientSelectedOrInstalled
1727 // Purpose: This function checks whether or not the client is selected or if
1728 // it is already installed.
1730 ///////////////////////////////////////////////////////////////////////////////
1731 function ClientSelectedOrInstalled()
1733 if (bFullClientSel || bClientInstalled) then
1740 ///////////////////////////////////////////////////////////////////////////////
1742 // Function: AppVersionOk
1744 // Purpose: This function determines if a given app will have the correct
1745 // version after installation.
1747 ///////////////////////////////////////////////////////////////////////////////
1748 function AppVersionOk(bInstalled, bSel, pApp)
1751 // Here's the logic of this:
1753 // 1) If the app is not installed and
1754 // a) it's not being installed, then this app doesn't affect the version
1755 // restrictions, so return true
1756 // b) it will be installed, then it will get the version which this
1757 // installer installs, so the version will be ok
1759 // 2) If the app is installed and
1760 // a) the app is selected for reinstall, upgrade, or downgrade, then the
1761 // newly installed version will be the version this installer installs,
1762 // and so the version will be ok
1763 // b) the app is not selected for reinstall, upgrade, or downgrade, then
1764 // the version is ok only if the app's current version matches the
1765 // the version of this installer
1767 bOk = !bInstalled || bSel || (CompareVersions(pApp) = 0);
1773 ///////////////////////////////////////////////////////////////////////////////
1775 // Function: DialogShowSdAskComponentDialog
1777 // Purpose: This function asks the user which components to install
1778 // and what the destination folder should be.
1780 ///////////////////////////////////////////////////////////////////////////////
1781 function DialogShowSdAskComponentDialog()
1783 STRING szTitle, szMsg, szComponent, szFilename;
1784 BOOL bClient, bServer, bCc, bDocs, bVersionsOK;
1791 // If running WinNT hide the Light Client component. If the user wants to only
1792 // allow client installs, then hide all but the Client component as well. If not
1793 // running on NT, then hide all but the Light Client component.
1795 ComponentSetData(MEDIA, LIGHT_CLIENT_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1796 ComponentSelectItem(MEDIA, LIGHT_CLIENT_COMP_NAME, FALSE);
1798 if (FindFile(SRCDIR, ALLOW_ONLY_CLIENT_FLAG_FILENAME, szFilename) = 0) then
1799 ComponentSetData(MEDIA, SERVER_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1800 ComponentSetData(MEDIA, CC_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1801 ComponentSetData(MEDIA, DOCS_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1803 ComponentSelectItem(MEDIA, SERVER_COMP_NAME, FALSE);
1804 ComponentSelectItem(MEDIA, CC_COMP_NAME, FALSE);
1805 ComponentSelectItem(MEDIA, DOCS_COMP_NAME, FALSE);
1808 ComponentSetData(MEDIA, CLIENT_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1809 ComponentSetData(MEDIA, SERVER_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1810 ComponentSetData(MEDIA, CC_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1811 ComponentSetData(MEDIA, DOCS_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1813 ComponentSelectItem(MEDIA, SERVER_COMP_NAME, FALSE);
1814 ComponentSelectItem(MEDIA, CLIENT_COMP_NAME, FALSE);
1815 ComponentSelectItem(MEDIA, CC_COMP_NAME, FALSE);
1816 ComponentSelectItem(MEDIA, DOCS_COMP_NAME, FALSE);
1820 nResult = SdComponentDialog(szTitle, szMsg, svDir, szComponent);
1822 // Enforce selection rules - something must be selected and
1823 // the client must be selected if the server is. However, take into
1824 // account if it is already installed.
1825 bFullClientSel = ComponentIsItemSelected(MEDIA , CLIENT_COMP_NAME);
1826 bLightClientSel = ComponentIsItemSelected(MEDIA , LIGHT_CLIENT_COMP_NAME);
1827 bServerSel = ComponentIsItemSelected(MEDIA , SERVER_COMP_NAME);
1828 bCcSel = ComponentIsItemSelected(MEDIA , CC_COMP_NAME);
1829 bDocsSel = ComponentIsItemSelected(MEDIA , DOCS_COMP_NAME);
1831 if (!bFullClientSel && !bLightClientSel && !bServerSel && !bCcSel && !bDocsSel) then
1832 ShowError(@NOTHING_SELECTED_MSG, SEVERE);
1836 if (bServerSel && !ClientSelectedOrInstalled()) then
1837 ShowError(@SERVER_NEEDS_CLIENT_MSG, SEVERE);
1841 // Also, if upgrading or downgrading, all apps must be at the same version level.
1842 // We won't upgrade one app to a higer version than another, and we won't downgrade
1843 // one app to a lowel version than another. All must be at the same level when the
1844 // install program is done. This is necessary because the apps share some files.
1848 bClient = AppVersionOk(bClientInstalled, bFullClientSel, &appFullClient);
1849 bServer = AppVersionOk(bServerInstalled, bServerSel, &appServer);
1850 bCc = AppVersionOk(bCcInstalled, bCcSel, &appControlCenter);
1851 bDocs = AppVersionOk(bDocsInstalled, bDocsSel, &appDocs);
1852 bVersionsOK = bClient && bServer && bCc && bDocs;
1855 if (!bVersionsOK) then
1856 ShowError(@APPS_NOT_SAME_VERSION, SEVERE);
1867 ///////////////////////////////////////////////////////////////////////////////
1869 // Function: DialogShowSdSetupType
1871 // Purpose: This function displays the standard setup type dialog.
1873 ///////////////////////////////////////////////////////////////////////////////
1874 function DialogShowSdSetupType()
1875 NUMBER nResult, nType;
1876 STRING szTitle, szMsg, szReserved;
1880 if (svSetupType == "") then
1881 svSetupType = "AFS Server";
1885 szMsg = @SETUP_TYPE_MSG;
1888 nResult = SdSetupTypeEx(szTitle, szMsg, szReserved, svSetupType, 0);
1894 ///////////////////////////////////////////////////////////////////////////////
1896 // Function: DialogShowSdSelectFolder
1898 // Purpose: This function displays the standard folder selection dialog.
1901 ///////////////////////////////////////////////////////////////////////////////
1902 function DialogShowSdSelectFolder()
1904 STRING szTitle, szMsg;
1906 if (SHELL_OBJECT_FOLDER = "") then
1907 SHELL_OBJECT_FOLDER = @FOLDER_NAME;
1910 // We are going to force the user to use the default folder name. This is
1911 // because we create the folder unlogged, and must therefore remove it
1912 // ourselves in our uninstall dll (which we do because IS doesn't handle
1913 // removing them correctly). Therefore, we must know the name of the
1914 // folder so we can remove it during uninstall. Also, the user can install
1915 // the AFS components during several executions of the install program,
1916 // and we don't want to allow them to pick a different folder each time.
1917 // We could solve these problems in code but we don't have time, so we
1918 // are going to force them to use our default folder name.
1923 nResult = SdSelectFolder( szTitle, szMsg, SHELL_OBJECT_FOLDER);
1929 ///////////////////////////////////////////////////////////////////////////////
1931 // Function: DialogShowSdFinishReboot
1933 // Purpose: This function will show the last dialog of the product.
1934 // It will allow the user to reboot and/or show some readme text.
1936 ///////////////////////////////////////////////////////////////////////////////
1937 function DialogShowSdFinishReboot()
1938 NUMBER nResult, nDefOptions;
1939 STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
1940 NUMBER bOpt1, bOpt2;
1942 if (!BATCH_INSTALL) then
1945 szMsg1 = @SETUP_FINISHED_MSG;
1950 nResult = SdFinish(szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
1954 nDefOptions = SYS_BOOTMACHINE;
1958 nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );
1964 ///////////////////////////////////////////////////////////////////////////////
1966 // Function: ConfigServerService
1968 // Purpose: This function will configure the AFS Server bos service via the
1971 ///////////////////////////////////////////////////////////////////////////////
1972 function ConfigServerService()
1979 if (!bWSPPInstall) then
1980 szMsg = @CONFIGURING_AFS_SERVER_SERVICE;
1981 SdShowMsg(szMsg, TRUE);
1984 nStatus = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
1985 if (nStatus < 0) goto error;
1987 nStatus = InstallServerService(TARGETDIR ^ "\\Server\\usr\\afs\\bin\\bosctlsvc.exe");
1988 if (nStatus < 0) goto error;
1993 if (!bWSPPInstall) then
1994 SdShowMsg(szMsg, FALSE);
1998 Sprintf(szMsg, @AFS_SERVER_SERVICE_INSTALL_ERROR, nStatus);
1999 ShowError(szMsg, SEVERE);
2000 bInstallAborted = TRUE;
2008 ///////////////////////////////////////////////////////////////////////////////
2010 // Function: ConfigClientService
2012 // Purpose: This function will configure the AFS Client service via the SCM.
2014 ///////////////////////////////////////////////////////////////////////////////
2015 function ConfigClientService()
2022 if (!bWSPPInstall) then
2023 szMsg = @CONFIGURING_AFS_CLIENT_SERVICE;
2024 SdShowMsg(szMsg, TRUE);
2027 nStatus = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
2028 if (nStatus < 0) goto error;
2030 nStatus = InstallClientService(TARGETDIR ^ "\\Client\\Program\\afsd_service.exe");
2031 if (nStatus < 0) goto error;
2036 if (!bWSPPInstall) then
2037 SdShowMsg(szMsg, FALSE);
2041 Sprintf(szMsg, @AFS_CLIENT_SERVICE_INSTALL_ERROR, nStatus);
2042 ShowError(szMsg, SEVERE);
2043 bInstallAborted = TRUE;
2050 ///////////////////////////////////////////////////////////////////////////////
2052 // Function: AddPath
2054 // Purpose: This function will add the specified path to the system PATH
2055 // environment variable.
2057 ///////////////////////////////////////////////////////////////////////////////
2058 function AddPath(szPath)
2060 LongPathToShortPath(szPath);
2061 if (bWin98 || bWin95) then
2062 if (EzBatchAddPath ("Path", szPath, "", AFTER) < 0) then
2063 ShowError(@ADD_PATH_ERROR, WARNING);
2066 if (AddToPath(szPath) < 0) then
2067 ShowError(@ADD_PATH_ERROR, WARNING);
2074 ///////////////////////////////////////////////////////////////////////////////
2076 // Function: ConfigUninstallDLL
2078 // Purpose: This function will modify the uninstall entry for these products
2079 // to use an uninstall dll.
2081 ///////////////////////////////////////////////////////////////////////////////
2082 function ConfigUninstallDLL(pApp)
2086 if (!pApp->bUseUninstDLL) then
2090 nStatus = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
2091 if (nStatus < 0) goto error;
2093 svValue = UNINST + " -c\"" + pApp->szBinPath ^ pApp->szUninstDllName + "\" -f\"" + TARGETDIR ^ pApp->szUninstLogfileName + "\"";
2095 nStatus = RegDBSetKeyValueEx(MSUNINSTALL_KEY ^ pApp->szProductName, "UninstallString", REGDB_STRING, svValue, -1);
2096 if (nStatus < 0) goto error;
2105 ///////////////////////////////////////////////////////////////////////////////
2107 // Function: CreateServerDirs
2109 // Purpose: This function will create directories that the server programs
2110 // need. The creation of these is not logged, and so they will be
2111 // deleted by the uninstall dll.
2113 ///////////////////////////////////////////////////////////////////////////////
2114 function CreateServerDirs()
2116 CreateDir(TARGETDIR ^ "\\Server\\usr\\afs\\logs");
2117 CreateDir(TARGETDIR ^ "\\Server\\usr\\afs\\etc");
2118 CreateDir(TARGETDIR ^ "\\Server\\usr\\afs\\local");
2122 ///////////////////////////////////////////////////////////////////////////////
2124 // Function: GetDateTimeString()
2126 // Purpose: This function will return a string containing the current date
2129 ///////////////////////////////////////////////////////////////////////////////
2130 function GetDateTimeString(szDateTime)
2131 STRING szDate, szTime;
2132 NUMBER nDate, nTime;
2134 GetSystemInfo(DATE, nDate, szDate);
2135 GetSystemInfo(TIME, nTime, szTime);
2137 szDateTime = szDate + " " + szTime;
2141 ///////////////////////////////////////////////////////////////////////////////
2143 // Function: SetUserVars()
2145 // Purpose: This function will set at runtime values for user defined variables
2146 // we set up in the Registry Entries GUI tool.
2148 ///////////////////////////////////////////////////////////////////////////////
2149 function SetUserVars()
2151 string szInstallDate;
2154 string szReleaseType;
2156 // Set the install date variable's value
2157 GetDateTimeString(szInstallDate);
2159 ComponentSetTarget(MEDIA, "<INSTALL_DATE>", szInstallDate);
2161 // Set the proper client logon dll
2162 if (bFullClientSel) then
2163 ComponentSetTarget(MEDIA, "<LOGON_DLL>", TARGETDIR ^ FULL_CLIENT_LOGON_DLL);
2164 elseif (bLightClientSel) then
2165 ComponentSetTarget(MEDIA, "<LOGON_DLL>", TARGETDIR ^ LIGHT_CLIENT_LOGON_DLL);
2168 // Set the client description and title values
2169 if (bFullClientSel || bLightClientSel) then
2171 if (bFullClientSel) then
2172 szDesc = @CLIENT_DESC;
2173 szTitle = @CLIENT_TITLE;
2175 szDesc = @LIGHT_CLIENT_DESC;
2176 szTitle = @LIGHT_CLIENT_TITLE;
2179 ComponentSetTarget(MEDIA, "<CLIENT_DESC>", szDesc);
2180 ComponentSetTarget(MEDIA, "<CLIENT_TITLE>", szTitle);
2183 if (bServerSel) then
2184 ComponentSetTarget(MEDIA, "<EVENT_MSG_DLL>", TARGETDIR ^ "Common\\afseventmsg_" + szCodePage + ".dll");
2187 szReleaseType = @PRODUCT_VERSION_RELEASE_TYPE;
2188 ComponentSetTarget(MEDIA, "<RELEASE_TYPE>", szReleaseType);
2195 ///////////////////////////////////////////////////////////////////////////////
2197 // Function: SetNetworkProviderOrder()
2199 // Purpose: This function will add the AFS Client service name to the
2200 // ProviderOrder value of the
2201 // HKLM\SYSTEM\CurrentControlSet\ControlNetworkProvider\Order key.
2202 // It makes a call to the setup dll to do this.
2203 ///////////////////////////////////////////////////////////////////////////////
2204 function SetNetworkProviderOrder()
2207 nStatus = AddToNetworkProviderOrder(CLIENT_SERVICE_NAME);
2208 if (nStatus < 0) then
2209 ShowError(@SET_NETWORK_PROVIDER_ERROR, SEVERE);
2216 ///////////////////////////////////////////////////////////////////////////////
2218 // Function: CreateRegistrySets()
2220 // Purpose: This function will create the registry entries for each resgistry
2221 // set in the passed in string. The string must be a comma separated
2222 // list of registry sets created using the IS Registry Entries GUI.
2224 ///////////////////////////////////////////////////////////////////////////////
2225 function CreateRegistrySets(szRegistrySets)
2230 nRegSetListID = ListCreate(STRINGLIST);
2232 StrGetTokens(nRegSetListID, szRegistrySets, ",");
2234 nResult = ListGetFirstString(nRegSetListID, szRegSet);
2235 while (nResult != END_OF_LIST)
2236 // MessageBox(szRegSet, INFORMATION);
2237 CreateRegistrySet(szRegSet);
2238 nResult = ListGetNextString(nRegSetListID, szRegSet);
2241 ListDestroy(nRegSetListID);
2245 ///////////////////////////////////////////////////////////////////////////////
2247 // Function: ConfigAfsCreds()
2249 // Purpose: This function will config the AFS Client Credentials tool.
2251 ///////////////////////////////////////////////////////////////////////////////
2252 function ConfigAfsCreds()
2255 nResult = LaunchAppAndWait(TARGETDIR ^ "Client\\Program\\afscreds.exe", "/install", WAIT);
2256 if (nResult < 0) then
2257 ShowError(@CONFIGURING_AFS_CREDS_ERROR, INFORMATION);
2264 ///////////////////////////////////////////////////////////////////////////////
2266 // Function: IsAppInstalled
2268 // Purpose: This function will determine if an app is installed, and if it is,
2269 // will set its iVer info.
2271 ///////////////////////////////////////////////////////////////////////////////
2272 function IsAppInstalled(pApp)
2277 string szMajorVersion, szMinorVersion, szPatchLevel, szBetaLevel, szReleaseType, szTitle;
2279 nResult = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
2280 if (nResult < 0) goto error;
2282 szKey = COMPANY_REG_KEY ^ pApp->szProductName ^ "CurrentVersion";
2284 nResult = RegDBGetKeyValueEx(szKey, "MajorVersion", nType, szMajorVersion, nSize);
2285 if (nResult < 0) goto error;
2287 nResult = RegDBGetKeyValueEx(szKey, "MinorVersion", nType, szMinorVersion, nSize);
2288 if (nResult < 0) goto error;
2290 nResult = RegDBGetKeyValueEx(szKey, "PatchLevel", nType, szPatchLevel, nSize);
2291 if (nResult < 0) goto error;
2293 nResult = RegDBGetKeyValueEx(szKey, "BetaLevel", nType, szBetaLevel, nSize);
2294 // It's ok for this to fail. Pre-3.5 3.32 releases did not use this.
2296 nResult = RegDBGetKeyValueEx(szKey, "VersionString", nType, szTitle, nSize);
2297 if (nResult < 0) goto error;
2299 nResult = RegDBGetKeyValueEx(szKey, "ReleaseType", nType, szReleaseType, nSize);
2300 if (nResult < 0) then
2301 if ((pApp->szProductName = "AFS Client") && (szTitle = "3.4a")) then
2302 // This value won't exist for 3.4a clients
2303 szReleaseType = RELEASE_TYPE_GA;
2305 // This value won't exist for any 3.5 beta versions
2306 szReleaseType = RELEASE_TYPE_BETA;
2310 SetupVerInfo(pApp, szMajorVersion, szMinorVersion, szPatchLevel, szBetaLevel, szReleaseType, szTitle, TRUE);
2319 ///////////////////////////////////////////////////////////////////////////////
2321 // Function: LocalizeComponents()
2323 // Purpose: This function updates all components to use localized text
2324 // in their status fields as appropriate
2326 ///////////////////////////////////////////////////////////////////////////////
2327 function LocalizeComponents()
2329 LocalizeComponentStatusText ("Client\\Client_Common");
2330 LocalizeComponentStatusText ("Client\\Client_Program\\Client_Headers\\Client_Afs_Headers");
2331 LocalizeComponentStatusText ("Client\\Client_Program\\Client_Headers\\Client_Main_Headers");
2332 LocalizeComponentStatusText ("Client\\Client_Program\\Client_Headers\\Client_Rx_Headers");
2333 LocalizeComponentStatusText ("Client\\Client_Program\\Client_Headers");
2334 LocalizeComponentStatusText ("Client\\Client_Program\\Client_Sample");
2335 LocalizeComponentStatusText ("Client\\Client_Program");
2336 LocalizeComponentStatusText ("Client\\Client_System32");
2337 LocalizeComponentStatusText ("Client\\Client_WinDir");
2338 LocalizeComponentStatusText ("Client");
2339 LocalizeComponentStatusText ("Components");
2340 LocalizeComponentStatusText ("Control_Center\\Control_Center_Common");
2341 LocalizeComponentStatusText ("Control_Center\\Control_Center_Program");
2342 LocalizeComponentStatusText ("Control_Center\\Control_Center_System32");
2343 LocalizeComponentStatusText ("Control_Center\\Control_Center_WinDir");
2344 LocalizeComponentStatusText ("Control_Center");
2345 LocalizeComponentStatusText ("Documentation\\English\\Cmd_Ref");
2346 LocalizeComponentStatusText ("Documentation\\English\\Doc_Misc");
2347 LocalizeComponentStatusText ("Documentation\\English\\Sys_Admin_Guide");
2348 LocalizeComponentStatusText ("Documentation\\English");
2349 LocalizeComponentStatusText ("Documentation\\German\\Cmd_Ref");
2350 LocalizeComponentStatusText ("Documentation\\German\\Doc_Misc");
2351 LocalizeComponentStatusText ("Documentation\\German\\Sys_Admin_Guide");
2352 LocalizeComponentStatusText ("Documentation\\German");
2353 LocalizeComponentStatusText ("Documentation\\Japanese\\Cmd_Ref");
2354 LocalizeComponentStatusText ("Documentation\\Japanese\\Doc_Misc");
2355 LocalizeComponentStatusText ("Documentation\\Japanese\\Sys_Admin_Guide");
2356 LocalizeComponentStatusText ("Documentation\\Japanese");
2357 LocalizeComponentStatusText ("Documentation\\Korean\\Cmd_Ref");
2358 LocalizeComponentStatusText ("Documentation\\Korean\\Doc_Misc");
2359 LocalizeComponentStatusText ("Documentation\\Korean\\Sys_Admin_Guide");
2360 LocalizeComponentStatusText ("Documentation\\Korean");
2361 LocalizeComponentStatusText ("Documentation\\Portuguese\\Cmd_Ref");
2362 LocalizeComponentStatusText ("Documentation\\Portuguese\\Doc_Misc");
2363 LocalizeComponentStatusText ("Documentation\\Portuguese\\Sys_Admin_Guide");
2364 LocalizeComponentStatusText ("Documentation\\Portuguese");
2365 LocalizeComponentStatusText ("Documentation\\Simp_Chinese\\Cmd_Ref");
2366 LocalizeComponentStatusText ("Documentation\\Simp_Chinese\\Doc_Misc");
2367 LocalizeComponentStatusText ("Documentation\\Simp_Chinese\\Sys_Admin_Guide");
2368 LocalizeComponentStatusText ("Documentation\\Simp_Chinese");
2369 LocalizeComponentStatusText ("Documentation\\Spanish\\Cmd_Ref");
2370 LocalizeComponentStatusText ("Documentation\\Spanish\\Doc_Misc");
2371 LocalizeComponentStatusText ("Documentation\\Spanish\\Sys_Admin_Guide");
2372 LocalizeComponentStatusText ("Documentation\\Spanish");
2373 LocalizeComponentStatusText ("Documentation\\Trad_Chinese\\Cmd_Ref");
2374 LocalizeComponentStatusText ("Documentation\\Trad_Chinese\\Doc_Misc");
2375 LocalizeComponentStatusText ("Documentation\\Trad_Chinese\\Sys_Admin_Guide");
2376 LocalizeComponentStatusText ("Documentation\\Trad_Chinese");
2377 LocalizeComponentStatusText ("Documentation");
2378 LocalizeComponentStatusText ("Info");
2379 LocalizeComponentStatusText ("Languages\\Lang_English");
2380 LocalizeComponentStatusText ("Languages\\Lang_German");
2381 LocalizeComponentStatusText ("Languages\\Lang_Japanese");
2382 LocalizeComponentStatusText ("Languages\\Lang_Korean");
2383 LocalizeComponentStatusText ("Languages\\Lang_Portuguese");
2384 LocalizeComponentStatusText ("Languages\\Lang_Simp_Chinese");
2385 LocalizeComponentStatusText ("Languages\\Lang_Spanish");
2386 LocalizeComponentStatusText ("Languages\\Lang_Trad_Chinese");
2387 LocalizeComponentStatusText ("Languages");
2388 LocalizeComponentStatusText ("Light_Client\\Win95\\Light95_Client_Common");
2389 LocalizeComponentStatusText ("Light_Client\\Win95\\Light95_Client_Program");
2390 LocalizeComponentStatusText ("Light_Client\\Win95\\Light95_Client_System32");
2391 LocalizeComponentStatusText ("Light_Client\\Win95\\Light95_Client_WinDir");
2392 LocalizeComponentStatusText ("Light_Client\\Win95");
2393 LocalizeComponentStatusText ("Light_Client\\Win98\\Light_Client_Common");
2394 LocalizeComponentStatusText ("Light_Client\\Win98\\Light_Client_Program");
2395 LocalizeComponentStatusText ("Light_Client\\Win98\\Light_Client_System32");
2396 LocalizeComponentStatusText ("Light_Client\\Win98\\Light_Client_WinDir");
2397 LocalizeComponentStatusText ("Light_Client\\Win98");
2398 LocalizeComponentStatusText ("Light_Client");
2399 LocalizeComponentStatusText ("Readme\\English\\Doc_Misc");
2400 LocalizeComponentStatusText ("Readme\\English\\Install_Guide");
2401 LocalizeComponentStatusText ("Readme\\English\\Release_Notes");
2402 LocalizeComponentStatusText ("Readme\\English");
2403 LocalizeComponentStatusText ("Readme\\German\\Doc_Misc");
2404 LocalizeComponentStatusText ("Readme\\German\\Install_Guide");
2405 LocalizeComponentStatusText ("Readme\\German\\Release_Notes");
2406 LocalizeComponentStatusText ("Readme\\German");
2407 LocalizeComponentStatusText ("Readme\\Japanese\\Doc_Misc");
2408 LocalizeComponentStatusText ("Readme\\Japanese\\Install_Guide");
2409 LocalizeComponentStatusText ("Readme\\Japanese\\Release_Notes");
2410 LocalizeComponentStatusText ("Readme\\Japanese");
2411 LocalizeComponentStatusText ("Readme\\Korean\\Doc_Misc");
2412 LocalizeComponentStatusText ("Readme\\Korean\\Install_Guide");
2413 LocalizeComponentStatusText ("Readme\\Korean\\Release_Notes");
2414 LocalizeComponentStatusText ("Readme\\Korean");
2415 LocalizeComponentStatusText ("Readme\\Portuguese\\Doc_Misc");
2416 LocalizeComponentStatusText ("Readme\\Portuguese\\Install_Guide");
2417 LocalizeComponentStatusText ("Readme\\Portuguese\\Release_Notes");
2418 LocalizeComponentStatusText ("Readme\\Portuguese");
2419 LocalizeComponentStatusText ("Readme\\Simp_Chinese\\Doc_Misc");
2420 LocalizeComponentStatusText ("Readme\\Simp_Chinese\\Install_Guide");
2421 LocalizeComponentStatusText ("Readme\\Simp_Chinese\\Release_Notes");
2422 LocalizeComponentStatusText ("Readme\\Simp_Chinese");
2423 LocalizeComponentStatusText ("Readme\\Spanish\\Doc_Misc");
2424 LocalizeComponentStatusText ("Readme\\Spanish\\Install_Guide");
2425 LocalizeComponentStatusText ("Readme\\Spanish\\Release_Notes");
2426 LocalizeComponentStatusText ("Readme\\Spanish");
2427 LocalizeComponentStatusText ("Readme\\Trad_Chinese\\Doc_Misc");
2428 LocalizeComponentStatusText ("Readme\\Trad_Chinese\\Install_Guide");
2429 LocalizeComponentStatusText ("Readme\\Trad_Chinese\\Release_Notes");
2430 LocalizeComponentStatusText ("Readme\\Trad_Chinese");
2431 LocalizeComponentStatusText ("Readme");
2432 LocalizeComponentStatusText ("Server\\Server_Common");
2433 LocalizeComponentStatusText ("Server\\Server_Program");
2434 LocalizeComponentStatusText ("Server\\Server_System32");
2435 LocalizeComponentStatusText ("Server\\Server_WinDir");
2436 LocalizeComponentStatusText ("Server");
2440 ///////////////////////////////////////////////////////////////////////////////
2442 // Function: LocalizeComponentStatusText()
2444 // Purpose: This function updates one component to use localized text
2445 // in its status fields as appropriate
2447 ///////////////////////////////////////////////////////////////////////////////
2448 function LocalizeComponentStatusText (svComponent)
2453 ComponentGetData (MEDIA, svComponent, COMPONENT_FIELD_STATUS, dwResult, svOriginal);
2455 if (svOriginal == "CLIENT") then
2456 svLocalized = @STATUS_INSTALLING_CLIENT;
2457 elseif (svOriginal == "SERVER") then
2458 svLocalized = @STATUS_INSTALLING_SERVER;
2459 elseif (svOriginal == "CCENTER") then
2460 svLocalized = @STATUS_INSTALLING_CCENTER;
2461 elseif (svOriginal == "LIGHT") then
2462 svLocalized = @STATUS_INSTALLING_LIGHT;
2463 elseif (svOriginal == "HEADERS") then
2464 svLocalized = @STATUS_INSTALLING_HEADERS;
2465 elseif (svOriginal == "DOCS") then
2466 svLocalized = @STATUS_INSTALLING_DOCS;
2467 elseif (svOriginal == "LANGUAGE") then
2468 svLocalized = @STATUS_INSTALLING_LANGUAGE;
2473 ComponentSetData(MEDIA, svComponent, COMPONENT_FIELD_STATUS, 0, svLocalized);
2477 ///////////////////////////////////////////////////////////////////////////////
2479 // Function: DetectInstalledComponents()
2481 // Purpose: This function will detect if any of our components is already
2484 ///////////////////////////////////////////////////////////////////////////////
2485 function DetectInstalledComponents()
2488 bClientInstalled = IsAppInstalled(&appFullClient);
2489 bServerInstalled = IsAppInstalled(&appServer);
2490 bCcInstalled = IsAppInstalled(&appControlCenter);
2491 bDocsInstalled = IsAppInstalled(&appDocs);
2493 // The light client uses the client's registry entries. There is a light
2494 // client entry, but it contains nothing under it. IS makes it but we
2496 bLightClientInstalled = IsAppInstalled(&appLightClient);
2501 ///////////////////////////////////////////////////////////////////////////////
2503 // Function: ParseCommandLine
2505 // Purpose: This function parses the command line to set up a silent install
2507 ///////////////////////////////////////////////////////////////////////////////
2508 function ParseCommandLine()
2510 STRING szTemp, szResult[MAX_STRING_LEN], szParms;
2513 bWSPPInstall = FALSE;
2514 bPreinstallReplace = FALSE;
2518 // Need a list to hold the parms
2519 listParms = ListCreate(STRINGLIST);
2521 // Break parms into semicolon separated tokens and put into list
2522 if (StrGetTokens(listParms, szParms, ";") = 0 ) then
2523 nResult = ListGetFirstString(listParms, szResult);
2525 // Do until the end of the list
2526 while (nResult != END_OF_LIST)
2527 if (StrFind(szResult, "DIR=") > -1 ) then
2528 nResult = StrSub(szTemp, szResult, 4, MAX_STRING_LEN);
2529 TARGETDIR = szTemp + "\\AFS";
2531 elseif (StrFind(szResult, "P=") > -1 ) then
2532 nResult = StrSub(szTemp, szResult, StrFind(szResult, "P=") + 2, 1);
2533 if (StrFind(szTemp, "Y") > -1 ) then
2534 bPreinstallReplace = TRUE;
2537 elseif (StrFind(szResult, "C=") > -1 ) then
2538 ProcessCompsOnCmdLn(szResult);
2541 nResult = ListGetNextString(listParms, szResult);
2547 ///////////////////////////////////////////////////////////////////////////////
2549 // Function: ProcessCompsOnCmdLn
2551 // Purpose: This function puts the components in a list and
2552 // checks for setup types on the command line.
2555 ///////////////////////////////////////////////////////////////////////////////
2556 function ProcessCompsOnCmdLn(szParms)
2557 NUMBER nResult, nIndex;
2560 bWSPPInstall = TRUE;
2562 // Strip c= off cmdln string
2563 nResult = StrSub(szParms, szParms, StrFind(szParms, "C=") + 2, StrLength(szParms) - 2);
2565 // Get each component from the cmd line
2566 while (StrLength(szParms))
2567 nIndex = StrSub(szComp, szParms, 0, StrFind(szParms, ","));
2568 if (!nIndex) then // if comma not found then last item in list
2570 nIndex = StrLength(szComp); // for extracting this string
2573 if (StrFind(szComp, "Client") > -1) then
2574 bFullClientSel = TRUE;
2575 elseif (StrFind(szComp, "Server") > -1) then
2577 elseif (StrFind(szComp, "ControlCtr") > -1) then
2581 // Delete component from the command line string
2582 StrSub(szParms, szParms, nIndex + 1, StrLength(szParms));
2587 ///////////////////////////////////////////////////////////////////////////////
2589 // Function: RemoveInstalledBits
2591 // Purpose: This function silently uninstalls a product.
2593 ///////////////////////////////////////////////////////////////////////////////
2594 function RemoveInstalledBits(szProductName)
2597 string szValue[MAX_STRING_LEN];
2598 string szProgram[256];
2599 string szCmdLine[128];
2603 // Check for a special case - version 3.4a of the AFS Client
2604 if ((szProductName = "AFS Client") && (appFullClient.iVer.szTitle = "3.4a")) then
2605 return Eradicate34Client();
2608 nStatus = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
2609 if (nStatus < 0) goto error;
2611 nStatus = RegDBGetKeyValueEx(MSUNINSTALL_KEY ^ szProductName, "UninstallString", nType, szValue, nSize);
2612 if (nStatus < 0) goto error;
2614 nIndex = StrFind(szValue, " ");
2615 if (nIndex < 0) goto error;
2617 StrSub(szProgram, szValue, 0, nIndex);
2618 StrSub(szCmdLine, szValue, nIndex + 1, 128);
2620 // Make the uninstall run silently
2621 szCmdLine = szCmdLine + " -a";
2623 nStatus = LaunchAppAndWait(szProgram, szCmdLine, WAIT);
2624 if (nStatus < 0) goto error;
2633 ///////////////////////////////////////////////////////////////////////////////
2635 // Function: AddShortCut
2637 // Purpose: Adds a short cut to the start menu.
2639 ///////////////////////////////////////////////////////////////////////////////
2640 function AddShortCut(szFolder, szName, szCmdPath, szArgs)
2644 szCmdPath = TARGETDIR ^ szCmdPath;
2645 LongPathToQuote(szCmdPath, TRUE);
2647 szCmd = szCmdPath + " " + szArgs;
2649 nResult = AddFolderIcon(SHELL_OBJECT_FOLDER ^ szFolder, szName, szCmd, "", "", 0, "", REPLACE);
2655 ///////////////////////////////////////////////////////////////////////////////
2657 // Function: CreateStartMenuEntries
2659 // Purpose: This function creates start menu entries for our apps.
2661 ///////////////////////////////////////////////////////////////////////////////
2662 function CreateStartMenuEntries()
2664 if (bServerSel) then
2665 AddShortCut(@SERVER_GROUP_NAME, @CFG_WIZARD_ITEM_NAME, CFG_WIZARD_CMD_PATH, CFG_WIZARD_ARGS);
2668 if (bFullClientSel) then
2669 AddShortCut(@CLIENT_GROUP_NAME, @CREDS_TOOL_ITEM_NAME, CREDS_TOOL_CMD_PATH, CREDS_TOOL_ARGS);
2670 AddShortCut(@CLIENT_GROUP_NAME, @CLIENT_HELP_ITEM_NAME, CLIENT_HELP_CMD_PATH, CLIENT_HELP_ARGS);
2674 AddShortCut(@CCENTER_GROUP_NAME, @SERVER_MANAGER_ITEM_NAME, SERVER_MANAGER_CMD_PATH, SERVER_MANAGER_ARGS);
2675 AddShortCut(@CCENTER_GROUP_NAME, @ACCT_MANAGER_ITEM_NAME, ACCT_MANAGER_CMD_PATH, ACCT_MANAGER_ARGS);
2678 if (bLightClientSel) then
2679 AddShortCut(@LIGHT_GROUP_NAME, @CREDS_TOOL_ITEM_NAME, CREDS_TOOL_CMD_PATH, CREDS_TOOL_ARGS);
2680 AddShortCut(@LIGHT_GROUP_NAME, @LIGHT_CLIENT_HELP_ITEM_NAME, LIGHT_CLIENT_HELP_CMD_PATH, LIGHT_CLIENT_HELP_ARGS);
2683 AddShortCut("", @DOCUMENTATION_ITEM_NAME, DOCUMENTATION_CMD_PATH, DOCUMENTATION_ARGS);
2687 ///////////////////////////////////////////////////////////////////////////////
2689 // Function: ShowError
2691 // Purpose: This function shows an error to the user when not in silent mode,
2692 // and will log an error to a file when in silent mode.
2694 ///////////////////////////////////////////////////////////////////////////////
2695 function ShowError(szMsg, nType)
2699 if (!bWSPPInstall) then
2700 MessageBox(szMsg, nType);
2705 case WARNING: szType = "Warning: ";
2706 case SEVERE: szType = "Error: ";
2707 case INFORMATION: szType = "Note: ";
2708 default: szType = "Unknown error type: ";
2711 WriteToInstallErrorLog(szType + szMsg);
2715 ///////////////////////////////////////////////////////////////////////////////
2717 // Function: CheckCopyCellServDB
2719 // Purpose: During install the CellServDB file is copied into the Common dir.
2720 // If the user does not already have this file, we will copy it for
2721 // them into the windows directory. If they already do have the
2722 // file, then we will do nothing.
2723 ///////////////////////////////////////////////////////////////////////////////
2724 function CheckCopyCellServDB()
2728 nResult = FindFile(WINDIR, CELLSERVDB_FILENAME, szResult);
2729 if (nResult < 0) then
2730 VarSave(SRCTARGETDIR);
2731 SRCDIR = TARGETDIR ^ "Common";
2733 CopyFile(CELLSERVDB_FILENAME, CELLSERVDB_FILENAME);
2734 VarRestore(SRCTARGETDIR);
2739 // --- include script file section ---
2740 #include "sddialog.rul"