Changeset 2013 for trunk/gsinstaller


Ignore:
Timestamp:
2001-02-20T00:11:32+13:00 (23 years ago)
Author:
cs025
Message:

Updates and fixes to permit removal of the main install directory successfully.

Location:
trunk/gsinstaller
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsinstaller/gsManifest.cpp

    r1764 r2013  
    305305  if (actionName == "Manifest.CreateDir" || actionName == "CreateDir")
    306306    {
    307       RemoveDirectory(params[0].c_str());
     307      if (!RemoveDirectory(params[0].c_str()))
     308      {
     309        MessageBox(0, "Remove failed", params[0].c_str(), MB_OK);
     310            this->removeFailed.add(params[0]);
     311      }
    308312      return true;
    309313    }
     
    314318    }
    315319  return false;
     320}
     321
     322bool gsManifest::undoFailed(string path)
     323{
     324    return this->removeFailed.includes(path);
    316325}
    317326
  • trunk/gsinstaller/gsManifest.h

    r1545 r2013  
    2626  strArrayMap manifests;
    2727  pathStringArrayMap selected;
     28  stringArray removeFailed;
    2829
    2930  bool getManifestLine(char *line, string &macro);
     
    3637  void logAction(string actionName, string source, string dest);
    3738  bool undoAction(string actionName, stringArray &params);
     39  bool undoFailed(string path);
    3840  void expandGroupInstance(const string &parentgroup, string groupName);
    3941  void expandGroup(const string &group);
  • trunk/gsinstaller/gsinstall.cpp

    r1765 r2013  
    7272  FilePath *collectionPath();
    7373  FilePath *installPath();
     74  FilePath *installSourcePath() { return this->sourcePath; }
    7475  bool copyFiles();
    7576  bool updateRegistry();
     
    7879  bool updateSetupExe();
    7980  bool installNetscape();
     81  bool removeFailed(string file) { return this->manifest->undoFailed(file); }
    8082  void setDestination();
    8183  bool setUninstall();
     
    387389      FilePath exeDest(tempPath, "gssetup.exe");
    388390      FilePath logDest(tempPath, "install.log");
    389      
     391
    390392      CopyFile(exePath.cString(), exeDest.cString(), false);
    391393      CopyFile(logPath.cString(), logDest.cString(), false);
     
    436438    }
    437439    }
     440 
    438441}
    439442
     
    510513
    511514
    512     if (this->platform.isWindows32s() == false) // NB: don't add this shortcut under
     515    FilePath uninstallPath(this->destinationPath->pathString(), "gssetup.exe");
     516    FilePath logPath(this->destinationPath->pathString(), "install.log");
     517    if (this->platform.isWindows32s() == false) // NB: don't add this shortcut under
    513518                                              // Windows32s as it causes a crash
    514519                                              //
     
    516521                                              // happy code
    517522  {
    518       FilePath uninstallPath(this->destinationPath->pathString(), "gssetup.exe");
    519       FilePath logPath(this->destinationPath->pathString(), "install.log");
    520523      if (!this->progman->addIcon(groupName, "Uninstall", uninstallPath.pathString(), " -u " + logPath.pathString(),
    521524                  "Remove this Greenstone collection"))
    522525      {
    523526      }
     527    }
     528    else
     529    {   MessageBox(0, uninstallPath.cString(), logPath.cString(), MB_OK);
    524530    }
    525531      // disconnect from program manager
     
    749755
    750756        case dirpath_OPTION:
    751       ((dirSelector *) GetWindowLong(Dialog, GWL_USERDATA))->setOption(IsDlgButtonChecked(Dialog, dirpath_OPTION));
     757      ((dirSelector *) GetWindowLong(Dialog, GWL_USERDATA))->setOption(IsDlgButtonChecked(Dialog, dirpath_OPTION) == BST_CHECKED);
    752758      if (HIWORD(wParam) == BN_CLICKED && false)
    753759        // don't do the enable/disable these days
     
    958964        string logPathString(at);
    959965        FilePath logPath(logPathString);
    960        
     966
    961967        GSInstall install(true);
    962968        // if we're running in the temporary directory, do the uninstall
     
    980986          FilePath *logParent = logPath.parent();
    981987          FilePath uninstallPath(*logParent, "gssetup.exe");
    982          
     988
    983989          // delete the gssetup executable
    984990          DeleteFile(uninstallPath.cString());
    985          
     991
     992        MessageBox(0, logParent->cString(), "Removing", MB_OK);
     993          if (install.removeFailed(logParent->pathString()))
     994            {
     995                RemoveDirectory(logParent->cString());
     996            }
     997
    986998          // dispose of the parent directory information
    987999          delete logParent;
    9881000        }
     1001
    9891002          // if not, then overwrite the original log with the modified one
    9901003          else
     
    10111024        install.copyFiles();       // caused page fault; Windows 3.1
    10121025        install.updateProgman();   // caused divide overflow; Windows 3.1
    1013     install.updateRegistry();
     1026        install.updateRegistry();
    10141027        install.updateProfiles();
    10151028        install.updateSetupExe();  // caused bomb-out of Windows; 3.1
  • trunk/gsinstaller/unInstall.cpp

    r1673 r2013  
    245245    if (!this->logfile.rdbuf()->is_open())
    246246#endif
    247     {   MessageBox(0, "Unable to open log file", "Test", MB_OK);
     247    {   MessageBox(0, "Unable to open log file", this->logfileName.c_str(), MB_OK);
    248248    }
    249249
Note: See TracChangeset for help on using the changeset viewer.