@@ -412,6 +412,8 @@ public void handle_package_result(PackageResult packageResult, ChocolateyConfigu
412
412
ensure_bad_package_path_is_clean ( config , packageResult ) ;
413
413
EventManager . publish ( new HandlePackageResultCompletedMessage ( packageResult , config , commandName ) ) ;
414
414
415
+ remove_pending ( packageResult , config ) ;
416
+
415
417
if ( ! packageResult . Success )
416
418
{
417
419
this . Log ( ) . Error ( ChocolateyLoggers . Important , "The {0} of {1} was NOT successful." . format_with ( commandName . to_string ( ) , packageResult . Name ) ) ;
@@ -421,9 +423,7 @@ public void handle_package_result(PackageResult packageResult, ChocolateyConfigu
421
423
}
422
424
423
425
remove_rollback_if_exists ( packageResult ) ;
424
-
425
- if ( packageResult . Success ) remove_pending ( packageResult , config ) ;
426
-
426
+
427
427
this . Log ( ) . Info ( ChocolateyLoggers . Important , " The {0} of {1} was successful." . format_with ( commandName . to_string ( ) , packageResult . Name ) ) ;
428
428
429
429
var installLocation = Environment . GetEnvironmentVariable ( ApplicationParameters . Environment . ChocolateyPackageInstallLocation ) ;
@@ -1193,7 +1193,7 @@ public void remove_pending(PackageResult packageResult, ChocolateyConfiguration
1193
1193
fileLock . Dispose ( ) ;
1194
1194
}
1195
1195
1196
- if ( _fileSystem . file_exists ( pendingFile ) ) _fileSystem . delete_file ( pendingFile ) ;
1196
+ if ( packageResult . Success && _fileSystem . file_exists ( pendingFile ) ) _fileSystem . delete_file ( pendingFile ) ;
1197
1197
}
1198
1198
1199
1199
private IEnumerable < GenericRegistryValue > get_environment_before ( ChocolateyConfiguration config , bool allowLogging = true )
0 commit comments