1 ////////////////////////////////////////////////////////////////////////////////
3 // Copyright (C) 1998 Transarc Corporation.
4 // All rights reserved.
7 // File Name: Setup.rul
9 // Description: InstallShield script
11 ////////////////////////////////////////////////////////////////////////////////
14 // Include header files
19 ////////////////////// string defines ////////////////////////////
21 // If the user places a file with this name in the same directory as
22 // the setup files, only the client component will be available for
23 // install. The contents of this file are not used.
24 #define ALLOW_ONLY_CLIENT_FLAG_FILENAME "setup.co"
27 #define RELEASE_TYPE_GA "GA"
28 #define RELEASE_TYPE_BETA "Beta"
30 // Client logon dll names
31 #define FULL_CLIENT_LOGON_DLL "Client\\PROGRAM\\afslogon.dll"
32 #define LIGHT_CLIENT_LOGON_DLL "Client\\PROGRAM\\afslog95.dll"
34 // Uninstall log file names for each component
35 #define SERVER_UNINST_LOGFILE_NAME "Server_Uninst.isu"
36 #define CLIENT_UNINST_LOGFILE_NAME "Client_Uninst.isu"
37 #define LIGHT_CLIENT_UNINST_LOGFILE_NAME "Light_Client_Uninst.isu"
38 #define CC_UNINST_LOGFILE_NAME "CC_Uninst.isu"
39 #define DOCS_UNINST_LOGFILE_NAME "Docs_Uninst.isu"
41 // Uninstall dll names for each component
42 #define SERVER_UNINST_DLL_NAME "ServerUninst.dll"
43 #define CLIENT_UNINST_DLL_NAME "ClientUninst.dll"
44 #define CC_UNINST_DLL_NAME "CCUninst.dll"
45 #define LIGHT_CLIENT_UNINST_DLL_NAME "LightClientUninst.dll"
46 #define DOCS_UNINST_DLL_NAME "DocsUninst.dll"
48 // These are the components the user sees
49 #define CLIENT_COMP_NAME "Client"
50 #define LIGHT_CLIENT_COMP_NAME "Light_Client"
51 #define SERVER_COMP_NAME "Server"
52 #define CC_COMP_NAME "Control_Center"
54 // Light Client platform components
55 #define LIGHT95_CLIENT_COMP_NAME "Light_Client\\Win95"
56 #define LIGHT98_CLIENT_COMP_NAME "Light_Client\\Win98"
58 // This is added to autoexec.bat on Win95 systems
59 #define LIGHT95_CLIENT_PROTSEQ "AFS_RPC_PROTSEQ=ncacn_ip_tcp"
61 // Language components
62 #define LANG_COMP_NAME "Languages"
63 #define LANG_ENGLISH_COMP_NAME "Languages\\Lang_English"
64 #define LANG_SIMP_CHINESE_COMP_NAME "Languages\\Lang_Simp_Chinese"
65 #define LANG_TRAD_CHINESE_COMP_NAME "Languages\\Lang_Trad_Chinese"
66 #define LANG_KOREAN_COMP_NAME "Languages\\Lang_Korean"
67 #define LANG_JAPANESE_COMP_NAME "Languages\\Lang_Japanese"
68 #define LANG_GERMAN_COMP_NAME "Languages\\Lang_German"
69 #define LANG_SPANISH_COMP_NAME "Languages\\Lang_Spanish"
70 #define LANG_PORTUGUESE_COMP_NAME "Languages\\Lang_Portuguese"
72 // Documentation components
73 #define DOCS_COMP_NAME "Documentation"
74 #define DOCS_ENGLISH_COMP_NAME "Documentation\\English"
75 #define DOCS_JAPANESE_COMP_NAME "Documentation\\Japanese"
76 #define DOCS_KOREAN_COMP_NAME "Documentation\\Korean"
77 #define DOCS_SIMP_CHINESE_COMP_NAME "Documentation\\Simp_Chinese"
78 #define DOCS_TRAD_CHINESE_COMP_NAME "Documentation\\Trad_Chinese"
79 #define DOCS_GERMAN_COMP_NAME "Documentation\\German"
80 #define DOCS_SPANISH_COMP_NAME "Documentation\\Spanish"
81 #define DOCS_PORTUGUESE_COMP_NAME "Documentation\\Portuguese"
83 // Readme files components
84 #define README_COMP_NAME "Readme"
85 #define README_ENGLISH_COMP_NAME "Readme\\English"
86 #define README_JAPANESE_COMP_NAME "Readme\\Japanese"
87 #define README_KOREAN_COMP_NAME "Readme\\Korean"
88 #define README_SIMP_CHINESE_COMP_NAME "Readme\\Simp_Chinese"
89 #define README_TRAD_CHINESE_COMP_NAME "Readme\\Trad_Chinese"
90 #define README_GERMAN_COMP_NAME "Readme\\German"
91 #define README_SPANISH_COMP_NAME "Readme\\Spanish"
92 #define README_PORTUGUESE_COMP_NAME "Readme\\Portuguese"
95 #define LICENSE_ENGLISH_FILENAME "License\\en_US.rtf"
96 #define LICENSE_JAPANESE_FILENAME "License\\ja_JP.rtf"
97 #define LICENSE_KOREAN_FILENAME "License\\ko_KR.rtf"
98 #define LICENSE_SIMP_CHINESE_FILENAME "License\\zh_CN.rtf"
99 #define LICENSE_TRAD_CHINESE_FILENAME "License\\zh_TW.rtf"
100 #define LICENSE_GERMAN_FILENAME "License\\de_DE.rtf"
101 #define LICENSE_SPANISH_FILENAME "License\\es_ES.rtf"
102 #define LICENSE_PORTUGUESE_FILENAME "License\\pt_BR.rtf"
104 #define SETUP_UTILS_DLL_PATH "InstallUtils.dll"
106 // Some registry keys
107 #define MSUNINSTALL_KEY "\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
108 #define COMPANY_REG_KEY "Software\\TransarcCorporation\\"
109 #define CONFIG_INFO_KEY "Software\\AfsPreservedConfigInfo"
111 #define CLIENT_SERVICE_NAME "TransarcAFSDaemon"
113 // Client help file names
114 #define CLIENT_HELP_FILE_NAME "Common\\afs-nt.hlp"
115 #define LIGHT_CLIENT_HELP_FILE_NAME "Common\\afs-light.hlp"
117 #define MAX_STRING_LEN 512
120 #define ACTION_NONE 0
121 #define ACTION_INSTALL 1
122 #define ACTION_REINSTALL 2
123 #define ACTION_UPGRADE 3
124 #define ACTION_DOWNGRADE 4
126 // Documenation start menu info
127 #define DOCUMENTATION_CMD_PATH "Documentation\\Html\\index.htm"
128 #define DOCUMENTATION_ARGS ""
130 #define DOCUMENTATION_LICENSE_PATH "Documentation\\Html\\license.rtf"
132 // Application start menu info
133 #define CFG_WIZARD_CMD_PATH "Server\\usr\\afs\\bin\\afssvrcfg.exe"
134 #define CFG_WIZARD_ARGS "/wizard"
135 #define CREDS_TOOL_CMD_PATH "Client\\Program\\afscreds.exe"
136 #define CREDS_TOOL_ARGS "/show"
137 #define CLIENT_HELP_CMD_PATH "Common\\afs-nt.hlp"
138 #define CLIENT_HELP_ARGS ""
139 #define LIGHT_CLIENT_HELP_CMD_PATH "Common\\afs-light.hlp"
140 #define LIGHT_CLIENT_HELP_ARGS ""
141 #define SERVER_MANAGER_CMD_PATH "Control Center\\TaAfsServerManager.exe"
142 #define SERVER_MANAGER_ARGS ""
143 #define ACCT_MANAGER_CMD_PATH "Control Center\\TaAfsAccountManager.exe"
144 #define ACCT_MANAGER_ARGS ""
146 #define CELLSERVDB_FILENAME "afsdcell.ini"
156 //////////////////// installation declarations ///////////////////
164 string szReleaseType[32];
169 // NOTE: There is a problem with the IS registry set functionality in that if
170 // you specify to write a value under an existing key, at uninstall time
171 // not just the value will be removed, but the KEY AND ALL ITS SUBKEYS
172 // will also be removed. So the registry sets can only be used to
173 // create entries in the registry that are for values under keys that
176 // There are some values that we need to create that live under existing
177 // NT keys, so when we create them we must turn off logging. The
178 // szNoLogRegistrySets tell us which to create without logging.
182 string szCompName[64];
183 string szCompanyName[64];
184 string szProductName[128];
185 VERINFO Ver; // Version of this product
186 VERINFO iVer; // Verison of this product that is already installed
187 string szProductKey[128];
189 string szUninstDllName[64];
190 string szUninstLogfileName[64];
191 string szUninstKey[128];
192 string szAppPath[256]; // Below TARGETDIR
193 string szBinPath[256]; // Path to binaries and uninstall dll
194 BOOL bAddToPath; // TRUE if bin path should be added to path env var
195 string szUninstDisplayName[128];
196 string szRegistrySets[256]; // Comma separated list of registry sets to install
197 string szNoLogRegistrySets[256]; // Comma separated list of registry sets to install without logging
199 BOOL bInstallSucceeded;
204 // ----- DLL function prototypes -----
207 // ----- DLL prototypes -----
209 // your DLL prototypes
210 prototype int InstallUtils.InstallServerService(string);
211 prototype int InstallUtils.InstallClientService(string);
212 prototype int InstallUtils.AddToPath(string);
213 prototype int InstallUtils.AddToNetworkProviderOrder(string);
214 prototype int InstallUtils.CheckIfAdmin();
215 prototype int InstallUtils.SetSilentMode();
216 prototype int InstallUtils.WriteToInstallErrorLog(string);
217 prototype int InstallUtils.RestoreConfigInfo(int);
218 prototype int InstallUtils.Eradicate34Client();
219 prototype int InstallUtils.Upgrade34ClientConfigInfo();
220 prototype int InstallUtils.IsWin98();
221 prototype int InstallUtils.ShowLicense(string,string);
224 // ---- script function prototypes -----
226 // generated by the Project Wizard
227 prototype ShowDialogs();
228 prototype MoveFileData();
229 prototype HandleMoveDataError( NUMBER );
230 prototype ProcessBeforeDataMove(APPINFO POINTER);
231 prototype ProcessAfterDataMove();
232 prototype SetupRegistry();
233 prototype CleanUpInstall();
234 prototype SetupInstall();
235 prototype SetupScreen();
236 prototype CheckRequirements();
237 prototype DialogShowSdWelcome();
238 prototype DialogShowSdAskDestPath();
239 prototype DialogShowSdSetupType();
240 prototype DialogShowSdSelectFolder();
241 prototype DialogShowSdFinishReboot();
243 // your script function prototypes
244 prototype FixTargetPaths();
245 prototype SetupAppInfo();
246 prototype LocalizeComponents();
247 prototype LocalizeComponentStatusText (STRING);
248 prototype InstallApp(APPINFO POINTER);
249 prototype DialogShowSdAskComponentDialog();
250 prototype ShowIsSelected(string);
251 prototype ShowSelectedComponents();
252 prototype ConfigClientService();
253 prototype ConfigServerService();
254 prototype AddPath(string);
255 prototype AddBinPaths();
256 prototype ConfigUninstallDLL(APPINFO POINTER);
257 prototype CreateServerDirs();
258 prototype SetUserVars();
259 prototype SetNetworkProviderOrder();
260 prototype CreateRegistrySets(string);
261 prototype ConfigAfsCreds();
262 prototype GetLicenseFilename(BYREF string);
263 prototype GetNlsComps(BYREF string, BYREF string, BYREF string, BYREF string);
264 prototype DetectInstalledComponents();
265 prototype IsAppInstalled(APPINFO POINTER);
266 prototype ProcessCompsOnCmdLn(string);
267 prototype ParseCommandLine();
268 prototype GetVersionNumber(string);
269 prototype GetInstallAction(string, BOOL, string, string, string, string, APPINFO POINTER);
270 prototype GetInstallActions();
271 prototype ClientSelectedOrInstalled();
272 prototype RenameUninstDll(APPINFO POINTER);
273 prototype RemoveInstalledBits(string);
274 prototype PrepareForWSPPInstall();
275 prototype CreateStartMenuEntries();
276 prototype ShowError(string, int);
277 prototype GetDateTimeString(BYREF string);
278 prototype OnlyInstallingDocs();
279 prototype CreateDirs();
280 prototype AddShortCut(string, string, string, string);
281 prototype CheckCopyCellServDB();
282 prototype RestorePreviousConfigs();
283 prototype RemoveCurrentVersion(APPINFO POINTER);
284 prototype DoesConfigInfoExist(APPINFO POINTER);
285 prototype UnselectComps();
286 prototype AnyNonUpgradableSoftwareInstalled();
287 prototype RemoveAllCurrentVersions();
288 prototype AppVersionOk(BOOL, BOOL, APPINFO POINTER);
289 prototype SetupVerInfo(APPINFO POINTER, string, string, string, string, string, string, BOOL);
290 prototype NotUpgradable(APPINFO POINTER);
291 prototype CompareVersions(APPINFO POINTER);
293 // ----- global variables ------
295 // generated by the Project Wizard
296 BOOL bWin95, bWin98, bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
298 STRING svName, svCompany, svSerial;
304 // your global variables
305 APPINFO appFullClient;
306 APPINFO appLightClient;
308 APPINFO appControlCenter;
310 APPINFO POINTER pApp;
312 BOOL bFullClientSel, bServerSel, bCcSel, bLightClientSel, bDocsSel;
313 string szCommonBinPath;
315 BOOL bClientInstalled, bServerInstalled, bCcInstalled, bLightClientInstalled, bDocsInstalled;
316 string szLangComp, szReadmeComp, szDocsComp;
320 BOOL bPreinstallReplace;
323 ///////////////////////////////////////////////////////////////////////////////
327 // The setup begins here by hiding the visible setup
328 // window. This is done to allow all the titles, images, etc. to
329 // be established before showing the main window. The setup is
330 // then performed in a series of calls to script defined functions,
331 // with error checking at each step.
333 ///////////////////////////////////////////////////////////////////////////////
335 Disable( BACKGROUND );
337 if (UseDLL(SUPPORTDIR ^ SETUP_UTILS_DLL_PATH) < 0) then
338 ShowError(@SETUPUTILS_NOT_FOUND, SEVERE);
339 bInstallAborted = TRUE;
351 LocalizeComponents();
353 DetectInstalledComponents();
355 // Can't upgrade, downgrade, or reinstall the light client, so if it is
356 // already installed, we must abort. This is because on Win9x, we can't
357 // move in-use files, and so we can't silently uninstall the light client,
358 // which upgrade, downgrade, and reinstall require.
359 if (bLightClientInstalled && !bWinNT) then
360 ShowError(@LIGHT_CLIENT_ALREADY_INSTALLED_MSG, SEVERE);
361 bInstallAborted = TRUE;
365 if (AnyNonUpgradableSoftwareInstalled()) then
366 ShowError(@NON_UPGRADABLE_SOFTWARE_INSTALLED_ERROR_MSG, SEVERE);
367 bInstallAborted = TRUE;
373 if (bWSPPInstall) then
374 SetSilentMode(); // Tells the InstallUtils dll to run silently
375 PrepareForWSPPInstall();
377 // Ask user what to install
379 if (ShowDialogs()<0) goto end_install;
382 // The AFS path must not contain spaces. AFS code will break if it does.
383 LongPathToShortPath(TARGETDIR);
385 // Determine which comps to install to get the proper NLS files.
386 GetNlsComps(szLangComp, szReadmeComp, szDocsComp, szCodePage);
392 // Uninstall current versions before we install
393 RemoveAllCurrentVersions();
395 // Install the Client
396 if (bFullClientSel) then
397 pApp = &appFullClient;
398 if (InstallApp(pApp) < 0) goto end_install;
401 // Install the Light Client
402 if (bLightClientSel) then
403 pApp = &appLightClient;
404 if (InstallApp(pApp) < 0) goto end_install;
406 EzBatchAddString(LIGHT95_CLIENT_PROTSEQ, "", AFTER | REPLACE);
410 // Install the Server
413 if (InstallApp(pApp) < 0) goto end_install;
417 // Install the Control Center
419 pApp = &appControlCenter;
420 if (InstallApp(pApp) < 0) goto end_install;
425 appDocs.szCompName = szDocsComp;
427 if (InstallApp(pApp) < 0) goto end_install;
430 // If we installed the server, then configure the bos service
432 if (ConfigServerService() < 0) goto end_install;
435 // If we installed the full client, then configure the client service
436 // and add the NetworkProviderOrder value.
437 if (bFullClientSel) then
438 if (ConfigClientService() < 0) goto end_install;
439 // I'm commenting out the line below. This will result in integrated
440 // login being off after an install. If you want it to be on after an
441 // install, then uncomment the line.
442 // if (SetNetworkProviderOrder() < 0) goto end_install;
445 if (bFullClientSel || bLightClientSel) then
449 RestorePreviousConfigs();
451 AddPath(szCommonBinPath);
453 // If not only installing docs, then set BATCH_INSTALL to true,
454 // which will cause setup to want to reboot the computer.
455 if (OnlyInstallingDocs() == FALSE) then
456 BATCH_INSTALL = TRUE;
459 CreateStartMenuEntries();
461 if (bFullClientSel || bLightClientSel || bCcSel) then
462 CheckCopyCellServDB();
467 UnUseDLL(SUPPORTDIR ^ SETUP_UTILS_DLL_PATH);
471 // If an unrecoverable error occurred, clean up
472 // the partial installation. Otherwise, exit normally.
473 if (bInstallAborted) then
479 ///////////////////////////////////////////////////////////////////////////////
481 // Function: ShowDialogs
483 // Purpose: This function manages the display and navigation of
484 // the standard dialogs that exist in a setup.
486 ///////////////////////////////////////////////////////////////////////////////
487 function ShowDialogs()
489 STRING szTargetLicense;
490 STRING szSourceLicense;
493 // beginning of dialogs label
496 nResult = DialogShowSdWelcome();
497 if (nResult = BACK) goto Dlg_Start;
500 szTargetLicense = DOCUMENTATION_LICENSE_PATH;
501 GetLicenseFilename (szSourceLicense);
502 Disable( DIALOGCACHE );
503 nResult = ShowLicense(szTargetLicense,szSourceLicense);
504 if (nResult = 0) then
507 Enable( DIALOGCACHE );
510 nResult = DialogShowSdAskComponentDialog();
511 if (nResult = BACK) goto Dlg_License;
514 nResult = DialogShowSdSelectFolder();
515 if (nResult = BACK) goto Dlg_SdCompDlg;
522 ///////////////////////////////////////////////////////////////////////////////
524 // Function: NotUpgradable
526 // Purpose: This function will return TRUE if the passed in version is not
529 ///////////////////////////////////////////////////////////////////////////////
530 function NotUpgradable(pApp)
532 // The 3.5 beta is not upgradable
533 if ((pApp->iVer.nMajorVersion = 3) && (pApp->iVer.nMinorVersion = 5) && (pApp->iVer.nPatchLevel = 0) && (pApp->iVer.szReleaseType = RELEASE_TYPE_BETA)) then
541 ///////////////////////////////////////////////////////////////////////////////
543 // Function: AnyNonUpgradableSoftwareInstalled
545 // Purpose: This function will return TRUE if any non-upgradable software is
548 ///////////////////////////////////////////////////////////////////////////////
549 function AnyNonUpgradableSoftwareInstalled()
551 if (NotUpgradable(&appFullClient) ||
552 NotUpgradable(&appServer) ||
553 NotUpgradable(&appControlCenter) ||
554 NotUpgradable(&appLightClient) ||
555 NotUpgradable(&appDocs))
564 ///////////////////////////////////////////////////////////////////////////////
566 // Function: UnselectComps
568 // Purpose: This function unselects all of the componenets so that we can
569 // completely control what gets installed. We will select each
570 // component at the time when we want to install it.
572 ///////////////////////////////////////////////////////////////////////////////
573 function UnselectComps()
575 ComponentSelectItem(MEDIA, SERVER_COMP_NAME, FALSE);
576 ComponentSelectItem(MEDIA, CLIENT_COMP_NAME, FALSE);
577 ComponentSelectItem(MEDIA, LIGHT_CLIENT_COMP_NAME, FALSE);
578 ComponentSelectItem(MEDIA, CC_COMP_NAME, FALSE);
579 ComponentSelectItem(MEDIA, DOCS_COMP_NAME, FALSE);
580 ComponentSelectItem(MEDIA, LANG_COMP_NAME, FALSE);
581 ComponentSelectItem(MEDIA, LANG_ENGLISH_COMP_NAME, FALSE);
582 ComponentSelectItem(MEDIA, LANG_SIMP_CHINESE_COMP_NAME, FALSE);
583 ComponentSelectItem(MEDIA, LANG_TRAD_CHINESE_COMP_NAME, FALSE);
584 ComponentSelectItem(MEDIA, LANG_KOREAN_COMP_NAME, FALSE);
585 ComponentSelectItem(MEDIA, LANG_JAPANESE_COMP_NAME, FALSE);
586 ComponentSelectItem(MEDIA, LANG_GERMAN_COMP_NAME, FALSE);
587 ComponentSelectItem(MEDIA, LANG_SPANISH_COMP_NAME, FALSE);
588 ComponentSelectItem(MEDIA, LANG_PORTUGUESE_COMP_NAME, FALSE);
589 ComponentSelectItem(MEDIA, README_COMP_NAME, FALSE);
590 ComponentSelectItem(MEDIA, README_ENGLISH_COMP_NAME, FALSE);
591 ComponentSelectItem(MEDIA, README_JAPANESE_COMP_NAME, FALSE);
592 ComponentSelectItem(MEDIA, README_KOREAN_COMP_NAME, FALSE);
593 ComponentSelectItem(MEDIA, README_SIMP_CHINESE_COMP_NAME, FALSE);
594 ComponentSelectItem(MEDIA, README_TRAD_CHINESE_COMP_NAME, FALSE);
595 ComponentSelectItem(MEDIA, README_GERMAN_COMP_NAME, FALSE);
596 ComponentSelectItem(MEDIA, README_SPANISH_COMP_NAME, FALSE);
597 ComponentSelectItem(MEDIA, README_PORTUGUESE_COMP_NAME, FALSE);
598 ComponentSelectItem(MEDIA, DOCS_ENGLISH_COMP_NAME, FALSE);
599 ComponentSelectItem(MEDIA, DOCS_JAPANESE_COMP_NAME, FALSE);
600 ComponentSelectItem(MEDIA, DOCS_KOREAN_COMP_NAME, FALSE);
601 ComponentSelectItem(MEDIA, DOCS_SIMP_CHINESE_COMP_NAME, FALSE);
602 ComponentSelectItem(MEDIA, DOCS_TRAD_CHINESE_COMP_NAME, FALSE);
603 ComponentSelectItem(MEDIA, DOCS_GERMAN_COMP_NAME, FALSE);
604 ComponentSelectItem(MEDIA, DOCS_SPANISH_COMP_NAME, FALSE);
605 ComponentSelectItem(MEDIA, DOCS_PORTUGUESE_COMP_NAME, FALSE);
609 ///////////////////////////////////////////////////////////////////////////////
611 // Function: DoesConfigInfoExist
613 // Purpose: This function determines if config info exists for an app.
615 ///////////////////////////////////////////////////////////////////////////////
616 function DoesConfigInfoExist(pApp)
618 RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
620 if (RegDBKeyExist(CONFIG_INFO_KEY ^ pApp->szProductName) = 1) then
628 ///////////////////////////////////////////////////////////////////////////////
630 // Function: RestorePreviousConfigs
632 // Purpose: This function restores config info for the apps we just installed.
634 ///////////////////////////////////////////////////////////////////////////////
635 function RestorePreviousConfigs()
637 if (appServer.bInstallSucceeded && DoesConfigInfoExist(&appServer)) then
638 RestoreConfigInfo(SERVER);
641 if (appFullClient.bInstallSucceeded) then
642 if (appFullClient.iVer.szTitle = "3.4a") then
643 Upgrade34ClientConfigInfo();
644 elseif (DoesConfigInfoExist(&appFullClient) = TRUE) then
645 RestoreConfigInfo(CLIENT);
649 if (appLightClient.bInstallSucceeded && DoesConfigInfoExist(&appLightClient)) then
650 RestoreConfigInfo(LCLIENT);
653 // Only restore control center info if client not installed
654 if (appControlCenter.bInstallSucceeded && !bClientInstalled && !appFullClient.bInstallSucceeded
655 && DoesConfigInfoExist(&appControlCenter))
657 RestoreConfigInfo(CC);
662 ///////////////////////////////////////////////////////////////////////////////
664 // Function: OnlyInstallingDocs
666 // Purpose: This function determines if only the doc files are being installed.
668 ///////////////////////////////////////////////////////////////////////////////
669 function OnlyInstallingDocs()
671 if (!bServerSel && !bFullClientSel && !bLightClientSel && !bCcSel && bDocsSel) then
679 ///////////////////////////////////////////////////////////////////////////////
681 // Function: CreateDirs
683 // Purpose: This function creates directories that we don't want IS to make.
685 ///////////////////////////////////////////////////////////////////////////////
686 function CreateDirs()
688 // Turn off logging. It shouldn't be on when this func is called, but we
689 // turn it off anyway just to make sure. We turn it off so that IS won't
690 // try to delete the dirs we are about to make during an uninstall. If
691 // we don't do this, then the first app installed that uses one of these
692 // dirs will think that it owns that dir and won't know that other apps
696 // Create the target dir and the shared dirs
697 CreateDir(TARGETDIR);
698 CreateDir(TARGETDIR ^ "Documentation");
699 CreateDir(TARGETDIR ^ "Documentation\\Html");
700 CreateDir(TARGETDIR ^ "Documentation\\Html\\InstallGd");
701 CreateDir(TARGETDIR ^ "Documentation\\Html\\ReleaseNotes");
703 // We need to manually create the Server dir so that if we have to leave
704 // it behind during an uninstall (so that config info is preserved), IS
705 // won't complain that it can't be deleted.
707 CreateDir(TARGETDIR ^ "Server\\usr\\afs\\bin");
710 // Docs don't use the common dir
711 if (OnlyInstallingDocs() = FALSE) then
712 CreateDir(TARGETDIR ^ "Common");
717 ///////////////////////////////////////////////////////////////////////////////
719 // Function: PrepareForWSPPInstall
721 // Purpose: This function decides what to install when doing a WSPP install.
723 ///////////////////////////////////////////////////////////////////////////////
724 function PrepareForWSPPInstall()
726 SHELL_OBJECT_FOLDER = @WSPP_FOLDER_NAME;
728 // Never install the Docs during a WSPP install
729 appDocs.nInstallAction = ACTION_NONE;
731 // If we have been told to replace any preinstalled software, then set
732 // our reinstall mechanism in motion.
733 if (bPreinstallReplace) then
734 if (bCcInstalled && bCcSel) then
735 appControlCenter.nInstallAction = ACTION_REINSTALL;
737 if (bClientInstalled && bFullClientSel) then
738 appFullClient.nInstallAction = ACTION_REINSTALL;
740 if (bServerInstalled && bServerSel) then
741 appServer.nInstallAction = ACTION_REINSTALL;
743 if (bLightClientInstalled && bLightClientSel) then
744 appLightClient.nInstallAction = ACTION_REINSTALL;
747 // If we have been told to not install something that is already
748 // installed, then do just that.
749 if (bCcInstalled && bCcSel) then
752 if (bClientInstalled && bFullClientSel) then
753 bFullClientSel = FALSE;
755 if (bServerInstalled && bServerSel) then
758 if (bLightClientInstalled && bLightClientSel) then
759 bLightClientSel = FALSE;
765 ///////////////////////////////////////////////////////////////////////////////
767 // Function: RemoveCurrentVersion
769 // Purpose: This function removes the currently installed version of the app.
770 // It provides a message to the user so they know what is going on.
772 ///////////////////////////////////////////////////////////////////////////////
773 function RemoveCurrentVersion(pApp)
779 switch(pApp->nInstallAction)
780 case ACTION_REINSTALL: szFormat = @REINSTALL_PREP_MSG;
781 case ACTION_UPGRADE: szFormat = @UPGRADE_PREP_MSG;
782 case ACTION_DOWNGRADE: szFormat = @DOWNGRADE_PREP_MSG;
785 if (szFormat == "") then
789 Sprintf(szMsg, szFormat, pApp->szProductName);
791 if (!bWSPPInstall) then
792 SdShowMsg(szMsg, TRUE);
795 RemoveInstalledBits(pApp->szProductName);
797 if (!bWSPPInstall) then
798 SdShowMsg(szMsg, FALSE);
803 ///////////////////////////////////////////////////////////////////////////////
805 // Function: RemoveAllCurrentVersions
807 // Purpose: This function removes the current install of all apps that are
808 // begin reinstalled, upgraded, or downgraded.
810 ///////////////////////////////////////////////////////////////////////////////
811 function RemoveAllCurrentVersions()
813 if (bFullClientSel) then
814 RemoveCurrentVersion(&appFullClient);
818 RemoveCurrentVersion(&appServer);
822 RemoveCurrentVersion(&appControlCenter);
825 if (bLightClientSel) then
826 RemoveCurrentVersion(&appLightClient);
831 ///////////////////////////////////////////////////////////////////////////////
833 // Function: InstallApp
835 // Purpose: This function installs an application that is part of a suite.
837 ///////////////////////////////////////////////////////////////////////////////
838 function InstallApp(pApp)
841 if (pApp->nInstallAction = ACTION_NONE) then
845 // Start fresh with nothing selected
848 // Select the comps we want to install. We will install the passed in app
849 // as well as the comps that are shared by all the apps. Because of weird
850 // IS stuff, the app comp must be selected last else IS will autoselect
851 // things we don't want.
852 ComponentSelectItem(MEDIA, szReadmeComp, TRUE);
854 // Lang comps are shared by all apps except the docs app
855 if (pApp != &appDocs) then
856 ComponentSelectItem(MEDIA, szLangComp, TRUE);
859 // Select the app's component
860 ComponentSelectItem(MEDIA, pApp->szCompName, TRUE);
862 // MessageBox("Install app: " + pApp->szCompName, INFORMATION);
864 nResult = ProcessBeforeDataMove(pApp);
865 if (nResult < 0) goto error;
867 nResult = MoveFileData();
868 if (nResult < 0) goto error;
870 nResult = ProcessAfterDataMove();
871 if (nResult < 0) goto error;
873 nResult = CreateRegistrySets(pApp->szRegistrySets);
874 if (nResult < 0) goto error;
878 nResult = CreateRegistrySets(pApp->szNoLogRegistrySets);
879 if (nResult < 0) goto error;
881 nResult = ConfigUninstallDLL(pApp);
882 if (nResult < 0) goto error;
884 AddPath(pApp->szBinPath);
886 // Now unselect it again
887 ComponentSelectItem(MEDIA, pApp->szCompName, FALSE);
889 pApp->bInstallSucceeded = TRUE;
898 ///////////////////////////////////////////////////////////////////////////////
900 // Function: ProcessBeforeDataMove
902 // Purpose: This function performs any necessary operations prior to the
903 // actual file transfer.
905 ///////////////////////////////////////////////////////////////////////////////
906 function ProcessBeforeDataMove(pApp)
910 // Create app information and App Paths registry keys.
911 InstallationInfo(pApp->szCompanyName, pApp->szProductName, pApp->Ver.szTitle, pApp->szProductKey);
913 svLogFile = pApp->szUninstLogfileName;
915 // Create the uninstall reg key and open the log file
916 nResult = DeinstallStart(TARGETDIR, svLogFile, pApp->szUninstKey, 0 );
917 if (nResult < 0) then
918 ShowError( @ERROR_UNINSTSETUP, WARNING );
921 szAppPath = pApp->szAppPath;
923 // Fill in reg values for this apps reg key and uninstall reg key
924 RegDBSetItem( REGDB_APPPATH, szAppPath );
925 RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ pApp->szProductKey);
926 RegDBSetItem( REGDB_UNINSTALL_NAME, pApp->szUninstDisplayName);
933 function ShowIsSelected(comp)
937 nSel = ComponentIsItemSelected(MEDIA , comp);
939 str = comp + " is selected.";
940 MessageBox(str, INFORMATION);
942 str = comp + " is not selected.";
947 function ShowSelectedComponents()
949 // Visible components
950 ShowIsSelected(CLIENT_COMP_NAME);
951 ShowIsSelected(LIGHT_CLIENT_COMP_NAME);
952 ShowIsSelected(SERVER_COMP_NAME);
953 ShowIsSelected(CC_COMP_NAME);
954 ShowIsSelected(DOCS_COMP_NAME);
956 // Language components
957 ShowIsSelected(LANG_COMP_NAME);
958 ShowIsSelected(LANG_ENGLISH_COMP_NAME);
959 ShowIsSelected(LANG_SIMP_CHINESE_COMP_NAME);
960 ShowIsSelected(LANG_TRAD_CHINESE_COMP_NAME);
961 ShowIsSelected(LANG_KOREAN_COMP_NAME);
962 ShowIsSelected(LANG_JAPANESE_COMP_NAME);
963 ShowIsSelected(LANG_GERMAN_COMP_NAME);
964 ShowIsSelected(LANG_SPANISH_COMP_NAME);
965 ShowIsSelected(LANG_PORTUGUESE_COMP_NAME);
967 // Documentation components
968 ShowIsSelected(DOCS_ENGLISH_COMP_NAME);
969 ShowIsSelected(DOCS_JAPANESE_COMP_NAME);
970 ShowIsSelected(DOCS_KOREAN_COMP_NAME);
971 ShowIsSelected(DOCS_SIMP_CHINESE_COMP_NAME);
972 ShowIsSelected(DOCS_TRAD_CHINESE_COMP_NAME);
973 ShowIsSelected(DOCS_GERMAN_COMP_NAME);
974 ShowIsSelected(DOCS_SPANISH_COMP_NAME);
975 ShowIsSelected(DOCS_PORTUGUESE_COMP_NAME);
977 // Readme files components
978 ShowIsSelected(README_COMP_NAME);
979 ShowIsSelected(README_ENGLISH_COMP_NAME);
980 ShowIsSelected(README_JAPANESE_COMP_NAME);
981 ShowIsSelected(README_KOREAN_COMP_NAME);
982 ShowIsSelected(README_SIMP_CHINESE_COMP_NAME);
983 ShowIsSelected(README_TRAD_CHINESE_COMP_NAME);
984 ShowIsSelected(README_GERMAN_COMP_NAME);
985 ShowIsSelected(README_SPANISH_COMP_NAME);
986 ShowIsSelected(README_PORTUGUESE_COMP_NAME);
991 ///////////////////////////////////////////////////////////////////////////////
993 // Function: MoveFileData
995 // Purpose: This function handles the file transfer for
998 ///////////////////////////////////////////////////////////////////////////////
999 function MoveFileData()
1000 NUMBER nResult, nDisk;
1003 if (!bWSPPInstall) then
1004 Enable( INDVFILESTATUS );
1005 SetStatusWindow( 0, "" );
1006 Disable( DIALOGCACHE );
1008 StatusUpdate( ON, 100 );
1011 nResult = ComponentMoveData( MEDIA, nDisk, 0 );
1013 // Reinit this call so the progress indicator resets
1014 ComponentMoveData("", nDisk, 0);
1016 HandleMoveDataError( nResult );
1024 ///////////////////////////////////////////////////////////////////////////////
1026 // Function: HandleMoveDataError
1028 // Purpose: This function handles the error (if any) during the file transfer
1031 ///////////////////////////////////////////////////////////////////////////////
1032 function HandleMoveDataError( nResult )
1033 STRING szErrMsg, svComponent , svFileGroup , svFile;
1044 ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult );
1045 szErrMsg = @ERROR_MOVEDATA + "\n\n" +
1046 @ERROR_COMPONENT + " " + svComponent + "\n" +
1047 @ERROR_FILEGROUP + " " + svFileGroup + "\n" +
1048 @ERROR_FILE + " " + svFile;
1049 Sprintf(szMsg, szErrMsg, nResult);
1050 ShowError(szMsg, SEVERE);
1051 bInstallAborted = TRUE;
1058 ///////////////////////////////////////////////////////////////////////////////
1060 // Function: ProcessAfterDataMove
1062 // Purpose: This function performs any necessary operations needed after
1063 // all files have been transferred.
1065 ///////////////////////////////////////////////////////////////////////////////
1066 function ProcessAfterDataMove()
1067 STRING szReferenceFile;
1071 // TO DO : update self-registered files and other processes that
1072 // should be performed after the files have been transferred.
1074 // DeinstallSetReference specifies a file to be checked before
1075 // uninstallation. If the file is in use, uninstallation will not proceed.
1077 // szReferenceFile = svDir ^ pApp->szProductKey; // TO DO : If your file is in a
1078 // subfolder of svDir add that here
1080 // DeinstallSetReference( szReferenceFile );
1086 ///////////////////////////////////////////////////////////////////////////////
1088 // Function: CleanUpInstall
1090 // Purpose: This cleans up the setup. Anything that should
1091 // be released or deleted at the end of the setup should
1094 ///////////////////////////////////////////////////////////////////////////////
1095 function CleanUpInstall()
1098 if (bInstallAborted) then
1102 if (!bWSPPInstall) then
1103 DialogShowSdFinishReboot();
1106 if (BATCH_INSTALL) then // ensure locked files are properly transferred
1107 CommitSharedFiles(0);
1114 ///////////////////////////////////////////////////////////////////////////////
1116 // Function: GetLicenseFilename
1118 // Purpose: This will determine the full path to the appropriate-language
1119 // license on the CD. Will default to English if the locale cannot
1122 ///////////////////////////////////////////////////////////////////////////////
1123 function GetLicenseFilename(szLicense)
1124 number MajorLanguage;
1126 MajorLanguage = SELECTED_LANGUAGE & 255;
1128 switch(MajorLanguage)
1129 case ISLANG_CHINESE:
1130 if (SELECTED_LANGUAGE == ISLANG_CHINESE_TAIWAN) then
1131 szLicense = SRCDIR ^ LICENSE_TRAD_CHINESE_FILENAME;
1133 szLicense = SRCDIR ^ LICENSE_SIMP_CHINESE_FILENAME;
1137 szLicense = SRCDIR ^ LICENSE_KOREAN_FILENAME;
1139 case ISLANG_JAPANESE:
1140 szLicense = SRCDIR ^ LICENSE_JAPANESE_FILENAME;
1143 szLicense = SRCDIR ^ LICENSE_GERMAN_FILENAME;
1145 case ISLANG_PORTUGUESE:
1146 szLicense = SRCDIR ^ LICENSE_PORTUGUESE_FILENAME;
1148 case ISLANG_SPANISH:
1149 szLicense = SRCDIR ^ LICENSE_SPANISH_FILENAME;
1152 szLicense = SRCDIR ^ LICENSE_ENGLISH_FILENAME;
1160 ///////////////////////////////////////////////////////////////////////////////
1162 // Function: GetLanguageComp
1164 // Purpose: This will determine which language the locale is set to. Uses
1165 // this info to determine which lang, readme, and doc comps to
1166 // install. Will default to English if the locale cannot be
1169 ///////////////////////////////////////////////////////////////////////////////
1170 function GetNlsComps(szLangComp, szReadmeComp, szDocsComp, szCodePage)
1171 number MajorLanguage;
1173 MajorLanguage = SELECTED_LANGUAGE & 255;
1175 switch(MajorLanguage)
1176 case ISLANG_CHINESE:
1177 if (SELECTED_LANGUAGE == ISLANG_CHINESE_TAIWAN) then
1178 szLangComp = LANG_TRAD_CHINESE_COMP_NAME;
1179 szReadmeComp = README_TRAD_CHINESE_COMP_NAME;
1180 szDocsComp = DOCS_TRAD_CHINESE_COMP_NAME;
1181 szCodePage = "1028";
1183 szLangComp = LANG_SIMP_CHINESE_COMP_NAME;
1184 szReadmeComp = README_SIMP_CHINESE_COMP_NAME;
1185 szDocsComp = DOCS_SIMP_CHINESE_COMP_NAME;
1186 szCodePage = "2052";
1190 szLangComp = LANG_KOREAN_COMP_NAME;
1191 szReadmeComp = README_KOREAN_COMP_NAME;
1192 szDocsComp = DOCS_KOREAN_COMP_NAME;
1193 szCodePage = "1042";
1195 case ISLANG_JAPANESE:
1196 szLangComp = LANG_JAPANESE_COMP_NAME;
1197 szReadmeComp = README_JAPANESE_COMP_NAME;
1198 szDocsComp = DOCS_JAPANESE_COMP_NAME;
1199 szCodePage = "1041";
1202 szLangComp = LANG_GERMAN_COMP_NAME;
1203 szReadmeComp = README_GERMAN_COMP_NAME;
1204 szDocsComp = DOCS_GERMAN_COMP_NAME;
1205 szCodePage = "1032";
1207 case ISLANG_PORTUGUESE:
1208 szLangComp = LANG_PORTUGUESE_COMP_NAME;
1209 szReadmeComp = README_PORTUGUESE_COMP_NAME;
1210 szDocsComp = DOCS_PORTUGUESE_COMP_NAME;
1211 szCodePage = "1046";
1213 case ISLANG_SPANISH:
1214 szLangComp = LANG_SPANISH_COMP_NAME;
1215 szReadmeComp = README_SPANISH_COMP_NAME;
1216 szDocsComp = DOCS_SPANISH_COMP_NAME;
1217 szCodePage = "1034";
1220 szLangComp = LANG_ENGLISH_COMP_NAME;
1221 szReadmeComp = README_ENGLISH_COMP_NAME;
1222 szDocsComp = DOCS_ENGLISH_COMP_NAME;
1223 szCodePage = "1033";
1231 ///////////////////////////////////////////////////////////////////////////////
1233 // Function: SetupVerInfo
1235 // Purpose: This will initialize the VERINFO structures for a product.
1237 ///////////////////////////////////////////////////////////////////////////////
1238 function SetupVerInfo(pApp, szMajor, szMinor, szPatchLevel, szBetaLevel, szReleaseType, szTitle, bInstalledVerInfo)
1244 StrToNum(nMajor, szMajor);
1245 StrToNum(nMinor, szMinor);
1246 StrToNum(nPatchLevel, szPatchLevel);
1247 StrToNum(nBetaLevel, szBetaLevel);
1249 if (bInstalledVerInfo) then
1250 pApp->iVer.nMajorVersion = nMajor;
1251 pApp->iVer.nMinorVersion = nMinor;
1252 pApp->iVer.nPatchLevel = nPatchLevel;
1253 pApp->iVer.nBetaLevel = nBetaLevel;
1254 pApp->iVer.szReleaseType = szReleaseType;
1255 pApp->iVer.szTitle = szTitle;
1257 pApp->Ver.nMajorVersion = nMajor;
1258 pApp->Ver.nMinorVersion = nMinor;
1259 pApp->Ver.nPatchLevel = nPatchLevel;
1260 pApp->Ver.nBetaLevel = nBetaLevel;
1261 pApp->Ver.szReleaseType = szReleaseType;
1262 pApp->Ver.szTitle = szTitle;
1268 ///////////////////////////////////////////////////////////////////////////////
1270 // Function: FixTargetPaths
1272 // Purpose: This function updates the CommonBinPath and app paths if you
1273 // choose to install to a different directory
1275 ///////////////////////////////////////////////////////////////////////////////
1276 function FixTargetPaths()
1278 // The AFS path must not contain spaces. AFS code will break if it does.
1279 LongPathToShortPath(TARGETDIR);
1281 szCommonBinPath = TARGETDIR ^ "Common";
1284 appFullClient.szAppPath = TARGETDIR ^ "Client";
1285 appFullClient.szBinPath = TARGETDIR ^ "Client\\Program";
1288 appLightClient.szAppPath = TARGETDIR ^ "Client";
1289 appLightClient.szBinPath = TARGETDIR ^ "Client\\Program";
1292 appServer.szAppPath = TARGETDIR ^ "Server";
1293 appServer.szBinPath = TARGETDIR ^ "Server\\usr\\afs\\bin";
1296 appControlCenter.szAppPath = TARGETDIR ^ "Control Center";
1297 appControlCenter.szBinPath = TARGETDIR ^ "Control Center";
1300 appDocs.szAppPath = TARGETDIR ^ "Documentation";
1301 appDocs.szBinPath = TARGETDIR ^ "Documentation";
1306 ///////////////////////////////////////////////////////////////////////////////
1308 // Function: SetupAppInfo
1310 // Purpose: This will initialize the APPINFO structures for each product
1311 // that we can install.
1313 ///////////////////////////////////////////////////////////////////////////////
1314 function SetupAppInfo()
1317 szCommonBinPath = TARGETDIR ^ "Common";
1320 appFullClient.szCompName = CLIENT_COMP_NAME; // Component name
1321 appFullClient.szCompanyName = @COMPANY_NAME;
1322 appFullClient.szProductName = @PRODUCT_NAME_CLIENT;
1323 appFullClient.szProductKey = @PRODUCT_KEY_CLIENT;
1324 appFullClient.bUseUninstDLL = TRUE;
1325 appFullClient.szUninstDllName = CLIENT_UNINST_DLL_NAME;
1326 appFullClient.szUninstLogfileName = CLIENT_UNINST_LOGFILE_NAME;
1327 appFullClient.szUninstKey = @UNINST_KEY_CLIENT;
1328 appFullClient.szAppPath = TARGETDIR ^ "Client";
1329 appFullClient.szBinPath = TARGETDIR ^ "Client\\Program";
1330 appFullClient.bAddToPath = TRUE;
1331 appFullClient.szUninstDisplayName = @UNINST_DISPLAY_NAME_CLIENT;
1332 appFullClient.szRegistrySets = "Client,Full_Client";
1333 appFullClient.szNoLogRegistrySets = "Client_NoUninstall,WinNT_Client_NoUninstall";
1334 appFullClient.bInstallSucceeded = FALSE;
1335 SetupVerInfo(&appFullClient, @PRODUCT_VERSION_MAJOR, @PRODUCT_VERSION_MINOR, @PRODUCT_VERSION_PATCH_LEVEL, @PRODUCT_VERSION_BETA_LEVEL, @PRODUCT_VERSION_RELEASE_TYPE, @PRODUCT_VERSION_TITLE, FALSE);
1339 appLightClient.szCompName = LIGHT95_CLIENT_COMP_NAME;
1340 elseif (bWin98) then
1341 appLightClient.szCompName = LIGHT98_CLIENT_COMP_NAME;
1343 appLightClient.szCompanyName = @COMPANY_NAME;
1344 appLightClient.szProductName = @PRODUCT_NAME_LIGHT_CLIENT;
1345 appLightClient.szProductKey = @PRODUCT_KEY_LIGHT_CLIENT;
1346 appLightClient.bUseUninstDLL = TRUE;
1347 appLightClient.szUninstDllName = LIGHT_CLIENT_UNINST_DLL_NAME;
1348 appLightClient.szUninstLogfileName = LIGHT_CLIENT_UNINST_LOGFILE_NAME;
1349 appLightClient.szUninstKey = @UNINST_KEY_LIGHT_CLIENT;
1350 appLightClient.szAppPath = TARGETDIR ^ "Client";
1351 appLightClient.szBinPath = TARGETDIR ^ "Client\\Program";
1352 appLightClient.bAddToPath = TRUE;
1353 appLightClient.szUninstDisplayName = @UNINST_DISPLAY_NAME_LIGHT_CLIENT;
1354 appLightClient.szRegistrySets = "Client,LightClient";
1355 appLightClient.szNoLogRegistrySets = "Client_NoUninstall";
1356 appLightClient.bInstallSucceeded = FALSE;
1357 SetupVerInfo(&appLightClient, @PRODUCT_VERSION_MAJOR, @PRODUCT_VERSION_MINOR, @PRODUCT_VERSION_PATCH_LEVEL, @PRODUCT_VERSION_BETA_LEVEL, @PRODUCT_VERSION_RELEASE_TYPE, @PRODUCT_VERSION_TITLE, FALSE);
1360 appServer.szCompName = SERVER_COMP_NAME;
1361 appServer.szCompanyName = @COMPANY_NAME;
1362 appServer.szProductName = @PRODUCT_NAME_SERVER;
1363 appServer.szProductKey = @PRODUCT_KEY_SERVER;
1364 appServer.bUseUninstDLL = TRUE;
1365 appServer.szUninstDllName = SERVER_UNINST_DLL_NAME;
1366 appServer.szUninstLogfileName = SERVER_UNINST_LOGFILE_NAME;
1367 appServer.szUninstKey = @UNINST_KEY_SERVER;
1368 appServer.szAppPath = TARGETDIR ^ "Server";
1369 appServer.szBinPath = TARGETDIR ^ "Server\\usr\\afs\\bin";
1370 appServer.bAddToPath = TRUE;
1371 appServer.szUninstDisplayName = @UNINST_DISPLAY_NAME_SERVER;
1372 appServer.szRegistrySets = "Server";
1373 appServer.szNoLogRegistrySets = "";
1374 appServer.bInstallSucceeded = FALSE;
1375 SetupVerInfo(&appServer, @PRODUCT_VERSION_MAJOR, @PRODUCT_VERSION_MINOR, @PRODUCT_VERSION_PATCH_LEVEL, @PRODUCT_VERSION_BETA_LEVEL, @PRODUCT_VERSION_RELEASE_TYPE, @PRODUCT_VERSION_TITLE, FALSE);
1378 appControlCenter.szCompName = CC_COMP_NAME;
1379 appControlCenter.szCompanyName = @COMPANY_NAME;
1380 appControlCenter.szProductName = @PRODUCT_NAME_CC;
1381 appControlCenter.szProductKey = @PRODUCT_KEY_CC;
1382 appControlCenter.bUseUninstDLL = TRUE;
1383 appControlCenter.szUninstDllName = CC_UNINST_DLL_NAME;
1384 appControlCenter.szUninstLogfileName = CC_UNINST_LOGFILE_NAME;
1385 appControlCenter.szUninstKey = @UNINST_KEY_CC;
1386 appControlCenter.szAppPath = TARGETDIR ^ "Control Center";
1387 appControlCenter.szBinPath = TARGETDIR ^ "Control Center";
1388 appControlCenter.bAddToPath = TRUE;
1389 appControlCenter.szUninstDisplayName = @UNINST_DISPLAY_NAME_CC;
1390 appControlCenter.szRegistrySets = "Control_Center";
1391 appControlCenter.szNoLogRegistrySets = "";
1392 appControlCenter.bInstallSucceeded = FALSE;
1393 SetupVerInfo(&appControlCenter, @PRODUCT_VERSION_MAJOR, @PRODUCT_VERSION_MINOR, @PRODUCT_VERSION_PATCH_LEVEL, @PRODUCT_VERSION_BETA_LEVEL, @PRODUCT_VERSION_RELEASE_TYPE, @PRODUCT_VERSION_TITLE, FALSE);
1396 appDocs.szCompName = DOCS_COMP_NAME;
1397 appDocs.szCompanyName = @COMPANY_NAME;
1398 appDocs.szProductName = @PRODUCT_NAME_DOCS;
1399 appDocs.szProductKey = @PRODUCT_KEY_DOCS;
1400 appDocs.bUseUninstDLL = TRUE;
1401 appDocs.szUninstDllName = DOCS_UNINST_DLL_NAME;
1402 appDocs.szUninstLogfileName = DOCS_UNINST_LOGFILE_NAME;
1403 appDocs.szUninstKey = @UNINST_KEY_DOCS;
1404 appDocs.szAppPath = TARGETDIR ^ "Documentation";
1405 appDocs.szBinPath = TARGETDIR ^ "Documentation";
1406 appDocs.bAddToPath = FALSE;
1407 appDocs.szUninstDisplayName = @UNINST_DISPLAY_NAME_DOCS;
1408 appDocs.szRegistrySets = "Docs";
1409 appDocs.szNoLogRegistrySets = "";
1410 appDocs.bInstallSucceeded = FALSE;
1411 SetupVerInfo(&appDocs, @PRODUCT_VERSION_MAJOR, @PRODUCT_VERSION_MINOR, @PRODUCT_VERSION_PATCH_LEVEL, @PRODUCT_VERSION_BETA_LEVEL, @PRODUCT_VERSION_RELEASE_TYPE, @PRODUCT_VERSION_TITLE, FALSE);
1415 ///////////////////////////////////////////////////////////////////////////////
1417 // Function: SetupInstall
1419 // Purpose: This will initialize the setup. Any general initialization
1420 // needed for the installation should be performed here.
1422 ///////////////////////////////////////////////////////////////////////////////
1423 function SetupInstall()
1425 Enable( CORECOMPONENTHANDLING );
1427 bInstallAborted = FALSE;
1429 // Create list of end user selections to be displayed by DialogShowSdStartCopy()
1431 svDir = PROGRAMFILES ^ @DEFAULT_INSTALL_DIR;
1435 SdProductName( @PRODUCT_NAME );
1437 Enable( DIALOGCACHE );
1439 SetDialogTitle(DLG_ASK_YESNO, @TITLE_CAPTIONBAR);
1440 SetDialogTitle(DLG_MSG_INFORMATION, @TITLE_CAPTIONBAR);
1441 SetDialogTitle(DLG_MSG_WARNING, @TITLE_CAPTIONBAR);
1442 SetDialogTitle(DLG_MSG_SEVERE, @TITLE_CAPTIONBAR);
1443 SetDialogTitle(DLG_USER_CAPTION, @TITLE_CAPTIONBAR);
1446 ///////////////////////////////////////////////////////////////////////////////
1448 // Function: SetupScreen
1450 // Purpose: This function establishes the screen look. This includes
1451 // colors, fonts, and text to be displayed.
1453 ///////////////////////////////////////////////////////////////////////////////
1454 function SetupScreen()
1456 Enable( FULLWINDOWMODE );
1457 SetTitle( @TITLE_MAIN, 24, WHITE );
1459 SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text.
1461 Enable( BACKGROUND );
1467 ///////////////////////////////////////////////////////////////////////////////
1469 // Function: CheckRequirements
1471 // Purpose: This function checks all minimum requirements for the
1472 // application being installed. If any fail, then the user
1473 // is informed and the setup is terminated.
1475 ///////////////////////////////////////////////////////////////////////////////
1476 function CheckRequirements()
1477 NUMBER nvDx, nvDy, nvResult;
1483 bIsShellExplorer = FALSE;
1485 // Check screen resolution.
1486 GetExtents( nvDx, nvDy );
1488 if (nvDy < 480) then
1489 ShowError( @ERROR_VGARESOLUTION, WARNING );
1493 // set 'setup' operation mode
1494 bIs32BitSetup = TRUE;
1495 GetSystemInfo( ISTYPE, nvResult, svResult );
1496 if (nvResult = 16) then
1497 bIs32BitSetup = FALSE; // running 16-bit setup
1498 return 0; // no additional information required
1501 // --- 32-bit testing after this point ---
1503 // Determine the target system's operating system.
1504 GetSystemInfo( OS, nvResult, svResult );
1506 if (nvResult = IS_WINDOWSNT) then
1507 // Running Windows NT.
1510 // If the user is not an admin, then abort
1511 if (CheckIfAdmin() = -1) then
1512 ShowError(@MUST_BE_AN_ADMIN_MSG, SEVERE);
1516 // Check to see if the shell being used is EXPLORER shell.
1517 if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
1518 if (nvResult >= 4) then
1519 bIsShellExplorer = TRUE;
1523 elseif (nvResult = IS_WINDOWS95) then
1524 // IS puts us here even for Win98
1525 if (IsWin98() = 0) then
1531 bIsShellExplorer = TRUE;
1536 ///////////////////////////////////////////////////////////////////////////////
1538 // Function: DialogShowSdWelcome
1540 // Purpose: This function handles the standard welcome dialog.
1543 ///////////////////////////////////////////////////////////////////////////////
1544 function DialogShowSdWelcome()
1546 STRING szTitle, szMsg;
1552 nResult = SdWelcome( szTitle, szMsg );
1558 ///////////////////////////////////////////////////////////////////////////////
1560 // Function: DialogShowSdAskDestPath
1562 // Purpose: This function asks the user for the destination folder.
1564 ///////////////////////////////////////////////////////////////////////////////
1565 function DialogShowSdAskDestPath()
1567 STRING szTitle, szMsg;
1573 nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 );
1582 ///////////////////////////////////////////////////////////////////////////////
1584 // Function: GetVersionNumber
1586 // Purpose: This function converts a version number string into an integer.
1588 ///////////////////////////////////////////////////////////////////////////////
1589 function GetVersionNumber(szVerion)
1595 // This code assumes a majorversion.minorversion format.
1598 // This will get everything up to the '.'
1599 StrToNum(nMajorVersion, szVer);
1601 // Delete the part of the string we just converted
1602 StrSub(szVer, szVer, StrFind(szVer, ".") + 1, 64);
1604 // Now convert the part after the '.'
1605 StrToNum(nMinorVersion, szVer);
1607 // Turn in into a single number
1608 nVersion = (nMajorVersion * 10) + nMinorVersion;
1614 ///////////////////////////////////////////////////////////////////////////////
1616 // Function: CompareVersions
1618 // Purpose: This function compares an apps two version info structures and
1619 // determines if one is greater than the other, or if they are equal.
1621 ///////////////////////////////////////////////////////////////////////////////
1622 function CompareVersions(pApp)
1625 // Compare major versions
1626 nResult = pApp->Ver.nMajorVersion - pApp->iVer.nMajorVersion;
1627 if (nResult > 0) then return 1; endif;
1628 if (nResult < 0) then return -1; endif;
1630 // Major versions are equal, move on to minor versions
1631 nResult = pApp->Ver.nMinorVersion - pApp->iVer.nMinorVersion;
1632 if (nResult > 0) then return 1; endif;
1633 if (nResult < 0) then return -1; endif;
1635 // Minor versions are equal, move on to patch level.
1636 nResult = pApp->Ver.nPatchLevel - pApp->iVer.nPatchLevel;
1637 if (nResult > 0) then return 1; endif;
1638 if (nResult < 0) then return -1; endif;
1640 // Patch levels are equal, move on to release type.
1641 if ((pApp->Ver.szReleaseType = RELEASE_TYPE_GA) && (pApp->iVer.szReleaseType = RELEASE_TYPE_BETA)) then return 1; endif;
1642 if ((pApp->Ver.szReleaseType = RELEASE_TYPE_BETA) && (pApp->iVer.szReleaseType = RELEASE_TYPE_GA)) then return -1; endif;
1644 // Release types are equal. Special handling now required:
1646 // If this is a GA release, then there is no more info to look at, and the versions are equal.
1647 if (pApp->Ver.szReleaseType = RELEASE_TYPE_GA) then return 0; endif;
1649 // We have a Beta release, so we still have some info to check. Compare the beta release levels.
1650 nResult = pApp->Ver.nBetaLevel - pApp->iVer.nBetaLevel;
1651 if (nResult > 0) then return 1; endif;
1652 if (nResult < 0) then return -1; endif;
1654 // Beta versions are equal.
1659 ///////////////////////////////////////////////////////////////////////////////
1661 // Function: GetInstallAction
1663 // Purpose: This function decides what install action to perform for a
1664 // component and sets the display name accordingly.
1666 ///////////////////////////////////////////////////////////////////////////////
1667 function GetInstallAction(szCompName, bInstalled, szInstallMsg, szUpgradeMsg, szDowngradeMsg, szReinstallMsg, pApp)
1668 string szDisplayName;
1674 if (bInstalled) then
1675 nResult = CompareVersions(pApp);
1677 if (nResult = 0) then
1678 szDisplayName = szReinstallMsg;
1679 pApp->nInstallAction = ACTION_REINSTALL;
1681 elseif (nResult > 0) then
1682 szDisplayName = szUpgradeMsg;
1683 pApp->nInstallAction = ACTION_UPGRADE;
1684 Sprintf(szVerMsg, " %s", pApp->iVer.szTitle);
1686 else // Trying to install old version on top of new version
1687 szDisplayName = szDowngradeMsg;
1688 pApp->nInstallAction = ACTION_DOWNGRADE;
1689 Sprintf(szVerMsg, " %s", pApp->iVer.szTitle);
1692 szDisplayName = szInstallMsg;
1693 pApp->nInstallAction = ACTION_INSTALL;
1696 szDisplayName = szDisplayName + szVerMsg;
1698 ComponentSetData(MEDIA, szCompName, COMPONENT_FIELD_DISPLAYNAME, 0, szDisplayName);
1704 ///////////////////////////////////////////////////////////////////////////////
1706 // Function: GetInstallActions
1708 // Purpose: This function decides what install action to perform for each
1709 // component and sets the display name accordingly.
1711 ///////////////////////////////////////////////////////////////////////////////
1712 function GetInstallActions()
1714 // Decide what to do for each component and then set the display names appropriately
1715 GetInstallAction(CLIENT_COMP_NAME, bClientInstalled, @INSTALL_CLIENT_MSG, @UPGRADE_CLIENT_MSG, @DOWNGRADE_CLIENT_MSG, @REINSTALL_CLIENT_MSG, &appFullClient);
1716 GetInstallAction(SERVER_COMP_NAME, bServerInstalled, @INSTALL_SERVER_MSG, @UPGRADE_SERVER_MSG, @DOWNGRADE_SERVER_MSG, @REINSTALL_SERVER_MSG, &appServer);
1717 GetInstallAction(CC_COMP_NAME, bCcInstalled, @INSTALL_CC_MSG, @UPGRADE_CC_MSG, @DOWNGRADE_CC_MSG, @REINSTALL_CC_MSG, &appControlCenter);
1718 GetInstallAction(LIGHT_CLIENT_COMP_NAME, bLightClientInstalled, @INSTALL_LIGHT_CLIENT_MSG, @UPGRADE_LIGHT_CLIENT_MSG, @DOWNGRADE_LIGHT_CLIENT_MSG, @REINSTALL_LIGHT_CLIENT_MSG, &appLightClient);
1719 GetInstallAction(DOCS_COMP_NAME, bDocsInstalled, @INSTALL_DOCS_MSG, @UPGRADE_DOCS_MSG, @DOWNGRADE_DOCS_MSG, @REINSTALL_DOCS_MSG, &appDocs);
1722 ///////////////////////////////////////////////////////////////////////////////
1724 // Function: ClientSelectedOrInstalled
1726 // Purpose: This function checks whether or not the client is selected or if
1727 // it is already installed.
1729 ///////////////////////////////////////////////////////////////////////////////
1730 function ClientSelectedOrInstalled()
1732 if (bFullClientSel || bClientInstalled) then
1739 ///////////////////////////////////////////////////////////////////////////////
1741 // Function: AppVersionOk
1743 // Purpose: This function determines if a given app will have the correct
1744 // version after installation.
1746 ///////////////////////////////////////////////////////////////////////////////
1747 function AppVersionOk(bInstalled, bSel, pApp)
1750 // Here's the logic of this:
1752 // 1) If the app is not installed and
1753 // a) it's not being installed, then this app doesn't affect the version
1754 // restrictions, so return true
1755 // b) it will be installed, then it will get the version which this
1756 // installer installs, so the version will be ok
1758 // 2) If the app is installed and
1759 // a) the app is selected for reinstall, upgrade, or downgrade, then the
1760 // newly installed version will be the version this installer installs,
1761 // and so the version will be ok
1762 // b) the app is not selected for reinstall, upgrade, or downgrade, then
1763 // the version is ok only if the app's current version matches the
1764 // the version of this installer
1766 bOk = !bInstalled || bSel || (CompareVersions(pApp) = 0);
1772 ///////////////////////////////////////////////////////////////////////////////
1774 // Function: DialogShowSdAskComponentDialog
1776 // Purpose: This function asks the user which components to install
1777 // and what the destination folder should be.
1779 ///////////////////////////////////////////////////////////////////////////////
1780 function DialogShowSdAskComponentDialog()
1782 STRING szTitle, szMsg, szComponent, szFilename;
1783 BOOL bClient, bServer, bCc, bDocs, bVersionsOK;
1790 // If running WinNT hide the Light Client component. If the user wants to only
1791 // allow client installs, then hide all but the Client component as well. If not
1792 // running on NT, then hide all but the Light Client component.
1794 ComponentSetData(MEDIA, LIGHT_CLIENT_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1795 ComponentSelectItem(MEDIA, LIGHT_CLIENT_COMP_NAME, FALSE);
1797 if (FindFile(SRCDIR, ALLOW_ONLY_CLIENT_FLAG_FILENAME, szFilename) = 0) then
1798 ComponentSetData(MEDIA, SERVER_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1799 ComponentSetData(MEDIA, CC_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1800 ComponentSetData(MEDIA, DOCS_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1802 ComponentSelectItem(MEDIA, SERVER_COMP_NAME, FALSE);
1803 ComponentSelectItem(MEDIA, CC_COMP_NAME, FALSE);
1804 ComponentSelectItem(MEDIA, DOCS_COMP_NAME, FALSE);
1807 ComponentSetData(MEDIA, CLIENT_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1808 ComponentSetData(MEDIA, SERVER_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1809 ComponentSetData(MEDIA, CC_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1810 ComponentSetData(MEDIA, DOCS_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
1812 ComponentSelectItem(MEDIA, SERVER_COMP_NAME, FALSE);
1813 ComponentSelectItem(MEDIA, CLIENT_COMP_NAME, FALSE);
1814 ComponentSelectItem(MEDIA, CC_COMP_NAME, FALSE);
1815 ComponentSelectItem(MEDIA, DOCS_COMP_NAME, FALSE);
1819 nResult = SdComponentDialog(szTitle, szMsg, svDir, szComponent);
1821 // Enforce selection rules - something must be selected and
1822 // the client must be selected if the server is. However, take into
1823 // account if it is already installed.
1824 bFullClientSel = ComponentIsItemSelected(MEDIA , CLIENT_COMP_NAME);
1825 bLightClientSel = ComponentIsItemSelected(MEDIA , LIGHT_CLIENT_COMP_NAME);
1826 bServerSel = ComponentIsItemSelected(MEDIA , SERVER_COMP_NAME);
1827 bCcSel = ComponentIsItemSelected(MEDIA , CC_COMP_NAME);
1828 bDocsSel = ComponentIsItemSelected(MEDIA , DOCS_COMP_NAME);
1830 if (!bFullClientSel && !bLightClientSel && !bServerSel && !bCcSel && !bDocsSel) then
1831 ShowError(@NOTHING_SELECTED_MSG, SEVERE);
1835 if (bServerSel && !ClientSelectedOrInstalled()) then
1836 ShowError(@SERVER_NEEDS_CLIENT_MSG, SEVERE);
1840 // Also, if upgrading or downgrading, all apps must be at the same version level.
1841 // We won't upgrade one app to a higer version than another, and we won't downgrade
1842 // one app to a lowel version than another. All must be at the same level when the
1843 // install program is done. This is necessary because the apps share some files.
1847 bClient = AppVersionOk(bClientInstalled, bFullClientSel, &appFullClient);
1848 bServer = AppVersionOk(bServerInstalled, bServerSel, &appServer);
1849 bCc = AppVersionOk(bCcInstalled, bCcSel, &appControlCenter);
1850 bDocs = AppVersionOk(bDocsInstalled, bDocsSel, &appDocs);
1851 bVersionsOK = bClient && bServer && bCc && bDocs;
1854 if (!bVersionsOK) then
1855 ShowError(@APPS_NOT_SAME_VERSION, SEVERE);
1866 ///////////////////////////////////////////////////////////////////////////////
1868 // Function: DialogShowSdSetupType
1870 // Purpose: This function displays the standard setup type dialog.
1872 ///////////////////////////////////////////////////////////////////////////////
1873 function DialogShowSdSetupType()
1874 NUMBER nResult, nType;
1875 STRING szTitle, szMsg, szReserved;
1879 if (svSetupType == "") then
1880 svSetupType = "AFS Server";
1884 szMsg = @SETUP_TYPE_MSG;
1887 nResult = SdSetupTypeEx(szTitle, szMsg, szReserved, svSetupType, 0);
1893 ///////////////////////////////////////////////////////////////////////////////
1895 // Function: DialogShowSdSelectFolder
1897 // Purpose: This function displays the standard folder selection dialog.
1900 ///////////////////////////////////////////////////////////////////////////////
1901 function DialogShowSdSelectFolder()
1903 STRING szTitle, szMsg;
1905 if (SHELL_OBJECT_FOLDER = "") then
1906 SHELL_OBJECT_FOLDER = @FOLDER_NAME;
1909 // We are going to force the user to use the default folder name. This is
1910 // because we create the folder unlogged, and must therefore remove it
1911 // ourselves in our uninstall dll (which we do because IS doesn't handle
1912 // removing them correctly). Therefore, we must know the name of the
1913 // folder so we can remove it during uninstall. Also, the user can install
1914 // the AFS components during several executions of the install program,
1915 // and we don't want to allow them to pick a different folder each time.
1916 // We could solve these problems in code but we don't have time, so we
1917 // are going to force them to use our default folder name.
1922 nResult = SdSelectFolder( szTitle, szMsg, SHELL_OBJECT_FOLDER);
1928 ///////////////////////////////////////////////////////////////////////////////
1930 // Function: DialogShowSdFinishReboot
1932 // Purpose: This function will show the last dialog of the product.
1933 // It will allow the user to reboot and/or show some readme text.
1935 ///////////////////////////////////////////////////////////////////////////////
1936 function DialogShowSdFinishReboot()
1937 NUMBER nResult, nDefOptions;
1938 STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
1939 NUMBER bOpt1, bOpt2;
1941 if (!BATCH_INSTALL) then
1944 szMsg1 = @SETUP_FINISHED_MSG;
1949 nResult = SdFinish(szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
1953 nDefOptions = SYS_BOOTMACHINE;
1957 nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );
1963 ///////////////////////////////////////////////////////////////////////////////
1965 // Function: ConfigServerService
1967 // Purpose: This function will configure the AFS Server bos service via the
1970 ///////////////////////////////////////////////////////////////////////////////
1971 function ConfigServerService()
1978 if (!bWSPPInstall) then
1979 szMsg = @CONFIGURING_AFS_SERVER_SERVICE;
1980 SdShowMsg(szMsg, TRUE);
1983 nStatus = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
1984 if (nStatus < 0) goto error;
1986 nStatus = InstallServerService(TARGETDIR ^ "\\Server\\usr\\afs\\bin\\bosctlsvc.exe");
1987 if (nStatus < 0) goto error;
1992 if (!bWSPPInstall) then
1993 SdShowMsg(szMsg, FALSE);
1997 Sprintf(szMsg, @AFS_SERVER_SERVICE_INSTALL_ERROR, nStatus);
1998 ShowError(szMsg, SEVERE);
1999 bInstallAborted = TRUE;
2007 ///////////////////////////////////////////////////////////////////////////////
2009 // Function: ConfigClientService
2011 // Purpose: This function will configure the AFS Client service via the SCM.
2013 ///////////////////////////////////////////////////////////////////////////////
2014 function ConfigClientService()
2021 if (!bWSPPInstall) then
2022 szMsg = @CONFIGURING_AFS_CLIENT_SERVICE;
2023 SdShowMsg(szMsg, TRUE);
2026 nStatus = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
2027 if (nStatus < 0) goto error;
2029 nStatus = InstallClientService(TARGETDIR ^ "\\Client\\Program\\afsd_service.exe");
2030 if (nStatus < 0) goto error;
2035 if (!bWSPPInstall) then
2036 SdShowMsg(szMsg, FALSE);
2040 Sprintf(szMsg, @AFS_CLIENT_SERVICE_INSTALL_ERROR, nStatus);
2041 ShowError(szMsg, SEVERE);
2042 bInstallAborted = TRUE;
2049 ///////////////////////////////////////////////////////////////////////////////
2051 // Function: AddPath
2053 // Purpose: This function will add the specified path to the system PATH
2054 // environment variable.
2056 ///////////////////////////////////////////////////////////////////////////////
2057 function AddPath(szPath)
2059 LongPathToShortPath(szPath);
2061 if (AddToPath(szPath) < 0) then
2062 ShowError(@ADD_PATH_ERROR, WARNING);
2069 ///////////////////////////////////////////////////////////////////////////////
2071 // Function: ConfigUninstallDLL
2073 // Purpose: This function will modify the uninstall entry for these products
2074 // to use an uninstall dll.
2076 ///////////////////////////////////////////////////////////////////////////////
2077 function ConfigUninstallDLL(pApp)
2081 if (!pApp->bUseUninstDLL) then
2085 nStatus = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
2086 if (nStatus < 0) goto error;
2088 svValue = UNINST + " -c\"" + pApp->szBinPath ^ pApp->szUninstDllName + "\" -f\"" + TARGETDIR ^ pApp->szUninstLogfileName + "\"";
2090 nStatus = RegDBSetKeyValueEx(MSUNINSTALL_KEY ^ pApp->szProductName, "UninstallString", REGDB_STRING, svValue, -1);
2091 if (nStatus < 0) goto error;
2100 ///////////////////////////////////////////////////////////////////////////////
2102 // Function: CreateServerDirs
2104 // Purpose: This function will create directories that the server programs
2105 // need. The creation of these is not logged, and so they will be
2106 // deleted by the uninstall dll.
2108 ///////////////////////////////////////////////////////////////////////////////
2109 function CreateServerDirs()
2111 CreateDir(TARGETDIR ^ "\\Server\\usr\\afs\\logs");
2112 CreateDir(TARGETDIR ^ "\\Server\\usr\\afs\\etc");
2113 CreateDir(TARGETDIR ^ "\\Server\\usr\\afs\\local");
2117 ///////////////////////////////////////////////////////////////////////////////
2119 // Function: GetDateTimeString()
2121 // Purpose: This function will return a string containing the current date
2124 ///////////////////////////////////////////////////////////////////////////////
2125 function GetDateTimeString(szDateTime)
2126 STRING szDate, szTime;
2127 NUMBER nDate, nTime;
2129 GetSystemInfo(DATE, nDate, szDate);
2130 GetSystemInfo(TIME, nTime, szTime);
2132 szDateTime = szDate + " " + szTime;
2136 ///////////////////////////////////////////////////////////////////////////////
2138 // Function: SetUserVars()
2140 // Purpose: This function will set at runtime values for user defined variables
2141 // we set up in the Registry Entries GUI tool.
2143 ///////////////////////////////////////////////////////////////////////////////
2144 function SetUserVars()
2146 string szInstallDate;
2149 string szReleaseType;
2151 // Set the install date variable's value
2152 GetDateTimeString(szInstallDate);
2154 ComponentSetTarget(MEDIA, "<INSTALL_DATE>", szInstallDate);
2156 // Set the proper client logon dll
2157 if (bFullClientSel) then
2158 ComponentSetTarget(MEDIA, "<LOGON_DLL>", TARGETDIR ^ FULL_CLIENT_LOGON_DLL);
2159 elseif (bLightClientSel) then
2160 ComponentSetTarget(MEDIA, "<LOGON_DLL>", TARGETDIR ^ LIGHT_CLIENT_LOGON_DLL);
2163 // Set the client description and title values
2164 if (bFullClientSel || bLightClientSel) then
2166 if (bFullClientSel) then
2167 szDesc = @CLIENT_DESC;
2168 szTitle = @CLIENT_TITLE;
2170 szDesc = @LIGHT_CLIENT_DESC;
2171 szTitle = @LIGHT_CLIENT_TITLE;
2174 ComponentSetTarget(MEDIA, "<CLIENT_DESC>", szDesc);
2175 ComponentSetTarget(MEDIA, "<CLIENT_TITLE>", szTitle);
2178 if (bServerSel) then
2179 ComponentSetTarget(MEDIA, "<EVENT_MSG_DLL>", TARGETDIR ^ "Common\\afseventmsg_" + szCodePage + ".dll");
2182 szReleaseType = @PRODUCT_VERSION_RELEASE_TYPE;
2183 ComponentSetTarget(MEDIA, "<RELEASE_TYPE>", szReleaseType);
2190 ///////////////////////////////////////////////////////////////////////////////
2192 // Function: SetNetworkProviderOrder()
2194 // Purpose: This function will add the AFS Client service name to the
2195 // ProviderOrder value of the
2196 // HKLM\SYSTEM\CurrentControlSet\ControlNetworkProvider\Order key.
2197 // It makes a call to the setup dll to do this.
2198 ///////////////////////////////////////////////////////////////////////////////
2199 function SetNetworkProviderOrder()
2202 nStatus = AddToNetworkProviderOrder(CLIENT_SERVICE_NAME);
2203 if (nStatus < 0) then
2204 ShowError(@SET_NETWORK_PROVIDER_ERROR, SEVERE);
2211 ///////////////////////////////////////////////////////////////////////////////
2213 // Function: CreateRegistrySets()
2215 // Purpose: This function will create the registry entries for each resgistry
2216 // set in the passed in string. The string must be a comma separated
2217 // list of registry sets created using the IS Registry Entries GUI.
2219 ///////////////////////////////////////////////////////////////////////////////
2220 function CreateRegistrySets(szRegistrySets)
2225 nRegSetListID = ListCreate(STRINGLIST);
2227 StrGetTokens(nRegSetListID, szRegistrySets, ",");
2229 nResult = ListGetFirstString(nRegSetListID, szRegSet);
2230 while (nResult != END_OF_LIST)
2231 // MessageBox(szRegSet, INFORMATION);
2232 CreateRegistrySet(szRegSet);
2233 nResult = ListGetNextString(nRegSetListID, szRegSet);
2236 ListDestroy(nRegSetListID);
2240 ///////////////////////////////////////////////////////////////////////////////
2242 // Function: ConfigAfsCreds()
2244 // Purpose: This function will config the AFS Client Credentials tool.
2246 ///////////////////////////////////////////////////////////////////////////////
2247 function ConfigAfsCreds()
2250 nResult = LaunchAppAndWait(TARGETDIR ^ "Client\\Program\\afscreds.exe", "/install", WAIT);
2251 if (nResult < 0) then
2252 ShowError(@CONFIGURING_AFS_CREDS_ERROR, INFORMATION);
2259 ///////////////////////////////////////////////////////////////////////////////
2261 // Function: IsAppInstalled
2263 // Purpose: This function will determine if an app is installed, and if it is,
2264 // will set its iVer info.
2266 ///////////////////////////////////////////////////////////////////////////////
2267 function IsAppInstalled(pApp)
2272 string szMajorVersion, szMinorVersion, szPatchLevel, szBetaLevel, szReleaseType, szTitle;
2274 nResult = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
2275 if (nResult < 0) goto error;
2277 szKey = COMPANY_REG_KEY ^ pApp->szProductName ^ "CurrentVersion";
2279 nResult = RegDBGetKeyValueEx(szKey, "MajorVersion", nType, szMajorVersion, nSize);
2280 if (nResult < 0) goto error;
2282 nResult = RegDBGetKeyValueEx(szKey, "MinorVersion", nType, szMinorVersion, nSize);
2283 if (nResult < 0) goto error;
2285 nResult = RegDBGetKeyValueEx(szKey, "PatchLevel", nType, szPatchLevel, nSize);
2286 if (nResult < 0) goto error;
2288 nResult = RegDBGetKeyValueEx(szKey, "BetaLevel", nType, szBetaLevel, nSize);
2289 // It's ok for this to fail. Pre-3.5 3.32 releases did not use this.
2291 nResult = RegDBGetKeyValueEx(szKey, "VersionString", nType, szTitle, nSize);
2292 if (nResult < 0) goto error;
2294 nResult = RegDBGetKeyValueEx(szKey, "ReleaseType", nType, szReleaseType, nSize);
2295 if (nResult < 0) then
2296 if ((pApp->szProductName = "AFS Client") && (szTitle = "3.4a")) then
2297 // This value won't exist for 3.4a clients
2298 szReleaseType = RELEASE_TYPE_GA;
2300 // This value won't exist for any 3.5 beta versions
2301 szReleaseType = RELEASE_TYPE_BETA;
2305 SetupVerInfo(pApp, szMajorVersion, szMinorVersion, szPatchLevel, szBetaLevel, szReleaseType, szTitle, TRUE);
2314 ///////////////////////////////////////////////////////////////////////////////
2316 // Function: LocalizeComponents()
2318 // Purpose: This function updates all components to use localized text
2319 // in their status fields as appropriate
2321 ///////////////////////////////////////////////////////////////////////////////
2322 function LocalizeComponents()
2324 LocalizeComponentStatusText ("Client\\Client_Common");
2325 LocalizeComponentStatusText ("Client\\Client_Program\\Client_Headers\\Client_Afs_Headers");
2326 LocalizeComponentStatusText ("Client\\Client_Program\\Client_Headers\\Client_Main_Headers");
2327 LocalizeComponentStatusText ("Client\\Client_Program\\Client_Headers\\Client_Rx_Headers");
2328 LocalizeComponentStatusText ("Client\\Client_Program\\Client_Headers");
2329 LocalizeComponentStatusText ("Client\\Client_Program\\Client_Sample");
2330 LocalizeComponentStatusText ("Client\\Client_Program");
2331 LocalizeComponentStatusText ("Client\\Client_System32");
2332 LocalizeComponentStatusText ("Client\\Client_WinDir");
2333 LocalizeComponentStatusText ("Client");
2334 LocalizeComponentStatusText ("Components");
2335 LocalizeComponentStatusText ("Control_Center\\Control_Center_Common");
2336 LocalizeComponentStatusText ("Control_Center\\Control_Center_Program");
2337 LocalizeComponentStatusText ("Control_Center\\Control_Center_System32");
2338 LocalizeComponentStatusText ("Control_Center\\Control_Center_WinDir");
2339 LocalizeComponentStatusText ("Control_Center");
2340 LocalizeComponentStatusText ("Documentation\\English\\Cmd_Ref");
2341 LocalizeComponentStatusText ("Documentation\\English\\Doc_Misc");
2342 LocalizeComponentStatusText ("Documentation\\English\\Sys_Admin_Guide");
2343 LocalizeComponentStatusText ("Documentation\\English");
2344 LocalizeComponentStatusText ("Documentation\\German\\Cmd_Ref");
2345 LocalizeComponentStatusText ("Documentation\\German\\Doc_Misc");
2346 LocalizeComponentStatusText ("Documentation\\German\\Sys_Admin_Guide");
2347 LocalizeComponentStatusText ("Documentation\\German");
2348 LocalizeComponentStatusText ("Documentation\\Japanese\\Cmd_Ref");
2349 LocalizeComponentStatusText ("Documentation\\Japanese\\Doc_Misc");
2350 LocalizeComponentStatusText ("Documentation\\Japanese\\Sys_Admin_Guide");
2351 LocalizeComponentStatusText ("Documentation\\Japanese");
2352 LocalizeComponentStatusText ("Documentation\\Korean\\Cmd_Ref");
2353 LocalizeComponentStatusText ("Documentation\\Korean\\Doc_Misc");
2354 LocalizeComponentStatusText ("Documentation\\Korean\\Sys_Admin_Guide");
2355 LocalizeComponentStatusText ("Documentation\\Korean");
2356 LocalizeComponentStatusText ("Documentation\\Portuguese\\Cmd_Ref");
2357 LocalizeComponentStatusText ("Documentation\\Portuguese\\Doc_Misc");
2358 LocalizeComponentStatusText ("Documentation\\Portuguese\\Sys_Admin_Guide");
2359 LocalizeComponentStatusText ("Documentation\\Portuguese");
2360 LocalizeComponentStatusText ("Documentation\\Simp_Chinese\\Cmd_Ref");
2361 LocalizeComponentStatusText ("Documentation\\Simp_Chinese\\Doc_Misc");
2362 LocalizeComponentStatusText ("Documentation\\Simp_Chinese\\Sys_Admin_Guide");
2363 LocalizeComponentStatusText ("Documentation\\Simp_Chinese");
2364 LocalizeComponentStatusText ("Documentation\\Spanish\\Cmd_Ref");
2365 LocalizeComponentStatusText ("Documentation\\Spanish\\Doc_Misc");
2366 LocalizeComponentStatusText ("Documentation\\Spanish\\Sys_Admin_Guide");
2367 LocalizeComponentStatusText ("Documentation\\Spanish");
2368 LocalizeComponentStatusText ("Documentation\\Trad_Chinese\\Cmd_Ref");
2369 LocalizeComponentStatusText ("Documentation\\Trad_Chinese\\Doc_Misc");
2370 LocalizeComponentStatusText ("Documentation\\Trad_Chinese\\Sys_Admin_Guide");
2371 LocalizeComponentStatusText ("Documentation\\Trad_Chinese");
2372 LocalizeComponentStatusText ("Documentation");
2373 LocalizeComponentStatusText ("Info");
2374 LocalizeComponentStatusText ("Languages\\Lang_English");
2375 LocalizeComponentStatusText ("Languages\\Lang_German");
2376 LocalizeComponentStatusText ("Languages\\Lang_Japanese");
2377 LocalizeComponentStatusText ("Languages\\Lang_Korean");
2378 LocalizeComponentStatusText ("Languages\\Lang_Portuguese");
2379 LocalizeComponentStatusText ("Languages\\Lang_Simp_Chinese");
2380 LocalizeComponentStatusText ("Languages\\Lang_Spanish");
2381 LocalizeComponentStatusText ("Languages\\Lang_Trad_Chinese");
2382 LocalizeComponentStatusText ("Languages");
2383 LocalizeComponentStatusText ("Light_Client\\Win95\\Light95_Client_Common");
2384 LocalizeComponentStatusText ("Light_Client\\Win95\\Light95_Client_Program");
2385 LocalizeComponentStatusText ("Light_Client\\Win95\\Light95_Client_System32");
2386 LocalizeComponentStatusText ("Light_Client\\Win95\\Light95_Client_WinDir");
2387 LocalizeComponentStatusText ("Light_Client\\Win95");
2388 LocalizeComponentStatusText ("Light_Client\\Win98\\Light_Client_Common");
2389 LocalizeComponentStatusText ("Light_Client\\Win98\\Light_Client_Program");
2390 LocalizeComponentStatusText ("Light_Client\\Win98\\Light_Client_System32");
2391 LocalizeComponentStatusText ("Light_Client\\Win98\\Light_Client_WinDir");
2392 LocalizeComponentStatusText ("Light_Client\\Win98");
2393 LocalizeComponentStatusText ("Light_Client");
2394 LocalizeComponentStatusText ("Readme\\English\\Doc_Misc");
2395 LocalizeComponentStatusText ("Readme\\English\\Install_Guide");
2396 LocalizeComponentStatusText ("Readme\\English\\Release_Notes");
2397 LocalizeComponentStatusText ("Readme\\English");
2398 LocalizeComponentStatusText ("Readme\\German\\Doc_Misc");
2399 LocalizeComponentStatusText ("Readme\\German\\Install_Guide");
2400 LocalizeComponentStatusText ("Readme\\German\\Release_Notes");
2401 LocalizeComponentStatusText ("Readme\\German");
2402 LocalizeComponentStatusText ("Readme\\Japanese\\Doc_Misc");
2403 LocalizeComponentStatusText ("Readme\\Japanese\\Install_Guide");
2404 LocalizeComponentStatusText ("Readme\\Japanese\\Release_Notes");
2405 LocalizeComponentStatusText ("Readme\\Japanese");
2406 LocalizeComponentStatusText ("Readme\\Korean\\Doc_Misc");
2407 LocalizeComponentStatusText ("Readme\\Korean\\Install_Guide");
2408 LocalizeComponentStatusText ("Readme\\Korean\\Release_Notes");
2409 LocalizeComponentStatusText ("Readme\\Korean");
2410 LocalizeComponentStatusText ("Readme\\Portuguese\\Doc_Misc");
2411 LocalizeComponentStatusText ("Readme\\Portuguese\\Install_Guide");
2412 LocalizeComponentStatusText ("Readme\\Portuguese\\Release_Notes");
2413 LocalizeComponentStatusText ("Readme\\Portuguese");
2414 LocalizeComponentStatusText ("Readme\\Simp_Chinese\\Doc_Misc");
2415 LocalizeComponentStatusText ("Readme\\Simp_Chinese\\Install_Guide");
2416 LocalizeComponentStatusText ("Readme\\Simp_Chinese\\Release_Notes");
2417 LocalizeComponentStatusText ("Readme\\Simp_Chinese");
2418 LocalizeComponentStatusText ("Readme\\Spanish\\Doc_Misc");
2419 LocalizeComponentStatusText ("Readme\\Spanish\\Install_Guide");
2420 LocalizeComponentStatusText ("Readme\\Spanish\\Release_Notes");
2421 LocalizeComponentStatusText ("Readme\\Spanish");
2422 LocalizeComponentStatusText ("Readme\\Trad_Chinese\\Doc_Misc");
2423 LocalizeComponentStatusText ("Readme\\Trad_Chinese\\Install_Guide");
2424 LocalizeComponentStatusText ("Readme\\Trad_Chinese\\Release_Notes");
2425 LocalizeComponentStatusText ("Readme\\Trad_Chinese");
2426 LocalizeComponentStatusText ("Readme");
2427 LocalizeComponentStatusText ("Server\\Server_Common");
2428 LocalizeComponentStatusText ("Server\\Server_Program");
2429 LocalizeComponentStatusText ("Server\\Server_System32");
2430 LocalizeComponentStatusText ("Server\\Server_WinDir");
2431 LocalizeComponentStatusText ("Server");
2435 ///////////////////////////////////////////////////////////////////////////////
2437 // Function: LocalizeComponentStatusText()
2439 // Purpose: This function updates one component to use localized text
2440 // in its status fields as appropriate
2442 ///////////////////////////////////////////////////////////////////////////////
2443 function LocalizeComponentStatusText (svComponent)
2448 ComponentGetData (MEDIA, svComponent, COMPONENT_FIELD_STATUS, dwResult, svOriginal);
2450 if (svOriginal == "CLIENT") then
2451 svLocalized = @STATUS_INSTALLING_CLIENT;
2452 elseif (svOriginal == "SERVER") then
2453 svLocalized = @STATUS_INSTALLING_SERVER;
2454 elseif (svOriginal == "CCENTER") then
2455 svLocalized = @STATUS_INSTALLING_CCENTER;
2456 elseif (svOriginal == "LIGHT") then
2457 svLocalized = @STATUS_INSTALLING_LIGHT;
2458 elseif (svOriginal == "HEADERS") then
2459 svLocalized = @STATUS_INSTALLING_HEADERS;
2460 elseif (svOriginal == "DOCS") then
2461 svLocalized = @STATUS_INSTALLING_DOCS;
2462 elseif (svOriginal == "LANGUAGE") then
2463 svLocalized = @STATUS_INSTALLING_LANGUAGE;
2468 ComponentSetData(MEDIA, svComponent, COMPONENT_FIELD_STATUS, 0, svLocalized);
2472 ///////////////////////////////////////////////////////////////////////////////
2474 // Function: DetectInstalledComponents()
2476 // Purpose: This function will detect if any of our components is already
2479 ///////////////////////////////////////////////////////////////////////////////
2480 function DetectInstalledComponents()
2483 bClientInstalled = IsAppInstalled(&appFullClient);
2484 bServerInstalled = IsAppInstalled(&appServer);
2485 bCcInstalled = IsAppInstalled(&appControlCenter);
2486 bDocsInstalled = IsAppInstalled(&appDocs);
2488 // The light client uses the client's registry entries. There is a light
2489 // client entry, but it contains nothing under it. IS makes it but we
2491 bLightClientInstalled = IsAppInstalled(&appLightClient);
2496 ///////////////////////////////////////////////////////////////////////////////
2498 // Function: ParseCommandLine
2500 // Purpose: This function parses the command line to set up a silent install
2502 ///////////////////////////////////////////////////////////////////////////////
2503 function ParseCommandLine()
2505 STRING szTemp, szResult[MAX_STRING_LEN], szParms;
2508 bWSPPInstall = FALSE;
2509 bPreinstallReplace = FALSE;
2513 // Need a list to hold the parms
2514 listParms = ListCreate(STRINGLIST);
2516 // Break parms into semicolon separated tokens and put into list
2517 if (StrGetTokens(listParms, szParms, ";") = 0 ) then
2518 nResult = ListGetFirstString(listParms, szResult);
2520 // Do until the end of the list
2521 while (nResult != END_OF_LIST)
2522 if (StrFind(szResult, "DIR=") > -1 ) then
2523 nResult = StrSub(szTemp, szResult, 4, MAX_STRING_LEN);
2524 TARGETDIR = szTemp + "\\AFS";
2526 elseif (StrFind(szResult, "P=") > -1 ) then
2527 nResult = StrSub(szTemp, szResult, StrFind(szResult, "P=") + 2, 1);
2528 if (StrFind(szTemp, "Y") > -1 ) then
2529 bPreinstallReplace = TRUE;
2532 elseif (StrFind(szResult, "C=") > -1 ) then
2533 ProcessCompsOnCmdLn(szResult);
2536 nResult = ListGetNextString(listParms, szResult);
2542 ///////////////////////////////////////////////////////////////////////////////
2544 // Function: ProcessCompsOnCmdLn
2546 // Purpose: This function puts the components in a list and
2547 // checks for setup types on the command line.
2550 ///////////////////////////////////////////////////////////////////////////////
2551 function ProcessCompsOnCmdLn(szParms)
2552 NUMBER nResult, nIndex;
2555 bWSPPInstall = TRUE;
2557 // Strip c= off cmdln string
2558 nResult = StrSub(szParms, szParms, StrFind(szParms, "C=") + 2, StrLength(szParms) - 2);
2560 // Get each component from the cmd line
2561 while (StrLength(szParms))
2562 nIndex = StrSub(szComp, szParms, 0, StrFind(szParms, ","));
2563 if (!nIndex) then // if comma not found then last item in list
2565 nIndex = StrLength(szComp); // for extracting this string
2568 if (StrFind(szComp, "Client") > -1) then
2569 bFullClientSel = TRUE;
2570 elseif (StrFind(szComp, "Server") > -1) then
2572 elseif (StrFind(szComp, "ControlCtr") > -1) then
2576 // Delete component from the command line string
2577 StrSub(szParms, szParms, nIndex + 1, StrLength(szParms));
2582 ///////////////////////////////////////////////////////////////////////////////
2584 // Function: RemoveInstalledBits
2586 // Purpose: This function silently uninstalls a product.
2588 ///////////////////////////////////////////////////////////////////////////////
2589 function RemoveInstalledBits(szProductName)
2592 string szValue[MAX_STRING_LEN];
2593 string szProgram[256];
2594 string szCmdLine[128];
2598 // Check for a special case - version 3.4a of the AFS Client
2599 if ((szProductName = "AFS Client") && (appFullClient.iVer.szTitle = "3.4a")) then
2600 return Eradicate34Client();
2603 nStatus = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
2604 if (nStatus < 0) goto error;
2606 nStatus = RegDBGetKeyValueEx(MSUNINSTALL_KEY ^ szProductName, "UninstallString", nType, szValue, nSize);
2607 if (nStatus < 0) goto error;
2609 nIndex = StrFind(szValue, " ");
2610 if (nIndex < 0) goto error;
2612 StrSub(szProgram, szValue, 0, nIndex);
2613 StrSub(szCmdLine, szValue, nIndex + 1, 128);
2615 // Make the uninstall run silently
2616 szCmdLine = szCmdLine + " -a";
2618 nStatus = LaunchAppAndWait(szProgram, szCmdLine, WAIT);
2619 if (nStatus < 0) goto error;
2628 ///////////////////////////////////////////////////////////////////////////////
2630 // Function: AddShortCut
2632 // Purpose: Adds a short cut to the start menu.
2634 ///////////////////////////////////////////////////////////////////////////////
2635 function AddShortCut(szFolder, szName, szCmdPath, szArgs)
2639 szCmdPath = TARGETDIR ^ szCmdPath;
2640 LongPathToQuote(szCmdPath, TRUE);
2642 szCmd = szCmdPath + " " + szArgs;
2644 nResult = AddFolderIcon(SHELL_OBJECT_FOLDER ^ szFolder, szName, szCmd, "", "", 0, "", REPLACE);
2650 ///////////////////////////////////////////////////////////////////////////////
2652 // Function: CreateStartMenuEntries
2654 // Purpose: This function creates start menu entries for our apps.
2656 ///////////////////////////////////////////////////////////////////////////////
2657 function CreateStartMenuEntries()
2659 if (bServerSel) then
2660 AddShortCut(@SERVER_GROUP_NAME, @CFG_WIZARD_ITEM_NAME, CFG_WIZARD_CMD_PATH, CFG_WIZARD_ARGS);
2663 if (bFullClientSel) then
2664 AddShortCut(@CLIENT_GROUP_NAME, @CREDS_TOOL_ITEM_NAME, CREDS_TOOL_CMD_PATH, CREDS_TOOL_ARGS);
2665 AddShortCut(@CLIENT_GROUP_NAME, @CLIENT_HELP_ITEM_NAME, CLIENT_HELP_CMD_PATH, CLIENT_HELP_ARGS);
2669 AddShortCut(@CCENTER_GROUP_NAME, @SERVER_MANAGER_ITEM_NAME, SERVER_MANAGER_CMD_PATH, SERVER_MANAGER_ARGS);
2670 AddShortCut(@CCENTER_GROUP_NAME, @ACCT_MANAGER_ITEM_NAME, ACCT_MANAGER_CMD_PATH, ACCT_MANAGER_ARGS);
2673 if (bLightClientSel) then
2674 AddShortCut(@LIGHT_GROUP_NAME, @CREDS_TOOL_ITEM_NAME, CREDS_TOOL_CMD_PATH, CREDS_TOOL_ARGS);
2675 AddShortCut(@LIGHT_GROUP_NAME, @LIGHT_CLIENT_HELP_ITEM_NAME, LIGHT_CLIENT_HELP_CMD_PATH, LIGHT_CLIENT_HELP_ARGS);
2678 AddShortCut("", @DOCUMENTATION_ITEM_NAME, DOCUMENTATION_CMD_PATH, DOCUMENTATION_ARGS);
2682 ///////////////////////////////////////////////////////////////////////////////
2684 // Function: ShowError
2686 // Purpose: This function shows an error to the user when not in silent mode,
2687 // and will log an error to a file when in silent mode.
2689 ///////////////////////////////////////////////////////////////////////////////
2690 function ShowError(szMsg, nType)
2694 if (!bWSPPInstall) then
2695 MessageBox(szMsg, nType);
2700 case WARNING: szType = "Warning: ";
2701 case SEVERE: szType = "Error: ";
2702 case INFORMATION: szType = "Note: ";
2703 default: szType = "Unknown error type: ";
2706 WriteToInstallErrorLog(szType + szMsg);
2710 ///////////////////////////////////////////////////////////////////////////////
2712 // Function: CheckCopyCellServDB
2714 // Purpose: During install the CellServDB file is copied into the Common dir.
2715 // If the user does not already have this file, we will copy it for
2716 // them into the windows directory. If they already do have the
2717 // file, then we will do nothing.
2718 ///////////////////////////////////////////////////////////////////////////////
2719 function CheckCopyCellServDB()
2723 nResult = FindFile(WINDIR, CELLSERVDB_FILENAME, szResult);
2724 if (nResult < 0) then
2725 VarSave(SRCTARGETDIR);
2726 SRCDIR = TARGETDIR ^ "Common";
2728 CopyFile(CELLSERVDB_FILENAME, CELLSERVDB_FILENAME);
2729 VarRestore(SRCTARGETDIR);
2734 // --- include script file section ---
2735 #include "sddialog.rul"