Announcement

Collapse
No announcement yet.

Unexpected CRC Results

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unexpected CRC Results

    I'm reading the CRC value (using File.GetCRC()) of the running exe file (the application) as well as the CRC of a file on a network share drive. When they are different, I download the file from the network share and replace the running exe file (basically, an quick updater).

    The problem is, as soon I copy the application file over to the network share folder, its CRC changes. It didn't seem to do this before. I'm wondering what might cause a file's CRC value to change when copied. Last week, I had this working and now it doesn't although I'm not sure what changed.

  • #2
    Here's the code, by the way.

    PHP Code:
    function CheckForUpdate()

      if 
    not (Folder.DoesExist(PATH_RAD_BIN) and Folder.DoesExist(PATH_RAD_DATA)) then
        log
    .fatal("This workstation is not connected to the General Drive.\r\nProgram will now exit.");
        
    Application.Exit(1);
      
    end

      local pMe 
    _ExeFolder .."\"..FILENAME_JPFO_DATA_MANAGER;
      local pUpdate = PATH_RAD_BIN .."
    \"..FILENAME_JPFO_DATA_MANAGER;

      if (File.DoesExist(pMe) and File.DoesExist(pUpdate)) then
        local nMyCRC = File.GetCRC(pMe);
        local nUpdateCRC = File.GetCRC(pUpdate);
        p(nMyCRC.."
    \r\n"..nUpdateCRC)

        if (nMyCRC ~= -1 and nUpdateCRC ~= -1) then

          if (nMyCRC ~= nUpdateCRC) then
            p(nMyCRC.."
    \r\n"..nUpdateCRC)
            local tDetails = Project.GetDetails();
            Project.UpdateRuntime(pUpdate, "", true, "
    Black", "Green", "Updating "..tDetails.Title, "Please wait...", "Update complete.", true, true);
          end

        end

      end

    end 

    Comment


    • #3
      Initially, I can think only of transfer errors during the file copy, or hardware issues, as the cause for a file getting a different CRC after being copied to a network folder. Or, less likely, something attached itself to the file.
      When you copy this file back to the local disk, with a new name or to a different folder, so it does not overwrite the original, do the two local files now show different CRCs?

      Ulrich

      Comment


      • #4
        I haven't tried that yet. I'll do that tomorrow when I get to work and report the results.
        https://github.com/CentauriSoldier

        Comment


        • #5
          I found a better way to address the issue so need to figure out why this is happening.

          Comment

          Working...
          X