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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.