From bbc4200bdcbb5fae39b78c8f01ebd2dc66776459 Mon Sep 17 00:00:00 2001 From: rrt Date: Thu, 9 Nov 2000 11:37:25 +0000 Subject: [PATCH] [project @ 2000-11-09 11:37:24 by rrt] Add more bits of InstallShield setup --- ghc/InstallShield/Registry Entries/Default.rge | 6 + ghc/InstallShield/Script Files/Setup.Inx | Bin 0 -> 3931 bytes ghc/InstallShield/Script Files/Setup.Obs | Bin 0 -> 132 bytes ghc/InstallShield/Script Files/Setup.dbg | Bin 0 -> 2960 bytes ghc/InstallShield/Script Files/Setup.ino | Bin 0 -> 4350 bytes ghc/InstallShield/Script Files/Setup.ins | Bin 0 -> 5413 bytes ghc/InstallShield/Script Files/Setup.map | 574 ++++++++++++++ ghc/InstallShield/Script Files/setup.rul | 950 ++++++++++++++++++++++++ 8 files changed, 1530 insertions(+) create mode 100644 ghc/InstallShield/Registry Entries/Default.rge create mode 100644 ghc/InstallShield/Script Files/Setup.Inx create mode 100644 ghc/InstallShield/Script Files/Setup.Obs create mode 100644 ghc/InstallShield/Script Files/Setup.dbg create mode 100644 ghc/InstallShield/Script Files/Setup.ino create mode 100644 ghc/InstallShield/Script Files/Setup.ins create mode 100644 ghc/InstallShield/Script Files/Setup.map create mode 100644 ghc/InstallShield/Script Files/setup.rul diff --git a/ghc/InstallShield/Registry Entries/Default.rge b/ghc/InstallShield/Registry Entries/Default.rge new file mode 100644 index 0000000..f73a93c --- /dev/null +++ b/ghc/InstallShield/Registry Entries/Default.rge @@ -0,0 +1,6 @@ +[Data] + +[General] +Type=REGISTRYDATA +Version=2.10.000 + diff --git a/ghc/InstallShield/Script Files/Setup.Inx b/ghc/InstallShield/Script Files/Setup.Inx new file mode 100644 index 0000000000000000000000000000000000000000..4aef7fa61890db98d0603055809868953d3db9e5 GIT binary patch literal 3931 zcmaJ^OLH5?5pDpB1;M9YDLFSDe6Xu*hoY>+yrcpGRD?1B!2l#BIhZv72H@I*9b|Vv ziYgy+%wKYqe?a~f^7YI180}ua0|W{>^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k8JxRrS9pQ%wv8^m2V0Y= T*J-S9r`^xs6Uxu((~|@Dg>8g7Ug8-r7MJ_ zCTHa3=j5knrWWfc_>`pRDLCfjC% literal 0 HcmV?d00001 diff --git a/ghc/InstallShield/Script Files/Setup.dbg b/ghc/InstallShield/Script Files/Setup.dbg new file mode 100644 index 0000000000000000000000000000000000000000..7c868708780ecd184a0518d8146f4da26746fd63 GIT binary patch literal 2960 zcmbW2Ym6jS701unndzRMo|&E9VHf;h?Dzzf#a#q4N}}Ce)jdU5S9j`G&$^q5O?CI( z?%J)XYO1Pdr`MoS68voZA_@q&AO;fNuOJws#zzQ`gog`Ch|#D(3{ewJOpNEA>X{uA zKM?vu|LUB3ZryYL=iXDNTFG$;hvUfW50b*g-Af9GS5`iK8U3vkMB+uh7xW8`><)s^ z5Br{sKUFZ3-l0O#_Y1a~6Ble5%V<;f4#9i;As~Db%AZ}Yu9gc%5GSthi-9No-n!^U z-Y_XtJYUA^LMEf(A$#PTuopUOo;+RN7$&t*;3e_$c}FXjn(TTTuAhgFCAX5&C`rPA zjFQ_ul^P4sDZ4>e`a5RD3%q!+V;Yq&+6^moLfY6Obl5y5<6X8{*|zCrG;UTV;gkxS zjlhIS zVke9e*;ARtR~#vM32QzJz85D=HyPxiUNkI6w~AI--v>fB^|GUDZL?@qTg9qA4fTem zzsI`2@31D!ff2|=*k#SI_d|SUlD;NA5~?Q0dGd)~GYWg7ZZbrE6)I?MlPcbUO!5(XQ$aEu4Wg zfjnr2s2xuI8E9FmI7<^!k=nws4XZi>@uucQxip(p&3KaqR@Iv$e^W-j8c-RRynv$j z?L4)D*mvWB?5RQ1>r4jIr=3CdcFj#(8l6w$^ex#XD+5Oji;~W!6t$ds5XS`h=5`)M zZ4N}M*=*QqgIOroHPf*492jCvw}sKL79rK4t?8oXG@47>Hl0V?sq0p2CxSh#=HBgy zrroI8#k!b>$&=Ds3{QhFvc@q{n`8hMkjDKkT@^L)}J< zIyvB~8o`M$3lm=k(r&N-s+rlcPd6%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(io#UCe(u;1})a;BcUyD(&JREBLKqVQ&XbC$(P^5VK+anji$G?JbKX^s7NA7L_N)#xflc0*=0XzKe O`0X;1y2SM4u>A|t5q${& literal 0 HcmV?d00001 diff --git a/ghc/InstallShield/Script Files/Setup.ins b/ghc/InstallShield/Script Files/Setup.ins new file mode 100644 index 0000000000000000000000000000000000000000..156a8eecdce2e457a3dd33a360f8dafcb46b4959 GIT binary patch literal 5413 zcmd5=+j86172V)X6m_-bDCtZdnA^lk?9_2P?WA!#1Cfw~3M4oHX^#@MEGWVm?BeVt<$;#r&^YIXsHeM%YKK}sAe`AW;43og{6j8*VT7vOQOZ%_ItDg&osm6 zn)|=kYVEGDe;+;(Pz=>>cj05lXe(6a*dD7!N6R5CM;t_#PpV<$LD*N@wIfL=P=Oj| zT`M9DhIx3THtPn|2np&=`W7q|C=Zze4c(^!kMb0FJ`ajC9-KdmXeH`-LEt@))olG6 zV6aS%&R)jXS3d6KPmYQp6yk$v;*ea);cJ$Y))P|fkJQUgQPb2cTAIUpf;*2;T!n44_=8Aj)-zG z3d=G_q9pOkxYM!ob0CqG7G*q%MS&?S3ZD{urlvXUvE+(a=lv1#396JAmebrUhhvzH zFsV6nr2PM)rn8Xbh^f+sMB?5{B9gfgt3ev&W{&WMWz+ImT(%|-X;*aVB9GV-OEFLU zrH(*I=K-$-sBxYS>-sv`?$A98%-)}I&PAo?@+(nuLEttWxY^3(0wu(^}QDYFc(Si(?&=Du{Lxjlcw|B%|}>_!C35 zdQCKALas#Q;kh2T&jol^t<3xb@9bj2L2|m-Q0y1G0YIxtp2`xqG;+SU-1r*`uDp{zh zGjZ!R;iD+1%xoDY7b%j4k{o~|T;YlfWiE4qjd!(Y-U}fk_}SuC$nc!L9gGK~^JFT^ zR$+rBI@YYFW^8dy8eacm=pH$v{?HZc`ApGj!vVT(wjwf8?%vqpmN!|sF*l+|WGU7N z!a>8GOq_F9^fCv*2hX0_U~3oSi8odve$wZ6$bL0J6SkZ&x;Svh6Mgj56KHHscC?&@ zVs>JJ;wNd@Cq_d5DUGsES@vA4G%^NBNmf}&N!G`NLU@_Yk-83;zti_;4y#hpCI9Q?iffA%pOXJ* zx#D_8u_7&=lmFZ0iW?clH7KrfZ_UK?5%oSGr$n`j3BH=ZzvS3e?yxAzPa_Q|U4}w5 zYS5d7kfY6vVQ&4XSD%r8xZLBdImJBvT=}PP-j@ybuQ3XJroC2Npy|ce6y?oM6sw|hp0N1VkBCY zimT1#Do5oiXUfIXocD2vwxj<1-cp=LgiW`$);Psm${24-HE$G*y&+zUPUGRJjTar> zPi#0Nyzh)pwb6Hju{U}SX>_XZ1kcb&n3|{*I_NLtH>r0W{*4}fPKX#DMyngT", TARGETDIR ^ "\\doc" ); + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: MoveFileData // +// // +// Purpose: This function handles the data movement for // +// the setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function MoveFileData() + NUMBER nResult, nDisk; + begin + + nDisk = 1; + SetStatusWindow( 0, "" ); + Disable( DIALOGCACHE ); + Enable( STATUS ); + StatusUpdate( ON, 100 ); + nResult = ComponentMoveData( MEDIA, nDisk, 0 ); + + HandleMoveDataError( nResult ); + + Disable( STATUS ); + + return nResult; + + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: HandleMoveDataError // +// // +// Purpose: This function handles the error (if any) during the move data // +// operation. // +// // +/////////////////////////////////////////////////////////////////////////////// +function HandleMoveDataError( nResult ) + STRING szErrMsg, svComponent , svFileGroup , svFile; + begin + + svComponent = ""; + svFileGroup = ""; + svFile = ""; + + switch (nResult) + case 0: + return 0; + default: + ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); + szErrMsg = @ERROR_MOVEDATA + "\n\n" + + @ERROR_COMPONENT + " " + svComponent + "\n" + + @ERROR_FILEGROUP + " " + svFileGroup + "\n" + + @ERROR_FILE + " " + svFile; + SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); + bInstallAborted = TRUE; + return nResult; + endswitch; + + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: ProcessAfterDataMove // +// // +// Purpose: This function performs any necessary operations needed after // +// all data has been moved. // +// // +/////////////////////////////////////////////////////////////////////////////// +function ProcessAfterDataMove() + STRING szPath, szGcc, szGccDir; + STRING szTemp, szRes, szPathEntry, szDrive; + NUMBER nvSize,nvType, nResult, nPos, nSuccess; + LIST listDirs; + begin + + RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE ); + RegDBGetKeyValueEx ( "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" , + "path" , nvType, szPath , nvSize ); + + // Spin through path looking for perl.exe. + // Our task is made considerably harder since the + // the free version of InstallShield doesn't support + // functions such as StrGetTokens() or ParsePath(). + // TODO: Convert this back to IS Prof Edn + + MyParsePath ( szPath ); + nResult = ListGetFirstString ( listPath, szPathEntry); + szPathEntry = ""; szPerlPath=""; + while ( nResult != END_OF_LIST ) + if ( FindFile (szPathEntry, "perl.exe", szRes ) = 0 ) then + szPerlPath = szPathEntry + "/" + szRes; + nResult = END_OF_LIST; + else + nResult = ListGetNextString ( listPath, szPathEntry ); + endif; + endwhile; + if ( StrCompare ( szPerlPath, "" ) = 0 ) then + // If not found in global env. block, look in the + // user-specific part. + RegDBSetDefaultRoot ( HKEY_CURRENT_USER ); + RegDBGetKeyValueEx ( "Environment", "path", nvType, szPath, nvSize); + MyParsePath ( szPath ); + nResult = ListGetFirstString ( listPath, szPathEntry); + szPathEntry = ""; szPerlPath=""; + while ( nResult != END_OF_LIST ) + if ( FindFile (szPathEntry, "perl.exe", szRes ) = 0 ) then + szPerlPath = szPathEntry + "/" + szRes; + nResult = END_OF_LIST; + else + nResult = ListGetNextString ( listPath, szPathEntry ); + endif; + endwhile; + endif; + + if ( StrCompare ( szPerlPath, "" ) = 0 ) then + // Default it to /bin/perl + MessageBox ("Unable to find perl in your PATH. Not to worry, this installer includes a version that should be useable." + + "When the installer has finished, please copy it from the bin/ directory of the ghc installation to /bin/perl", + INFORMATION); + szPerlPath = "/bin/perl.exe"; + else + // strip initial drive spec. + GetDir ( szPerlPath, szTemp); + ForwardSlashify ( szTemp, szPerlPath ); + endif; + DropSuffix (szPerlPath, szTemp); + szPerlPath = szTemp; + + ListDestroy (listPath); + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupRegistry // +// // +// Purpose: This function makes the registry entries for this setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupRegistry() + NUMBER nResult,nWays,i; + STRING szProjectDir, szProjectVersionDir, szTargetDir; + STRING szSyslib, szWay, szSyslibsDir; + STRING szLib, szSyslibsKey; + //LIST syslib_list, way_list; + begin + + // TODO : Add all your registry entry keys here + // + // + + nResult = CreateRegistrySet( "" ); + + // By now, we will have had the following Registry + // entries generated (see ProcessBeforeDataMove() ): + // + // HK_L_M\Software\Glasgow University\GHC\ + // + // For GHC, we store and use the install info inside + // HK_L_M\Software\Haskell\GHC (== %ROOT%) + + // So, we perform the following tasks here: + // + // * Checks to see if %ROOT% is defined. + // If not, creates it. + // * Checks for %ROOT%\Version is defined. + // * Create %ROOT%\. + // * Create %ROOT%\\libdir + // (This key will be given a value later.) + // * Create %ROOT%\syslib\ and fill it in + // with the syslibs that has been installed. + // * %ROOT%\syslib\name\ + // is added for each kind (e.g., seq, conc) + // syslib we're installing. + + // When we eventually reach the end, the registry + // should be ready for use by the installed app. + + // Check to see if we've already installed + // a version of GHC on this box.. + RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE ); + + szProjectDir = @HASKELL_REG_ROOT ^ @PRODUCT_NAME; + + // check whether we've already got the Registry sub-tree we're + // about to add to. If not, then we create it + // level-by-level, so as to ensure that the uninstaller + // can clean up after us. + if ( RegDBKeyExist ( @HASKELL_REG_ROOT ) < 0) then + RegDBCreateKeyEx (@HASKELL_REG_ROOT, ""); + endif; + if ( RegDBKeyExist ( szProjectDir ) < 0 ) then + RegDBCreateKeyEx ( szProjectDir, ""); + endif; + + // Note: we overwrite any existing value. + RegDBSetKeyValueEx( szProjectDir, "Version", REGDB_STRING, + @PRODUCT_KEY, -1); + + szProjectVersionDir = szProjectDir ^ @PRODUCT_KEY; + + if ( RegDBKeyExist ( szProjectVersionDir ) < 0) then + RegDBCreateKeyEx ( szProjectVersionDir, ""); + endif; + + // Here starts the GHC specific part + + ForwardSlashify (TARGETDIR, szTargetDir); + // fill in the all-important path to where the archives + // and interface files have been parked. + szLibDir = szTargetDir + "/lib"; + szLibDirUnslashed = TARGETDIR ^ "\\lib"; + RegDBSetKeyValueEx ( szProjectVersionDir, "libdir", REGDB_STRING, + szLibDir , -1); + // libexecdir + szLibExecDir = szTargetDir + "/lib"; + RegDBSetKeyValueEx ( szProjectVersionDir, "libexecdir", REGDB_STRING, + szLibExecDir , -1); + // bindir + szBinDir = szTargetDir + "/bin"; + szBinDirUnslashed = TARGETDIR ^ "\\bin"; + RegDBSetKeyValueEx ( szProjectVersionDir, "bindir", REGDB_STRING, + szBinDir , -1); + + return 0; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// +// Function: SetupFolders +// +// Purpose: This function creates all the folders and shortcuts for the +// setup. This includes program groups and items for Windows 3.1. +// +/////////////////////////////////////////////////////////////////////////////// +function SetupFolders() + NUMBER nResult; + begin + + + // TODO : Add all your folder (program group) along with shortcuts (program items) + // + // + // CreateProgramFolder, AddFolderIcon.... + // + + CreateExecPerlScript ( szBinDirUnslashed, "ghc-" + @PRODUCT_VERSION ); + CreateExecPerlScript ( szBinDirUnslashed, "stat2resid" ); + CreateExecPerlScript ( szLibDirUnslashed, "hscpp" ); + CreateExecPerlScript ( szLibDirUnslashed, "mkdependHS" ); + + VarSave (SRCTARGETDIR); + SRCDIR = szBinDirUnslashed; + TARGETDIR = szBinDirUnslashed; + CopyFile( "ghc-" + @PRODUCT_VERSION, "ghc"); + VarRestore (SRCTARGETDIR); + + nResult = CreateShellObjects( "" ); + + return nResult; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: CleanUpInstall // +// // +// Purpose: This cleans up the setup. Anything that should // +// be released or deleted at the end of the setup should // +// be done here. // +// // +/////////////////////////////////////////////////////////////////////////////// +function CleanUpInstall() + begin + + + if (bInstallAborted) then + return 0; + endif; + + DialogShowSdFinishReboot(); + + if (BATCH_INSTALL) then // ensure locked files are properly written + CommitSharedFiles(0); + endif; + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupInstall // +// // +// Purpose: This will setup the installation. Any general initialization // +// needed for the installation should be performed here. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupInstall() + + begin + + Enable( CORECOMPONENTHANDLING ); + + bInstallAborted = FALSE; + + GetDisk(WINDIR, svDir); + + if (bIs32BitSetup) then + svDir = svDir + "\\" ^ @PRODUCT_NAME_SHORT ^ @PRODUCT_KEY; + else + // We're (=>ghc) 32 through and through, but for the sake of + // completenes. + svDir = svDir + "\\" ^ @PRODUCT_NAME_SHORT ^ @PRODUCT_NAME16; + endif; + + TARGETDIR = svDir; + + SdProductName( @PRODUCT_NAME ); + + Enable( DIALOGCACHE ); + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupScreen // +// // +// Purpose: This function establishes the screen look. This includes // +// colors, fonts, and text to be displayed. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupScreen() + begin + + SetColor ( BACKGROUND, BLUE ); + Enable( FULLWINDOWMODE ); + Enable( INDVFILESTATUS ); + + SetTitle( @TITLE_MAIN, 24, WHITE ); + + SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. + + Enable( BACKGROUND ); + + Delay( 1 ); + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: CheckRequirements // +// // +// Purpose: This function checks all minimum requirements for the // +// application being installed. If any fail, then the user // +// is informed and the setup is terminated. // +// // +/////////////////////////////////////////////////////////////////////////////// +function CheckRequirements() + NUMBER nvDx, nvDy, nvResult; + STRING svResult; + + begin + + bWinNT = FALSE; + bIsShellExplorer = FALSE; + + // Check screen resolution. + GetExtents( nvDx, nvDy ); + + if (nvDy < 480) then + MessageBox( @ERROR_VGARESOLUTION, WARNING ); + abort; + endif; + + // set 'setup' operation mode + bIs32BitSetup = TRUE; + GetSystemInfo( ISTYPE, nvResult, svResult ); + if (nvResult = 16) then + bIs32BitSetup = FALSE; // running 16-bit setup + return 0; // no additional information required + endif; + + // --- 32-bit testing after this point --- + + // Determine the target system's operating system. + GetSystemInfo( OS, nvResult, svResult ); + + if (nvResult = IS_WINDOWSNT) then + // Running Windows NT. + bWinNT = TRUE; + + // Check to see if the shell being used is EXPLORER shell. + if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then + if (nvResult >= 4) then + bIsShellExplorer = TRUE; + endif; + endif; + + elseif (nvResult = IS_WINDOWS95 ) then + bIsShellExplorer = TRUE; + + endif; + +end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdWelcome // +// // +// Purpose: This function handles the standard welcome dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdWelcome() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + szTitle = ""; + szMsg = ""; + nResult = SdWelcome( szTitle, szMsg ); + + return nResult; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdShowInfoList // +// // +// Purpose: This function displays the general information list dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdShowInfoList() + NUMBER nResult; + LIST list; + STRING szTitle, szMsg, szFile; + begin + + szFile = SUPPORTDIR ^ "announce"; + + list = ListCreate( STRINGLIST ); + ListReadFromFile( list, szFile ); + szTitle = ""; + szMsg = " "; + nResult = SdShowInfoList( szTitle, szMsg, list ); + + ListDestroy( list ); + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdAskDestPath // +// // +// Purpose: This function asks the user for the destination directory. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdAskDestPath() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + szTitle = ""; + szMsg = "WARNING! The path must not contain spaces."; + nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); + + TARGETDIR = svDir; + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdSetupType // +// // +// Purpose: This function displays the standard setup type dialog. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdSetupType() + NUMBER nResult, nType; + STRING szTitle, szMsg; + begin + + switch (svSetupType) + case "Typical": + nType = TYPICAL; + case "Custom": + nType = CUSTOM; + case "Compact": + nType = COMPACT; + case "": + svSetupType = "Typical"; + nType = TYPICAL; + endswitch; + + szTitle = ""; + szMsg = ""; + nResult = SetupType( szTitle, szMsg, "", nType, 0 ); + + switch (nResult) + case COMPACT: + svSetupType = "Compact"; + case TYPICAL: + svSetupType = "Typical"; + case CUSTOM: + svSetupType = "Custom"; + endswitch; + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdComponentDialog2 // +// // +// Purpose: This function displays the custom component dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdComponentDialog2() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + if ((svSetupType != "Custom") && (svSetupType != "")) then + return 0; + endif; + + szTitle = ""; + szMsg = ""; + nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); + + return nResult; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: CheckListScreen // +// // +// Purpose: Show a check-list of post-install user actions. // +// // +/////////////////////////////////////////////////////////////////////////////// +function CheckListScreen() + BOOL bDone; + NUMBER nCmdValue; + begin + EzDefineDialog("CHECKLIST", "", "", 30001); + + bDone = FALSE; + while (bDone=FALSE) + nCmdValue = WaitOnDialog("CHECKLIST"); + switch (nCmdValue) + case DLG_INIT: + // Process the Next button. + case SD_PBUT_CONTINUE: + bDone = TRUE; + // Process the Cancel button. + case SD_PBUT_EXITSETUP: + bDone = TRUE; + // Process the close dialog box button. + case DLG_CLOSE: + bDone = TRUE; + // Process dialog box errors. + case DLG_ERR: + MessageBox("Internal dialog box error", SEVERE); + bDone = TRUE; + endswitch; + endwhile; + // Identify the end of dialog box processing. + EndDialog("CHECKLIST"); + // Free the dialog box and list from memory. + ReleaseDialog("CHECKLIST"); + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdFinishReboot // +// // +// Purpose: This function will show the last dialog of the product. // +// It will allow the user to reboot and/or show some readme text. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdFinishReboot() + NUMBER nResult, nDefOptions; + STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; + NUMBER bOpt1, bOpt2; + begin + + if (!BATCH_INSTALL) then + bOpt1 = FALSE; + bOpt2 = FALSE; + szMsg1 = ""; + szMsg2 = ""; + szOption1 = ""; + szOption2 = ""; + szTitle = "Installation is now complete."; + nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); + return 0; + else + nDefOptions = SYS_BOOTMACHINE; + szTitle = ""; + szMsg1 = ""; + szMsg2 = ""; + nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); + return nResult; + endif; + end; + +function MyParsePath(szPath) + STRING szTmp,szPth; + NUMBER nPos; + begin + szPth = szPath; + listPath = ListCreate( STRINGLIST ); + + // Man, all I want is map. Please? :-) + nPos = StrFind ( szPth, ";"); + while ( nPos > 0 ) + StrSub ( szTmp, szPth, 0, nPos); + ListAddString ( listPath, szTmp, AFTER ); + StrSub ( szTmp, szPth, nPos + 1, StrLength ( szPth) - nPos ); + szPth = szTmp; + nPos = StrFind ( szPth, ";" ); + endwhile; + + return 0; + end; + + function ForwardSlashify ( szStr , theRes ) + NUMBER nPos; + STRING szTemp, szRes; + begin + // Tortuous piece of code to convert backslashes into + // forward ones. + nPos = StrFind ( szStr, "\\"); + szRes=""; + while ( nPos >= 0 ) + StrSub ( szTemp, szStr, 0, nPos); + szRes = szRes + szTemp + "/"; + StrSub ( szTemp, szStr, nPos + 1, StrLength ( szStr) - nPos ); + szStr = szTemp; + nPos = StrFind ( szStr, "\\" ); + endwhile; + StrSub ( szTemp, szStr, 0, StrLength (szStr)); + szRes = szRes + szTemp; + theRes = szRes; + return 0; + end; + + function CreateExecPerlScript ( szPath, szFileName ) + NUMBER nResult, writeHandle, readHandle; + STRING szLine; + begin + VarSave (SRCTARGETDIR); + SRCDIR = szPath; + TARGETDIR = szPath; + DeleteFile ( szFileName + ".bak"); + RenameFile ( szFileName, szFileName + ".bak"); + VarRestore (SRCTARGETDIR); + + OpenFileMode (FILE_MODE_APPEND); + if ( CreateFile ( writeHandle, szPath, szFileName ) < 0 ) then + MessageBox ("CreateFile " + szPath ^ szFileName + " failed", INFORMATION); + endif; + // append + WriteLine (writeHandle, "#!" + szPerlPath ); + WriteLine (writeHandle, "$libdir='" + szLibDir + "';"); + WriteLine (writeHandle, "$bindir='" + szBinDir + "';"); + WriteLine (writeHandle, "$libexecdir='" + szLibExecDir + "';"); + WriteLine (writeHandle, "$datadir='" + szDataDir + "';"); + WriteLine (writeHandle, "$SED='sed';"); + WriteLine (writeHandle, "$TMPDIR='C:/TEMP';"); + WriteLine (writeHandle, "$RAWCPP='gcc -E';"); + // For the benefit of mkdependHS, which doesn't get this prepended + WriteLine (writeHandle, "$INSTALLING=1;"); + + OpenFileMode (FILE_MODE_NORMAL); + if ( OpenFile ( readHandle, szPath, szFileName + ".bak") < 0 ) then + MessageBox ("OpenFile " + szPath ^ szFileName + ".bak failed", INFORMATION); + endif; + + // copy the template over. + nResult = GetLine ( readHandle, szLine); + while ( nResult >= 0 ) + WriteLine ( writeHandle, szLine); + nResult = GetLine ( readHandle, szLine); + endwhile; + if ( CloseFile( readHandle ) < 0 ) then + MessageBox ( "CloseFile " + szPath ^ szFileName + ".bak failed", + INFORMATION); + endif; + if ( CloseFile( writeHandle ) < 0 ) then + MessageBox ( "CloseFile " + szPath ^ szFileName + " failed", + INFORMATION); + endif; + // There's no way to set the 'x' bit using + // SetFileInfo(), but luckily it is not needed to run #! scripts + // under cygwin. + SetFileInfo ( szPath ^ szFileName, FILE_ATTRIBUTE, FILE_ATTR_NORMAL, ""); + // Delete the .bak file + DeleteFile ( szPath ^ szFileName + ".bak"); + + return 0; + end; + + function DropSuffix ( szInp, szOut ) + NUMBER nResult, nLen; + STRING szTemp, szTemp2; + begin + nLen = 0; + szTemp2 = szInp; + nResult = StrFind ( szTemp2 , "."); + while ( nResult >= 0 ) + nLen = nLen + nResult; + StrSub ( szTemp, szTemp2, nResult + 1, StrLength ( szTemp2) - nResult ); + szTemp2 = szTemp; + nResult = StrFind ( szTemp2, "." ); + if ( nResult >= 0 ) then + nLen = nLen + 1; // incl the previous . if there's more. + endif; + endwhile; + StrSub ( szOut, szInp, 0, nLen); + return 0; + end; \ No newline at end of file -- 1.7.10.4