////////////////////////////////////////////////////////////////////////////////
//
//  IIIIIII SSSSSS
//    II    SS                          InstallShield (R)
//    II    SSSSSS      (c) 1996-1997, InstallShield Software Corporation
//    II        SS      (c) 1990-1996, InstallShield Corporation
//  IIIIIII SSSSSS                     All Rights Reserved.
//
//
//  This code is generated as a starting setup template.  You should
//  modify it to provide all necessary steps for your setup.
//
//
//    File Name:  Setup.rul
//
//  Description:  InstallShield script
//
//     Comments:  This template script performs a basic setup on a
//                Windows 95 or Windows NT 4.0 platform. With minor
//                modifications, this template can be adapted to create
//                new, customized setups.
//
////////////////////////////////////////////////////////////////////////////////


  // Include header file
#include "sdlang.h"
#include "ifx.h"

#define WM_WININICHANGE   0x001a     // official windows values (from winuser.h)
#define HWND_BROADCAST    0xffff     // (needed to propagate changes to registry)

////////////////////// string defines ////////////////////////////

#define UNINST_LOGFILE_NAME      "Uninst.isu"

//////////////////// installation declarations ///////////////////

  // ----- DLL prototypes -----


     // your DLL prototypes


  // ---- script prototypes -----

     // generated
     prototype ShowDialogs();
     prototype MoveFileData();
     prototype HandleMoveDataError( NUMBER );
     prototype ProcessBeforeDataMove();
     prototype ProcessAfterDataMove();
     prototype SetupRegistry();
     prototype SetupFolders();
     prototype CleanUpInstall();
     prototype SetupInstall();
     prototype SetupScreen();
     prototype CheckRequirements();
     prototype DialogShowSdWelcome();
     prototype DialogShowSdLicense();
     prototype DialogShowSdAskDestPath();
     prototype DialogShowSdSetupType();
     prototype DialogShowSdComponentDialog2();
     prototype DialogShowSdSelectFolder();
     prototype DialogShowSdFinishReboot();

     // your prototypes

     prototype SetupVariousFiles ();
     prototype ConstructBatchFile ( STRING, STRING);
     prototype ConstructLibFile (STRING,STRING);
     prototype AddFileIfExists (STRING,STRING,STRING,STRING);

  // ----- global variables ------

     // generated
     BOOL        bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
     STRING      svDir;
     STRING      svName, svCompany, svSerial;
     STRING      svDefGroup;
     STRING      szAppPath;
     STRING      svSetupType;

     // your global variables

     STRING      svAutoexec;


///////////////////////////////////////////////////////////////////////////////
//
//   MAIN PROGRAM
//
//      The setup begins here by hiding the visible setup
//      window.  This is done to allow all the titles, images, etc. to
//      be established before showing the main window.  The following
//      logic then performs the setup in a series of steps.
//
///////////////////////////////////////////////////////////////////////////////
program
    Disable( BACKGROUND );

    BatchGetFileName (svAutoexec);

    CheckRequirements();

    SetupInstall();

    SetupScreen();

    if (ShowDialogs()<0) goto end_install;

    if (ProcessBeforeDataMove()<0) goto end_install;

    if (MoveFileData()<0) goto end_install;

    if (ProcessAfterDataMove()<0) goto end_install;

    if (SetupRegistry()<0) goto end_install;

    if (SetupFolders()<0) goto end_install;

    if (SetupVariousFiles()<0) goto end_install;


  end_install:

    CleanUpInstall();

     // If an unrecoverable error occurred, clean up the partial installation.
     // Otherwise, exit normally.

    if (bInstallAborted) then
        abort;
    endif;

endprogram



///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function:  ShowDialogs                                                    //
//                                                                           //
//  Purpose:  This function manages the display and navigation               //
//            the standard dialogs that exist in a setup.                    //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function ShowDialogs()
    NUMBER  nResult;
 begin

    Dlg_Start:
        // beginning of dialogs label

    Dlg_SdWelcome:
//        nResult = DialogShowSdWelcome();
//        if (nResult = BACK) goto Dlg_Start;

    Dlg_SdLicense:
        nResult = DialogShowSdLicense();
        if (nResult = BACK) goto Dlg_SdWelcome;

    Dlg_SdAskDestPath:
        nResult = DialogShowSdAskDestPath();
        if (nResult = BACK) goto Dlg_SdLicense;

    Dlg_SdSetupType:
        nResult = DialogShowSdSetupType();
        if (nResult = BACK) goto Dlg_SdAskDestPath;

    Dlg_SdComponentDialog2:
        if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then
           goto Dlg_SdSetupType;
        endif;
        nResult = DialogShowSdComponentDialog2();
        if (nResult = BACK) goto Dlg_SdSetupType;

    Dlg_SdSelectFolder:
        nResult = DialogShowSdSelectFolder();
        if (nResult = BACK) goto Dlg_SdComponentDialog2;

    return 0;

 end;

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: ProcessBeforeDataMove                                           //
//                                                                           //
//  Purpose: This function performs any necessary operations prior to the    //
//           actual data move operation.                                     //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function ProcessBeforeDataMove()
    STRING svLogFile;
    NUMBER nResult;
 begin

  InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );

  svLogFile = UNINST_LOGFILE_NAME;

  nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
  if (nResult < 0) then
      MessageBox( @ERROR_UNINSTSETUP, WARNING );
  endif;

  szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir

  if ((bIs32BitSetup) && (bIsShellExplorer)) then
      RegDBSetItem( REGDB_APPPATH, szAppPath );
      RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
  endif;

  // TODO : update any items you want to process before moving the data
  //

  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 )
 begin

  switch (nResult)
  case 0:
       return 0;
  default:
       SprintfBox( SEVERE, @TITLE_CAPTIONBAR, @ERROR_MOVEDATA, 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 szReferenceFile;
 begin

  // TODO : update self-registered files and other processes that
  //        should be performed after the data has been moved.

  // DeinstallSetReference specifies a file to be checked before
  // uninstallation. If the file is in use, uninstallation will not proceed.

  szReferenceFile = svDir ^ @PRODUCT_KEY; // TODO : If your file is in a subdir of svDir add that here
  DeinstallSetReference( szReferenceFile );


  return 0;
 end;

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: SetupRegistry                                                   //
//                                                                           //
//  Purpose: This function makes the registry entries for this setup.        //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////

function SetupRegistry()
 // STRING svPathSMLNJ;
 STRING svPathCM;
 STRING svOriginalPath;
 STRING svPath;
 STRING svDummy;
 NUMBER nvResult;
 begin

  // TODO : Add all your registry entry keys here
  //
  //
  //    RegDBCreateKeyEx, RegDBSetKeyValueEx....
  //

  // THIS IS VERY MESSY!

  svPathCM = TARGETDIR ^ "lib";
  LongPathToQuote (svPathCM,TRUE);
  svPath = TARGETDIR ^ "bin";
  LongPathToQuote (svPath,TRUE);

  GetSystemInfo (OS,nvResult,svDummy);
  if (nvResult==IS_WINDOWSNT)
   then   // Windows NT
    RegDBSetDefaultRoot (HKEY_CURRENT_USER);
    // add CM_PATH environment variable
    RegDBSetKeyValueEx ("Environment","CM_PATH",REGDB_STRING, svPathCM,-1);
    // change value of PATH environment variable
    //   we need to disable LOGGING to make sure the change is not undone by
    //   the uninstaller. However, this means that the change is never undone,
    //   and the user has to do that by hand
    GetEnvVar ("PATH", svOriginalPath);
    if (! (svOriginalPath % svPath)) then
      Disable (LOGGING);
      RegDBSetKeyValueEx ("Environment","PATH",REGDB_STRING, svOriginalPath + ";" + svPath,-1);
      Enable (LOGGING);
    endif;
   else // Windows 95
    // MessageBox ("OS has been recognized as Windows 95",INFORMATION);
    BatchSetFileName (svAutoexec);
    EzBatchAddString ("@SET PATH=%PATH%;"+svPath,"",AFTER | NOSET);
    EzBatchAddString ("@SET CM_PATH="+svPathCM,"",AFTER | NOSET);
   endif;

   return 0;
 end;


function ConstructBatchFile ( szBatchFile, szHeap )
 STRING szRuntime;
 begin
  szRuntime = TARGETDIR ^ "bin\\.run\\run.x86-win32.exe";
  LongPathToQuote (szRuntime,TRUE);

  if (Is (FILE_EXISTS,TARGETDIR ^ "bin\\" ^ szBatchFile)==TRUE) then
     BatchSetFileName (TARGETDIR ^ "bin\\" ^ szBatchFile);
     szHeap = TARGETDIR ^ "bin\\.heap\\" ^ szHeap;;
     LongPathToQuote (szHeap,TRUE);
     EzBatchAddString (szRuntime + " @SMLload=" + szHeap + " %1 %2 %3 %4 %5 %6 %7 %8 %9","",AFTER | NOSET);
  endif;
  return 0;
 end;


function ConstructLibFile ( szLibFile, szTarget )
 NUMBER nvFileHandle;
 STRING szMessage;
 begin
 if (Is (FILE_EXISTS, TARGETDIR ^ "lib\\" ^szLibFile)==TRUE) then
    szMessage = "alias \"" + (TARGETDIR ^ szTarget ^ "\"");
    OpenFileMode (FILE_MODE_APPEND);
    // overwrites existing file
    CreateFile (nvFileHandle, TARGETDIR ^ "lib", szLibFile);
    WriteLine (nvFileHandle, szMessage);
    CloseFile (nvFileHandle);
  endif;
  return 0;
 end;


function SetupVariousFiles()
 STRING szRuntime;
 STRING szHeap;
 begin

  //
  // CONSTRUCT THE LIBRARY FILES IN lib/
  //

  ConstructLibFile ( "ml-yacc-lib.cm","src\\ml-yacc\\lib\\sources.cm");
  ConstructLibFile ( "html-lib.cm","src\\smlnj-lib\\HTML\\html-lib.cm");
  ConstructLibFile ( "inet-lib.cm","src\\smlnj-lib\\INet\\inet-lib.cm");
  ConstructLibFile ( "pp-lib.cm","src\\smlnj-lib\\PP\\pp-lib.cm");
  ConstructLibFile ( "reactive-lib.cm","src\\smlnj-lib\\Reactive\\reactive-lib.cm");
  ConstructLibFile ( "regexp-lib.cm","src\\smlnj-lib\\RegExp\\regexp-lib.cm");
  ConstructLibFile ( "smlnj-lib.cm","src\\smlnj-lib\\Util\\smlnj-lib.cm");
  // ConstructLibFile ( "unix-lib.cm","src\\smlnj-lib\\Unix\\unix-lib.cm");
  ConstructLibFile ( "cml.cm","src\\cml\\src\\sources.cm");
  ConstructLibFile ( "cml-lib.cm","src\\cml\\cml-lib\\sources.cm");

  //
  // CONSTRUCT THE BATCH FILES IN bin/
  //

  ConstructBatchFile ("sml-cm.bat","sml.x86-win32");
  ConstructBatchFile ("sml.bat","sml.x86-win32");
  ConstructBatchFile ("ml-burg.bat","ml-burg.x86-win32");
  ConstructBatchFile ("ml-lex.bat","ml-lex.x86-win32");
  ConstructBatchFile ("ml-yacc.bat","ml-yacc.x86-win32");

  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 AddFileIfExists (file,folder,name,icon)
 STRING svPath;
 begin
  if (Is (FILE_EXISTS,file)==TRUE) then
    svPath = file;
    LongPathToQuote (svPath,TRUE);
    AddFolderIcon (folder,name,svPath,"",icon,0,"",REPLACE);
  endif;
  return 0;
 end;


function SetupFolders()
 begin
  // TODO : Add all your folder (program group) along with shortcuts (program items)
  //
  //
  //    CreateProgramFolder, AddFolderIcon....
  //
  //    Note : for 16-bit setups you should add an uninstaller icon pointing to
  //           your log file.  Under 32-bit this is automatically done by Windows.

  AddFileIfExists (TARGETDIR ^ "bin\\sml.bat",svDefGroup,@PRODUCT_NAME,TARGETDIR^"support\\smlnj.ico");
  AddFileIfExists (TARGETDIR ^ "support\\readme.html",svDefGroup,"Read Me","");
  AddFileIfExists (TARGETDIR ^ "support\\documentation.html",svDefGroup,"Documentation","");

//  if (Is (FILE_EXISTS, TARGETDIR ^ "bin\\sml.bat")==TRUE) then
//        svPath = TARGETDIR ^ "bin\\sml.bat";
//        LongPathToQuote (svPath,TRUE);
//        AddFolderIcon (svDefGroup, @PRODUCT_NAME, svPath, "",
//                       TARGETDIR ^ "support\\smlnj.ico",0,"",REPLACE);
//  endif;
//  if (Is (FILE_EXISTS,TARGETDIR ^ "support\\readme.html")==TRUE) then
//        svPath = TARGETDIR ^ "support\\readme.html";
//        LongPathToQuote (svPath,TRUE);
//        AddFolderIcon (svDefGroup, "Read Me", svPath, "",
//                       "",0,"",REPLACE);
//  endif;

  return 0;
 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();

  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 );

  // sets up the system to look at personal folders as well as the common ones
  ProgDefGroupType (PERSONAL);

  bInstallAborted = FALSE;


  // DEFAULT INSTALLATION DIRECTORY

  //if (bIs32BitSetup) then
  //    svDir = PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME;
  //else
  //    svDir = PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names
  //endif;

  svDir = TARGETDISK ^ "\\sml";

  TARGETDIR  = svDir;

  SdProductName( @PRODUCT_NAME );

  Disable (FEEDBACK_FULL);
  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

  Enable( FULLWINDOWMODE );
  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: DialogShowSdLicense                                             //
//                                                                           //
//  Purpose: This function displays the license agreement dialog.            //
//                                                                           //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdLicense()
    NUMBER nResult;
    STRING szTitle, szMsg, szQuestion, szLicenseFile;
 begin

  szLicenseFile = SUPPORTDIR ^ "license.txt";
  szTitle    = "";
  szMsg      = "";
  szQuestion = "";
  nResult    = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );

  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   = "";
  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

  if (svSetupType=="") then svSetupType="Typical";
  endif;

//  switch (svSetupType)
//  case "Typical":
//       nType = TYPICAL;
//  case "Custom":
//       nType = CUSTOM;
//  case "Compact":
//       nType = COMPACT;
//  case "":
//       svSetupType = "Typical";
//       nType = TYPICAL;
//  endswitch;

  szTitle = "";
  szMsg   = "";
  nResult = SdSetupTypeEx( szTitle, szMsg, "", svSetupType, 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: DialogShowSdSelectFolder                                        //
//                                                                           //
//  Purpose: This function displays the standard folder selection dialog.    //
//                                                                           //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdSelectFolder()
    NUMBER nResult;
    STRING szTitle, szMsg;
 begin

  if (svDefGroup = "") then
      svDefGroup = @FOLDER_NAME;
  endif;

  szTitle    = "";
  szMsg      = "";
  nResult    = SdSelectFolder( szTitle, szMsg, svDefGroup );

  return nResult;
 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;
    STRING szMsg;
    NUMBER bOpt1, bOpt2;
 begin

  szMsg1 = "Setup has finished installing %P on your system.\r\n\r\n";
  szMsg1 = szMsg1 + "To uninstall, please use the Add/Remove Programs facility of the Control Panel.\r\n\r\n";
  szMsg1 = szMsg1 + "We recommend you reboot your machine.";

  // szMsg = "Notes about the uninstall process:\r\n\r\n";
  // szMsg = szMsg + "1) The uninstall process may leave some files in the SML/NJ folder. ";
  // szMsg = szMsg + "It may be necessary to manually delete that folder after the uninstall process is completed.\r\n\r\n";
  // szMsg = szMsg + "2) The installation of SML/NJ appended a path to the PATH environment variable, a change that is not undone by the uninstall process. The PATH environment variable must therefore be changed by hand.";
  // MessageBox (szMsg, WARNING);


  //if (!BATCH_INSTALL) then
  //    bOpt1 = FALSE;
  //    bOpt2 = FALSE;
  //    szMsg2 = "";
  //    szOption1 = "";
  //    szOption2 = "";
  //    nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
  //    return 0;
  //endif;

  nDefOptions = SYS_BOOTMACHINE;
  szTitle     = "";
  szMsg2      = "";
  nResult     = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );

  return nResult;
 end;


 // --- include script file section ---

