View Single Post
  #3  
Old 31-05-2025, 14:46
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,074
Thanks: 1,814
Thanked 2,304 Times in 787 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by insertdisc View Post
I changed
Code:
begin
  I := 1;
  SetArrayLength(HashFileList, 0);
  while GetIniString('CRCCheck', 'HashFile' + IntToStr(I), '', ExpandConstant('{tmp}\Settings.ini')) <> '' do
  begin
    HashLine := GetIniString('CRCCheck', 'HashFile' + IntToStr(I), '', ExpandConstant('{tmp}\Settings.ini'));
    if ComponentsCheck(LineDecode(HashLine, 'Comp', '')) and TasksCheck(LineDecode(HashLine, 'Task', '')) and LanguagesCheck(LineDecode(HashLine, 'Lang', '')) then
    begin
      HashFile := ExpandFileName(ExpandConstant(Trim(LineDecode(HashLine, '', ''))));
      if FileExists(HashFile) or (Pos(LowerCase(ExpandConstant('{app}\')), LowerCase(HashFile)) > 0) then
      begin
        Y := GetArrayLength(HashFileList);
        SetArrayLength(HashFileList, Y + 1);
        HashFileList[Y].FileName := GenerateUniqueName(ExpandConstant('{tmp}'), '.dat');
        HashFileList[Y].BasePath := ExpandFileName(ExpandConstant(Trim(LineDecode(HashLine, 'DestDir', '{app}'))));
        HashFileList[Y].AppDirFile := Pos(LowerCase(ExpandConstant('{app}\')), LowerCase(HashFile)) > 0;
        HashFileList[Y].Algorithm := DSG_GetHashAlgorithm(Trim(LineDecode(HashLine, 'Algo', 'auto')));
        if (not HashFileList[Y].AppDirFile) and (not FileCopy(HashFile, HashFileList[Y].FileName, False)) then
          SetArrayLength(HashFileList, Y);
      end;
    end;
to
Code:
begin
  I := 1;
  SetArrayLength(HashFileList, 0);
  while GetIniString('CRCCheck', 'HashFile' + IntToStr(I), '', ExpandConstant('{tmp}\Settings.ini')) <> '' do
  begin
    HashLine := GetIniString('CRCCheck', 'HashFile' + IntToStr(I), '', ExpandConstant('{tmp}\Settings.ini'));
    if ComponentsCheck(LineDecode(HashLine, 'Comp', '')) and TasksCheck(LineDecode(HashLine, 'Task', '')) and LanguagesCheck(LineDecode(HashLine, 'Lang', '')) then
    begin
      HashFile := ExpandFileName(ExpandConstant(Trim(LineDecode(HashLine, '', ''))));
      if FileExists(HashFile) or (Pos(LowerCase(ExpandConstant('{tmp}\')), LowerCase(HashFile)) > 0) then
      begin
        Y := GetArrayLength(HashFileList);
        SetArrayLength(HashFileList, Y + 1);
        HashFileList[Y].FileName := GenerateUniqueName(ExpandConstant('{tmp}'), '.dat');
        HashFileList[Y].BasePath := ExpandFileName(ExpandConstant(Trim(LineDecode(HashLine, 'DestDir', '{app}'))));
        HashFileList[Y].AppDirFile := Pos(LowerCase(ExpandConstant('{tmp}\')), LowerCase(HashFile)) > 0;
        HashFileList[Y].Algorithm := DSG_GetHashAlgorithm(Trim(LineDecode(HashLine, 'Algo', 'auto')));
        if (not HashFileList[Y].AppDirFile) and (not FileCopy(HashFile, HashFileList[Y].FileName, False)) then
          SetArrayLength(HashFileList, Y);
      end;
    end;
and hash completed successfully. Though I'm not sure what long-term implications that would have.
You did a "hack". LOL

If your hash file source path is the installation folder, you're in trouble.
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
insertdisc (01-06-2025)