Quote:
Originally Posted by insertdisc
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.
|