} else if(((szSubStr = strstr(szLCLine, KEY_REPLACING_SHARED_FILE)) != NULL) && (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL)) {  ParseForFile(szSubStr, KEY_REPLACING_SHARED_FILE, szFile, sizeof(szFile)); if(DecrementSharedFileCounter(szFile) == 0) { if((gdwWhatToDo != WTD_NO_TO_ALL) && (gdwWhatToDo != WTD_YES_TO_ALL)) gdwWhatToDo = DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_WHAT_TO_DO), hDlgUninstall, DlgProcWhatToDo, (LPARAM)szFile);  if((gdwWhatToDo == WTD_YES) || (gdwWhatToDo == WTD_YES_TO_ALL)) { DeleteWinRegValue(HKEY_LOCAL_MACHINE, KEY_SHARED_DLLS, szFile); DeleteOrDelayUntilReboot(szFile); } else if(gdwWhatToDo == WTD_CANCEL) return(WTD_CANCEL); }
DWORD Uninstall(sil* silInstallLogHead){  sil   *silInstallLogTemp;  LPSTR szSubStr;  char  szLCLine[MAX_BUF];  char  szKey[MAX_BUF];  char  szRootKey[MAX_BUF];  char  szName[MAX_BUF];  char  szFile[MAX_BUF];  char  szParams[MAX_BUF];  HKEY  hkRootKey;  int   rv;  if(silInstallLogHead != NULL)  {    silInstallLogTemp = silInstallLogHead;    do    {      silInstallLogTemp = silInstallLogTemp->Prev;      lstrcpy(szLCLine, silInstallLogTemp->szLine);      CharLowerBuff(szLCLine, sizeof(szLCLine));      if(((szSubStr = strstr(szLCLine, KEY_WINDOWS_REGISTER_SERVER)) != NULL) &&          (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        ParseForFile(szSubStr, KEY_WINDOWS_REGISTER_SERVER, szFile, sizeof(szFile));        if(DetermineUnRegisterServer(silInstallLogHead, szFile) == TRUE)          UnregisterServer(szFile);      }      else if(((szSubStr = strstr(szLCLine, KEY_INSTALLING_SHARED_FILE)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        /* check for "Installing Shared File: " string and delete the file */        ParseForFile(szSubStr, KEY_INSTALLING_SHARED_FILE, szFile, sizeof(szFile));        if(DecrementSharedFileCounter(szFile) == 0)        {          if((gdwWhatToDo != WTD_NO_TO_ALL) && (gdwWhatToDo != WTD_YES_TO_ALL))          {            MessageBeep(MB_ICONEXCLAMATION);            gdwWhatToDo = DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_WHAT_TO_DO), hDlgUninstall, DlgProcWhatToDo, (LPARAM)szFile);          }          if((gdwWhatToDo == WTD_YES) || (gdwWhatToDo == WTD_YES_TO_ALL))          {            DeleteWinRegValue(HKEY_LOCAL_MACHINE, KEY_SHARED_DLLS, szFile);            DeleteOrDelayUntilReboot(szFile);          }          else if(gdwWhatToDo == WTD_CANCEL)            return(WTD_CANCEL);        }      }      else if(((szSubStr = strstr(szLCLine, KEY_INSTALLING)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        /* check for "Installing: " string and delete the file */        ParseForFile(szSubStr, KEY_INSTALLING, szFile, sizeof(szFile));        DeleteOrDelayUntilReboot(szFile);      }      else if(((szSubStr = strstr(szLCLine, KEY_REPLACING_SHARED_FILE)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        /* check for "Replacing Shared File: " string and delete the file */        ParseForFile(szSubStr, KEY_REPLACING_SHARED_FILE, szFile, sizeof(szFile));        if(DecrementSharedFileCounter(szFile) == 0)        {          if((gdwWhatToDo != WTD_NO_TO_ALL) && (gdwWhatToDo != WTD_YES_TO_ALL))            gdwWhatToDo = DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_WHAT_TO_DO), hDlgUninstall, DlgProcWhatToDo, (LPARAM)szFile);          if((gdwWhatToDo == WTD_YES) || (gdwWhatToDo == WTD_YES_TO_ALL))          {            DeleteWinRegValue(HKEY_LOCAL_MACHINE, KEY_SHARED_DLLS, szFile);            DeleteOrDelayUntilReboot(szFile);          }          else if(gdwWhatToDo == WTD_CANCEL)            return(WTD_CANCEL);        }      }      else if(((szSubStr = strstr(szLCLine, KEY_REPLACING)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        /* check for "Replacing: " string and delete the file */        ParseForFile(szSubStr, KEY_REPLACING, szFile, sizeof(szFile));        DeleteOrDelayUntilReboot(szFile);      }      else if(((szSubStr = strstr(szLCLine, KEY_STORE_REG_STRING)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        /* check for "Store Registry Value String: " string and remove the key */        rv = ParseForWinRegInfo(szSubStr, KEY_STORE_REG_STRING, szRootKey, sizeof(szRootKey), szKey, sizeof(szKey), szName, sizeof(szName));        if(WIZ_OK == rv)        {          hkRootKey = ParseRootKey(szRootKey);          DeleteWinRegValue(hkRootKey, szKey, szName);        }      }      else if(((szSubStr = strstr(szLCLine, KEY_STORE_REG_NUMBER)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        /* check for "Store Registry Value Number: " string and remove the key */        rv = ParseForWinRegInfo(szSubStr, KEY_STORE_REG_NUMBER, szRootKey, sizeof(szRootKey), szKey, sizeof(szKey), szName, sizeof(szName));        if(WIZ_OK == rv)        {          hkRootKey = ParseRootKey(szRootKey);          DeleteWinRegValue(hkRootKey, szKey, szName);        }      }      else if(((szSubStr = strstr(szLCLine, KEY_CREATE_REG_KEY)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        rv = ParseForWinRegInfo(szSubStr, KEY_CREATE_REG_KEY, szRootKey, sizeof(szRootKey), szKey, sizeof(szKey), szName, sizeof(szName));        if(WIZ_OK == rv)        {          hkRootKey = ParseRootKey(szRootKey);          DeleteWinRegKey(hkRootKey, szKey, FALSE);        }      }      else if(((szSubStr = strstr(szLCLine, KEY_CREATE_FOLDER)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        ParseForFile(szSubStr, KEY_CREATE_FOLDER, szFile, sizeof(szFile));        DirectoryRemove(szFile, FALSE);      }      else if(((szSubStr = strstr(szLCLine, KEY_WINDOWS_SHORTCUT)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        ParseForFile(szSubStr, KEY_WINDOWS_SHORTCUT, szFile, sizeof(szFile));        DeleteOrDelayUntilReboot(szFile);      }      else if(((szSubStr = strstr(szLCLine, KEY_COPY_FILE)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        /* check for "copy file: " string and delete the file */        ParseForCopyFile(szSubStr, KEY_COPY_FILE, szFile, sizeof(szFile));        DeleteOrDelayUntilReboot(szFile);      }      else if(((szSubStr = strstr(szLCLine, KEY_UNINSTALL_COMMAND)) != NULL) &&               (strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))      {        ParseForUninstallCommand(szSubStr, KEY_UNINSTALL_COMMAND, szFile, sizeof(szFile), szParams, sizeof(szParams));        //execute szFile with szParams here!        if(FileExists(szFile))            WinSpawn(szFile, szParams, NULL, SW_HIDE, TRUE);      }      ProcessWindowsMessages();    } while(silInstallLogTemp != silInstallLogHead);  }  return(0);}