Beispiel #1
0
static BOOL UninstallInf(const char *pPath)
{
  int res;

  do {
    res = IDCONTINUE;

    char infPathDest[MAX_PATH];

    if (SNPRINTF(infPathDest, sizeof(infPathDest)/sizeof(infPathDest[0]), "%s", pPath) > 0) {
#ifdef HAVE_SetupUninstallOEMInf
      char *pInfNameDest, *p;

      for (pInfNameDest = p = infPathDest ; *p ; p++)
        if (*p == '\\')
          pInfNameDest = p + 1;

      if (SetupUninstallOEMInf(pInfNameDest, 0, NULL)) {
        Trace("Deleted %s\n", pInfNameDest);
      } else {
        res = ShowLastError(MB_CANCELTRYCONTINUE, "SetupUninstallOEMInf(%s)", pInfNameDest);
      }
#else /* HAVE_SetupUninstallOEMInf */
      if (UninstallFile(infPathDest)) {
        int infPathDestLen = lstrlen(infPathDest);

        if (infPathDestLen > 4) {
          char *pInfPathDestExt = infPathDest + infPathDestLen - 4;

          if (!lstrcmpi(pInfPathDestExt, ".inf")) {
            pInfPathDestExt[1] = 'p';     // pInfPathDestExt = ".pnf"

            if (!UninstallFile(infPathDest))
              res = IDCANCEL;
          }
        }
      } else {
        res = IDCANCEL;
      }
#endif /* HAVE_SetupUninstallOEMInf */
    } else {
      Trace("Can't uninstall %s\n", pPath);
      res = IDCANCEL;
    }
  } while (res == IDTRYAGAIN);

  if (res != IDCONTINUE)
    return FALSE;

  return res;
}
Beispiel #2
0
void UpdateDlg::OnUninstall(wxCommandEvent& event)
{
    UninstallFile();
}