Changeset 2534


Ignore:
Timestamp:
2001-06-13T11:02:50+12:00 (23 years ago)
Author:
cs025
Message:

Added better monitoring of installation

Location:
trunk/gsinstaller
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsinstaller/FilePath.cpp

    r1589 r2534  
    334334  reply->is_aRoot = __pathIsAValidRoot(reply->path);
    335335  return reply;
     336}
     337
     338/**
     339 *  Check that the given path is a child/descendant of this path
     340 */
     341bool FilePath::isAncestorOf(string pathString)
     342{
     343  if (this->path == "")
     344    return false;
     345
     346  if (pathString.length() < this->path.length())
     347  { return false;
     348  }
     349  if (pathString.substr(0, this->path.length()) != this->path)
     350  { return false;
     351  }
     352  if (pathString.length() == this->path.length())
     353  { return false;
     354  }
     355  if (pathString[this->path.length()-1] != '\\' &&
     356      pathString[this->path.length()] != '\\')
     357  { return false;
     358  }
     359  // can't be a proper ancestor of itself
     360  return true;
    336361}
    337362
  • trunk/gsinstaller/FilePath.h

    r1544 r2534  
    3636  FilePath *root();
    3737  FilePath *rootDrive();
     38  bool isAncestorOf(string pathString);
    3839  bool ensureWriteablePath();
    3940  bool exists();
  • trunk/gsinstaller/configurable.cpp

    r1397 r2534  
    2626{   return this->option;
    2727}
     28void configurable::setFirst(bool isFirst)
     29{   this->first = isFirst;
     30}
    2831
     32bool configurable::isFirst()
     33{   return this->first;
     34}
    2935void configurable::setFinal(bool isFinal)
    3036{   this->final = isFinal;
    3137}
    32 
    3338bool configurable::isFinal()
    3439{   return this->final;
  • trunk/gsinstaller/configurable.h

    r1539 r2534  
    1515  void setFinal(bool isFinal);
    1616  bool isFinal();
     17  void setFirst(bool isFirst);
     18  bool isFirst();
    1719 
    1820  void setOption(bool to);
     
    2224  bool option;
    2325  bool final;
     26  bool first;
    2427  char *optPrompt;
    2528};
  • trunk/gsinstaller/copyProgress.cpp

    r2073 r2534  
    2525    progressBar = (copyProgressBar *) GetWindowLong(window, GWL_USERDATA);
    2626    if (progressBar == NULL)
    27       { 
    28         MessageBox(0, "A", "A", MB_OK);
     27      {
     28        // TODO: error handling
    2929      }
    3030
     
    6363}
    6464
    65 copyProgressBar::copyProgressBar(unsigned long totalSize)
    66 {   this->total     = totalSize;
    67     this->copied    = 0;
     65copyProgressBar::copyProgressBar(unsigned long totalSize, unsigned long totalFiles)
     66{   this->total         = totalSize;
     67    this->totalFiles    = totalFiles;
     68    this->copied        = 0;
     69   this->copiedFiles = 0;
     70   this->showing        = false;
    6871}
    6972
    7073copyProgressBar::copyProgressBar()
    71 {   this->total     = 0;
    72     this->copied    = 0;
     74{   this->total         = 0;
     75    this->totalFiles  = 0;
     76    this->copied        = 0;
     77   this->copiedFiles    = 0;
     78   this->showing    = false;
    7379}
    7480
    75 void copyProgressBar::init(unsigned long totalSize)
    76 {   this->total     = totalSize;
    77     this->copied    = 0;
     81// just ensure everything is tidily terminated
     82copyProgressBar::~copyProgressBar()
     83{   this->close();
     84}
     85
     86void copyProgressBar::init(unsigned long totalSize, unsigned long totalFiles)
     87{   this->total         = totalSize;
     88    this->totalFiles    = totalFiles;
     89    this->copied        = 0;
     90   this->copiedFiles    = 0;
    7891}
    7992
    8093void copyProgressBar::done(unsigned long bytesDone)
    81 { unsigned int percent;
    82   this->copied += bytesDone;
     94{
     95    static char   progressText[100] = "Remaining: ";
     96   static int    progressTimePos  = strlen(progressText);
     97   double         seconds;
    8398
    84   percent =(this->copied  * 100 / this->total);
     99   // note the progress made by the extra bytes
     100    this->copied += bytesDone;
     101   this->copiedFiles += 1;
    85102
    86     SendMessage(this->progressBar, PBM_SETPOS, percent, 0L);
     103   // present the progress in the progress bar
     104    double percent = (double) this->copied / (double) this->total;
     105   percent = percent * 100;
     106    SendMessage(this->progressBar, PBM_SETPOS, (int) percent, 0L);
     107
     108   // present time remaining
     109   seconds = difftime(time(NULL), this->startTime);
     110   if (this->copied == 0)
     111   { return;
     112   }
     113   seconds = seconds * (double) (this->total - this->copied) / (double) this->copied;
     114
     115   sprintf(&progressText[progressTimePos], "%d:%02d %3.1fMb (%d files)", (int) (seconds / 60), ((int) seconds) % 60, double (this->total - this->copied) / (double) (1024 * 1024), this->totalFiles - this->copiedFiles);
     116   SetWindowText(this->progressTime, progressText);
     117}
     118
     119void copyProgressBar::done(unsigned long bytesDone, LPSTR message)
     120{
     121   this->done(bytesDone);
     122   this->message(message);
     123}
     124
     125void copyProgressBar::message(LPSTR message)
     126{   SetWindowText(this->progressText, message);
    87127}
    88128
     
    97137  gsInstall_getDesktopExt(&sx, &sy);
    98138
    99   dx = (sx - 200) >> 1;
    100   dy = (sy - 80) >> 1;
     139  dx = (sx - 400) >> 1;
     140  dy = (sy - 110) >> 1;
    101141
    102142
     143    // Create the parent to hold the progress elements
    103144    this->progressParent    = CreateWindowEx(   WS_EX_APPWINDOW, "CopyProgressBar",
    104145                                                                                "GreenStone Installer", WS_VISIBLE,
    105                                                                                     dx, dy, 200, 80,
     146                                                                                    dx, dy, 400, 110,
    106147                                          0, (HMENU) 0,
    107148                                                    app_instance, (void *) params);
     149    // Create the progress bar itself
    108150    this->progressBar   = CreateWindowEx(0, PROGRESS_CLASS, NULL, WS_CHILD | WS_VISIBLE,
    109                                                                          10, 30, 180, GetSystemMetrics(SM_CYVSCROLL),
     151                                                                         10, 60, 380, GetSystemMetrics(SM_CYVSCROLL),
    110152                                     this->progressParent, (HMENU) 0,
    111153                                         app_instance, NULL);
     154
     155    // Create the text reporter
     156   this->progressText = CreateWindowEx(0, "STATIC", "", WS_CHILD | SS_LEFT | WS_VISIBLE,
     157                                                10, 5, 380, 20,
     158                                       this->progressParent, (HMENU) 0,
     159                                       app_instance, NULL);
     160
     161   // Create the time reporter
     162   this->progressTime = CreateWindowEx(0, "STATIC", "", WS_CHILD | SS_LEFT | WS_VISIBLE,
     163                                                10, 30, 380, 20,
     164                                       this->progressParent, (HMENU) 0,
     165                                       app_instance, NULL);
     166
     167    // Note that we are now showing the progress bar
     168    this->showing = true;
    112169}
    113170
     171// ensure that if the windows are showing, they are closed before the object
     172// is destroyed
    114173void copyProgressBar::close()
    115 { // return;
    116     ShowWindow(this->progressBar, SW_HIDE);
    117     DestroyWindow(this->progressBar);
     174{   if (this->showing == true)
     175   {
     176        ShowWindow(this->progressBar, SW_HIDE);
     177        DestroyWindow(this->progressBar);
    118178
    119   ShowWindow(this->progressParent, SW_HIDE);
    120   DestroyWindow(this->progressParent);
     179    ShowWindow(this->progressParent, SW_HIDE);
     180        DestroyWindow(this->progressParent);
     181      this->showing = false;
     182   }
    121183}
    122184
  • trunk/gsinstaller/copyProgress.h

    r1397 r2534  
    22#define _COPYPROGRESS_H_
    33#include <windows.h>
     4#include <time.h>
    45
    56class copyProgressBar
     
    78        unsigned long total;
    89        unsigned long copied;
    9     HWND                    progressParent;
    10     HWND                    progressBar;
     10      unsigned long totalFiles;
     11      unsigned long copiedFiles;
     12        HWND              progressParent;
     13        HWND              progressBar;
     14      HWND            progressText;
     15      HWND            progressTime;
     16        bool              showing;
     17      time_t          startTime;
    1118    public:
    12     copyProgressBar();
    13     copyProgressBar(unsigned long totalSize);
    14     void registerClass();
     19      // constructors/destructors
     20    copyProgressBar();
     21
     22        copyProgressBar(unsigned long totalSize, unsigned long totalFiles);
     23       ~copyProgressBar(); // destructor introduced to ensure that open windows are closed
     24
     25       void registerClass();    // does the registration of the window classes into Windows
     26    // the window procedure itself
    1527    LRESULT CALLBACK windowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam);
     28
     29    // timing methods
     30    void setStartTime() { this->startTime = time(NULL); }
     31    // messaging methods
    1632    void done(unsigned long bytesDone);
    17     void init(unsigned long totalSize);
     33    void done(unsigned long bytesDone, LPSTR message);
     34    void message(LPSTR message);
     35
     36    // reinitialise the progress bar, giving a new total completion size
     37    void init(unsigned long totalSize, unsigned long totalFiles);
     38    // show the progress bar
    1839    void show();
     40    // close (hide) the progress bar
    1941    void close();
    2042};
  • trunk/gsinstaller/file.cpp

    r1541 r2534  
    33
    44#include <windows.h>
    5 #include <stdio.h>
     5// #include <stdio.h>
    66
    77#include "file.h"
     8
     9#include <direct.h>
    810
    911void File::_getDetails()
     
    105107{   return this->size;
    106108}
     109unsigned long File::getFileSize()
     110{   unsigned long size, files;
    107111
    108 unsigned long File::getFileSize()
    109 {   unsigned long   totalSize   = 0;
     112    this->getFileSize(size, files);
     113   return size;
     114}
     115void File::getFileSize(unsigned long &totalSize, unsigned long &totalFiles)
     116{   totalSize   = 0;
     117    totalFiles  = 1;
    110118
    111119    if (this->is_dir)
     
    114122
    115123      while (here != end)
    116     {   totalSize   +=  here->getFileSize();
     124    {  unsigned long ldata, lcount;
     125
     126      here->getFileSize(ldata, lcount);
     127    totalSize   +=  ldata;
     128      totalFiles  += lcount;
    117129        here ++;
    118130      }
    119131  }
     132
    120133  totalSize +=  this->size;
    121   return totalSize;
    122134}
     135
    123136
    124137vector<File>::iterator File::childBegin()
     
    141154{ return this->does_exist;
    142155}
     156bool File::remove()
     157{  bool ok = true;
    143158
     159    if (this->is_dir)
     160    {
     161        vector<File>::iterator here = this->children.begin();
     162      vector<File>::iterator end     = this->children.end();
     163
     164      while (here != end)
     165      {  ok = here->remove() && ok;
     166        here ++;
     167      }
     168
     169      ok = RemoveDirectory(this->path.c_str()) && ok;
     170   }
     171   else
     172   {    ok = DeleteFile(this->path.c_str()) != 0 ? true : false;
     173   }
     174   return ok;
     175}
    144176void File::copy(char *to)
    145177{
  • trunk/gsinstaller/file.h

    r1541 r2534  
    3232  File(string filename);
    3333  void copy(char *destination);
     34  bool remove();
    3435  bool isDirectory();
    3536  bool isWriteable();
    3637  bool exists();
    3738  unsigned long getRawFileSize();
     39  void getFileSize(unsigned long &dataSize, unsigned long &dataFiles);
    3840  unsigned long getFileSize();
    3941  // const char *cString();
  • trunk/gsinstaller/fileCopier.cpp

    r1766 r2534  
    66#include <direct.h>
    77
     8#include <fstream.h>
     9
    810fileCopySet::fileCopySet()
    911{
     
    1315}
    1416
    15 fileCopySet::fileCopySet(FileVector files, FilePath &from, FilePath &to)
    16 {
    17   this->fileList = files;
     17fileCopySet::fileCopySet(string label, FileVector files, FilePath &from, FilePath &to)
     18{
     19  this->fileList  = files;
    1820  this->sourceDir = from;
    19   this->destDir = to;
    20   this->dataSize = 0;
     21  this->label       = label;
     22  this->destDir   = to;
     23  this->dataSize  = 0;
     24  this->dataFiles = 0;
    2125
    2226  FileVector::iterator here = files.begin();
     
    2529  while (here != end)
    2630    {
    27       this->dataSize += here->getFileSize();
     31        unsigned long size, files;
     32      here->getFileSize(size, files);
     33      this->dataSize += size;
     34      this->dataFiles += files;
    2835      here ++;
    2936    }
     
    6370    // log the creation - we don't give a source - it's not needed for directories
    6471    if (monitor != NULL)
    65     {   monitor->copiedDir(parentName->cString());
     72    {   monitor->createdDir(parentName->cString());
    6673    }
    6774  }
     
    7784  unsigned long copied = 0;
    7885  unsigned long bytes_read, bytes_written;
    79   unsigned char buffer[65536];
     86  static unsigned char buffer[65536];
    8087  FILE *read_handle, *write_handle;
    8188  char *destination;
     
    123130      // note new bytes copied
    124131      copied += bytes_written;
    125       this->dataSize += bytes_written;
     132//      this->dataSize += bytes_written;
    126133    }
    127134  fclose(read_handle);
    128135  fclose(write_handle);
     136
     137//  this->dataFiles += 1;
    129138
    130139  // free destination filename text
     
    152161  if (file->isDirectory())
    153162    {
    154 
    155163      // get destination directory
    156164      char *thisDestDir = this->destination(file);
     
    168176        if (monitor != NULL)
    169177            {
    170                 monitor->copiedDir(thisDestDir);
     178                monitor->copiedDir(destPath.pathString());
    171179            }
    172180      }
     
    230238}
    231239
     240unsigned long fileCopySet::getOriginalFiles()
     241{
     242  // initialise counters for size
     243  return this->dataFiles;
     244}
     245
    232246/**
    233247 *  Perform a check on the total space available at the destination; if not
     
    237251{
    238252  fileCopySetList localSet = this->list;
     253
     254  this->progressBar.message("Checking disk space requirements");
    239255
    240256  do
     
    294310
    295311  // record size and initialise the progressbar with the same
    296   this->dataSize = 0;
     312  this->dataSize  = 0;
     313  this->dataFiles = 0;
    297314  for (unsigned int i = 0; i < this->list.size(); i ++)
    298315    {
    299316      this->dataSize += this->list[i].getOriginalSize();
    300     }
    301   this->progressBar.init(this->dataSize);
     317      this->dataFiles += this->list[i].getOriginalFiles();
     318    }
     319  this->progressBar.init(this->dataSize, this->dataFiles);
    302320
    303321  // return postive check
     
    310328  this->dataSize = 0;
    311329  this->copied = 0;
     330  this->dataFiles = 0;
    312331  this->monitor = monitor;
     332
     333  this->progressBar.show();
     334  this->progressBar.message("Initialising");
    313335}
    314336
     
    317339  this->dataSize = 0;
    318340  this->copied = 0;
     341  this->dataFiles = 0;
    319342  this->monitor = monitor;
    320 }
    321 
     343
     344  this->progressBar.show();
     345  this->progressBar.message("Initialising");
     346}
     347
     348void fileCopier::addSet(fileCopySet &set)
     349{   this->list.push_back(set);
     350    this->progressBar.message("Gathering files to copy");
     351}
     352
     353// Do the actual file copy
    322354void fileCopier::copy()
    323355{
     
    325357  fileCopySetList::iterator end = list.end();
    326358
    327 
    328   this->progressBar.show();
     359  // Tell the user what is happening
     360  char buffer[100];
     361  sprintf(buffer, "Copying %3.1fMb of files", (double) this->dataSize / (double) (1024 * 1024));
     362  this->progressBar.message(buffer);
     363  this->progressBar.setStartTime();
     364
     365  // Copy each file set individually, using the progress bar as a monitor
    329366  while (here != end)
    330367    {
     
    333370    }
    334371
     372  // Close the progress bar, as it is no longer needed
    335373  this->progressBar.close();
    336374}
  • trunk/gsinstaller/fileCopier.h

    r1766 r2534  
    1010  fileCopyMonitor() {};
    1111  virtual void copiedFile(string from, string to) = 0;
     12  virtual void createdDir(string dirName) = 0;
    1213  virtual void copiedDir(string dirName) = 0;
    1314};
     
    1617{
    1718private:
    18   FileVector fileList;
    19   FilePath sourceDir;
     19  FileVector        fileList;
     20  FilePath          sourceDir;
     21  string          label;
    2022  unsigned long dataSize;
     23  unsigned long   dataFiles;
    2124public:
    2225  FilePath destDir;
    2326  fileCopySet();
    24   fileCopySet(FileVector files, FilePath &from, FilePath &to);
     27  fileCopySet(string label, FileVector files, FilePath &from, FilePath &to);
    2528  char *destination(File *file);
    2629  unsigned long getOriginalSize();
     30  unsigned long getOriginalFiles();
    2731  unsigned long getCopiedSize(DiskSpace &space);
    2832  bool ensureParent(FilePath &child, fileCopyMonitor *monitor);
     
    3842private:
    3943  fileCopySetList list;
    40   unsigned long dataSize;
     44  unsigned long     dataSize;
    4145  unsigned long copied;
     46  unsigned long   dataFiles;
    4247  copyProgressBar progressBar;
    4348  fileCopyMonitor *monitor;
     
    4651  fileCopier::fileCopier(fileCopyMonitor *monitor, fileCopySetList &list);
    4752  fileCopier::fileCopier(fileCopyMonitor *monitor);
    48   void fileCopier::addSet(fileCopySet &set) { this->list.push_back(set); }
     53  void fileCopier::addSet(fileCopySet &set);
    4954  bool checkSpace();
    5055  void copy();
  • trunk/gsinstaller/gsManifest.cpp

    r2063 r2534  
    1414gsManifest::gsManifest(installManager &manager, FilePath &root)
    1515  : installAgent(manager), fileCopyMonitor()
    16 {   
     16{
    1717  this->getManifest(root);
    1818  this->expandGroups();
     
    234234  stringArray &groupArray = this->manifests[groupName];
    235235
    236   // do we really need this twice ??
    237   // groupArray = this->manifests[groupName];
    238 
    239236  this->selected[destination].add(groupArray);
     237
     238    if (groupName == "collection")
     239   {  FilePath *temp = new FilePath(destination, "\\collect");
     240    this->collectRoot = *temp;
     241      delete temp;
     242   }
    240243}
    241244
     
    261264      // as the destinations go
    262265      fileList = this->selection(*source, array);
    263       fileCopySet copySet(*fileList, *source, path);
     266      fileCopySet copySet("", *fileList, *source, path);
    264267      copy.addSet(copySet);
    265268      delete fileList;
     
    279282
    280283void gsManifest::copiedFile(string from, string to)
    281 { this->logAction("Manifest.CopyFile", from, to);
     284{  if (!this->collectRoot.isAncestorOf(to))
     285    {   this->logAction("Manifest.CopyFile", from, to);
     286   }
     287}
     288
     289void gsManifest::createdDir(string dirName)
     290{ this->logAction("Manifest.CreateDir", dirName);
    282291}
    283292
    284293void gsManifest::copiedDir(string dirName)
    285 { this->logAction("Manifest.CreateDir", dirName);
     294{
     295    if (!this->collectRoot.isAncestorOf(dirName))
     296    {  if (this->collectRoot.pathString() == dirName)
     297       {
     298       this->logAction("Manifest.CopyDir", dirName);
     299       }
     300      else
     301      {
     302          this->logAction("Manifest.CreateDir", dirName);
     303      }
     304   }
    286305}
    287306
     
    311330      return true;
    312331    }
     332  else if (actionName == "Manifest.CopyDir")
     333      {
     334            // do a recursive delete then
     335         File f(params[0]);
     336         if (!f.remove())
     337           {
     338              this->removeFailed.add(params[0]);
     339           }
     340         return true;
     341      }
    313342  else if (actionName == "Manifest.CopyFile" || actionName == "CopyFile")
    314343    {
  • trunk/gsinstaller/gsManifest.h

    r2013 r2534  
    2828  stringArray removeFailed;
    2929
     30  FilePath collectRoot;
     31
    3032  bool getManifestLine(char *line, string &macro);
    3133public:
     
    5153 
    5254  void copiedFile(string from, string to); // from fileCopyMonitor
     55  void createdDir(string dirName); // from fileCopyMonitor
    5356  void copiedDir(string dirName); // from fileCopyMonitor
    5457};
  • trunk/gsinstaller/gsProfile.cpp

    r2288 r2534  
    2828  { if (this->fileName == params[0])
    2929    {   DeleteFile(params[0].c_str());
     30        return true;
    3031    }
    3132  }
     
    100101                                                                    itemValue.c_str(), this->fileName.c_str()))
    101102    { DWORD error = GetLastError();
    102 /*      char buffer[20];
    103     sprintf(buffer, "%lx", error);
    104     MessageBox(0, buffer, "", MB_OK);*/
     103/*      char buffer[201];
     104        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, buffer, 200, NULL);
     105      MessageBox(0, buffer, "Write error", MB_OK);
     106*/
     107
    105108    return false;
    106109  }
     
    112115{ if (!WritePrivateProfileString( sectionName.c_str(), itemName.c_str(),
    113116                                    NULL, this->fileName.c_str()))
    114     { MessageBox(0, "Failed", itemName.c_str(), MB_OK);
    115     return false;
     117    {  DWORD error = GetLastError();
     118      if (error != 3)
     119      {     char buffer[201];
     120
     121            MessageBox(0, "Failed", itemName.c_str(), MB_OK);
     122            FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, buffer, 200, NULL);
     123          MessageBox(0, buffer, "Write error", MB_OK);
     124            return false;
     125    }
     126      WritePrivateProfileString(NULL, NULL, NULL, this->fileName.c_str());
     127        MessageBox(0, this->fileName.c_str(), sectionName.c_str(), MB_OK);
    116128  }
    117129  return true;
  • trunk/gsinstaller/gsinstall.cpp

    r2288 r2534  
    257257
    258258  // do the copy
    259   this->manifest->copy(this->gsdlSourcePath);
    260 
    261   return true;
     259  return this->manifest->copy(this->gsdlSourcePath);
    262260}
    263261
     
    413411  this->readLog();
    414412  delete logPath;
    415  
     413
    416414  return true;
    417415}
     
    431429    {
    432430      if (!this->manifest->undoAction(command, params))
    433     { 
     431    {
    434432      if (!gsdlProfile.undoAction(command, params))
    435         { 
     433        {
    436434          if (!this->gsRegister->undoAction(command, params))
    437         { 
     435        {
    438436          if (!this->progman->undoAction(command, params))
    439437            {
    440438            }
     439        else
     440        {
     441
     442        }
    441443        }
    442444        }
    443445    }
    444446    }
    445  
     447
    446448}
    447449
     
    456458    }
    457459  if (this->installFullVolume)
    458     {   
     460    {
     461      this->manifest->selectGroup("supporting", *this->dataDestPath);
    459462      this->manifest->selectGroup("collection", *this->dataDestPath);
    460463    }
    461464  else
    462     {   
     465    {
    463466      this->manifest->selectGroup("database", *this->dataDestPath);
    464467    }
     
    784787    }
    785788      break;
    786      
     789
    787790    case WM_NOTIFY:
    788791      switch (((LPNMHDR) lParam)->code)
     
    791794      {
    792795        dirSelector *selector = ((dirSelector *) GetWindowLong(Dialog, GWL_USERDATA));
    793        
     796
    794797        // bodge to set the dialogue path to the correct value
    795798        if (selector != rootSelector)
     
    798801        SetDlgItemText(Dialog, dirpath_PATH, selector->selectedPath());
    799802          }
    800        
    801         if (selector->isFinal())
    802           {
    803         PropSheet_SetWizButtons(GetParent(Dialog), PSWIZB_BACK | PSWIZB_FINISH);
    804           }
    805         else
    806           {
    807         PropSheet_SetWizButtons(GetParent(Dialog), PSWIZB_BACK | PSWIZB_NEXT);
    808           }
     803
     804
     805        PropSheet_SetWizButtons(GetParent(Dialog), (selector->isFirst() ? 0 : PSWIZB_BACK) |
     806                                                 (selector->isFinal() ? PSWIZB_FINISH : PSWIZB_NEXT));
    809807      }
    810808      break;
     
    856854
    857855void GSInstall_init_propertySheet(PROPSHEETPAGE &ppage, char *prompt, char *optPrompt,
    858                   char *title, GSInstall &installer, bool isFinal)
     856                  char *title, GSInstall &installer, bool isFirst, bool isFinal)
    859857{
    860858  GSInstall_dirPathData *data = new GSInstall_dirPathData;
     
    862860  // create the directory Selector
    863861  data->dirSelect = new dirSelector(prompt, optPrompt, title, installer.installPath());
     862  data->dirSelect->setFirst(isFirst);
    864863  data->dirSelect->setFinal(isFinal);
    865864
     
    933932                "Choose a directory to install your "
    934933                                "GreenStone software to.", NULL,
    935                                 "Select", install, false);
     934                                "Select", install, true, false);
    936935  GSInstall_init_propertySheet(ppage[1],
    937936                   "Choose a directory to install the collection "
     
    945944                   "computer.\n\n",
    946945                   "Install all collection files",
    947                    "Select", install, true);
     946                   "Select", install, false, true);
    948947
    949948  reply = (PropertySheet (&pshead) >= 0);
     
    10411040        install.setManifest();
    10421041
    1043         install.copyFiles();       // caused page fault; Windows 3.1
     1042        if (!install.copyFiles())       // caused page fault; Windows 3.1
     1043      { MessageBox(0, "Not enough space to install required files", "Greenstone Installer", MB_OK);
     1044        install.abortLog();
     1045         DestroyWindow(Window);
     1046         return false;
     1047      }
    10441048        install.updateProgman();   // caused divide overflow; Windows 3.1
    10451049        install.updateRegistry();
Note: See TracChangeset for help on using the changeset viewer.