@@ -435,11 +435,6 @@ static auto RunRollback(std::vector<InstallableFile>& files) -> size_t
435
435
AddReportLog (5055 , SString (" RunRollback: Rollback failed for %zu out of %zu files" , disasterCounter, files.size ()));
436
436
OutputDebugLine (SString (" RunRollback: Rollback failed for %zu out of %zu files" , disasterCounter, files.size ()));
437
437
}
438
- else
439
- {
440
- AddReportLog (5055 , SString (" RunRollback: Rollback succeeded for %zu files" , files.size ()));
441
- OutputDebugLine (SString (" RunRollback: Rollback succeeded for %zu files" , files.size ()));
442
- }
443
438
444
439
return disasterCounter;
445
440
}
@@ -585,10 +580,7 @@ static int RunInstall()
585
580
OutputDebugLine (SString (" RunInstall: Installing %zu out of %zu files" , files.size (), archiveFiles.size ()));
586
581
587
582
if (files.empty ())
588
- {
589
- AddReportLog (5055 , SString (" RunInstall: Update is obsolete (%zu files skipped)" , archiveFiles.size ()));
590
583
return 0 ;
591
- }
592
584
593
585
// Check if any executable or library is locked by any process and terminate it with the user's consent.
594
586
for (const InstallableFile& file : files)
@@ -633,6 +625,12 @@ static int RunInstall()
633
625
634
626
if (!success)
635
627
{
628
+ if (!FileExists (file.targetFile .absolutePath ))
629
+ {
630
+ AddReportLog (5055 , SString (" RunInstall: Target file '%s' is missing (attempts: %d)" , file.relativePath .c_str (), attempts));
631
+ break ;
632
+ }
633
+
636
634
if (attempts == 1 )
637
635
{
638
636
// If the first attempt didn't work, check if any process is locking one of the files.
@@ -647,9 +645,14 @@ static int RunInstall()
647
645
648
646
if (!success)
649
647
{
650
- bool exists = FileExists (file.targetFile .absolutePath );
651
- AddReportLog (5055 , SString (" RunInstall: Unable to create backup of '%s' in '%s' (exists: %d, attempts: %d, checksums: %d)" ,
652
- file.targetFile .c_str (), file.backupFile .c_str (), exists, attempts, checksums));
648
+ bool targetExists = FileExists (file.targetFile .absolutePath );
649
+ uint64_t targetSize = FileSize (file.targetFile .absolutePath );
650
+ bool backupExists = FileExists (file.backupFile .absolutePath );
651
+ uint64_t backupSize = FileSize (file.backupFile .absolutePath );
652
+ AddReportLog (5055 , SString (" RunInstall: Unable to create backup of '%s' (attempts: %d, checksums: %d, target: %d [size:%llu hash:%08x], backup: %d "
653
+ " [size: %llu hash:%08x])" ,
654
+ file.relativePath .c_str (), attempts, checksums, targetExists, targetSize, file.targetFile .checksum .value_or (0 ),
655
+ backupExists, backupSize, file.backupFile .checksum .value_or (0 )));
653
656
return 6 ;
654
657
}
655
658
}
@@ -696,6 +699,12 @@ static int RunInstall()
696
699
697
700
if (!success)
698
701
{
702
+ if (!FileExists (file.sourceFile .absolutePath ))
703
+ {
704
+ AddReportLog (5055 , SString (" RunInstall: Source file '%s' is missing (attempts: %d)" , file.relativePath .c_str (), attempts));
705
+ break ;
706
+ }
707
+
699
708
if (attempts == 1 )
700
709
{
701
710
// If the first attempt didn't work, check if any process is locking one of the files.
@@ -722,8 +731,8 @@ static int RunInstall()
722
731
if (!success)
723
732
{
724
733
bool exists = FileExists (file.sourceFile .absolutePath );
725
- AddReportLog (5055 , SString (" RunInstall: Unable to install '%s' to '%s' (exists: %d, attempts: %d, checksums: %d)" , file.sourceFile .c_str (),
726
- file. targetFile . c_str (), exists, attempts, checksums));
734
+ AddReportLog (5055 , SString (" RunInstall: Unable to install '%s' (exists: %d, attempts: %d, checksums: %d)" , file.relativePath .c_str (), exists ,
735
+ attempts, checksums));
727
736
requiresRollback = true ;
728
737
break ;
729
738
}
0 commit comments