@@ -166,13 +166,12 @@ void OnSplitSyncProgressChanged(string? sender, SyncProgressChangedEventArgs arg
166166
167167 await InstallMultipleRemotePackageAsync ( baseRemoteFilePath , splitRemoteFilePaths , callback , cancellationToken , arguments ) ;
168168
169- callback ? . Invoke ( new InstallProgressEventArgs ( 0 , splitRemoteFilePaths . Length + 1 , PackageInstallProgressState . PostInstall ) ) ;
170169 int count = 0 ;
170+ callback ? . Invoke ( new InstallProgressEventArgs ( 0 , splitRemoteFilePaths . Length + 1 , PackageInstallProgressState . PostInstall ) ) ;
171171 await splitRemoteFilePaths . Select ( async x =>
172172 {
173- count ++ ;
174173 await RemoveRemotePackageAsync ( x , cancellationToken ) . ConfigureAwait ( false ) ;
175- callback ? . Invoke ( new InstallProgressEventArgs ( count , splitRemoteFilePaths . Length + 1 , PackageInstallProgressState . PostInstall ) ) ;
174+ callback ? . Invoke ( new InstallProgressEventArgs ( ++ count , splitRemoteFilePaths . Length + 1 , PackageInstallProgressState . PostInstall ) ) ;
176175 } ) . WhenAll ( ) . ConfigureAwait ( false ) ;
177176
178177 if ( count < splitRemoteFilePaths . Length )
@@ -240,13 +239,12 @@ void OnSyncProgressChanged(string? sender, SyncProgressChangedEventArgs args)
240239
241240 await InstallMultipleRemotePackageAsync ( splitRemoteFilePaths , packageName , callback , cancellationToken , arguments ) ;
242241
243- callback ? . Invoke ( new InstallProgressEventArgs ( 0 , splitRemoteFilePaths . Length , PackageInstallProgressState . PostInstall ) ) ;
244242 int count = 0 ;
243+ callback ? . Invoke ( new InstallProgressEventArgs ( 0 , splitRemoteFilePaths . Length , PackageInstallProgressState . PostInstall ) ) ;
245244 await splitRemoteFilePaths . Select ( async x =>
246245 {
247- count ++ ;
248246 await RemoveRemotePackageAsync ( x , cancellationToken ) . ConfigureAwait ( false ) ;
249- callback ? . Invoke ( new InstallProgressEventArgs ( count , splitRemoteFilePaths . Length , PackageInstallProgressState . PostInstall ) ) ;
247+ callback ? . Invoke ( new InstallProgressEventArgs ( ++ count , splitRemoteFilePaths . Length , PackageInstallProgressState . PostInstall ) ) ;
250248 } ) . WhenAll ( ) . ConfigureAwait ( false ) ;
251249
252250 if ( count < splitRemoteFilePaths . Length )
@@ -284,10 +282,10 @@ public async Task InstallMultipleRemotePackageAsync(string baseRemoteFilePath, I
284282 callback ? . Invoke ( new InstallProgressEventArgs ( 1 , splitRemoteFileCount + 1 , PackageInstallProgressState . WriteSession ) ) ;
285283
286284 int count = 0 ;
287- await splitRemoteFilePaths . Select ( async splitRemoteFilePath =>
285+ await splitRemoteFilePaths . Select ( async ( splitRemoteFilePath , index ) =>
288286 {
289- await WriteInstallSessionAsync ( session , $ "split{ count ++ } ", splitRemoteFilePath , cancellationToken ) . ConfigureAwait ( false ) ;
290- callback ? . Invoke ( new InstallProgressEventArgs ( count , splitRemoteFileCount + 1 , PackageInstallProgressState . WriteSession ) ) ;
287+ await WriteInstallSessionAsync ( session , $ "split{ index } ", splitRemoteFilePath , cancellationToken ) . ConfigureAwait ( false ) ;
288+ callback ? . Invoke ( new InstallProgressEventArgs ( ++ count , splitRemoteFileCount + 1 , PackageInstallProgressState . WriteSession ) ) ;
291289 } ) . WhenAll ( ) . ConfigureAwait ( false ) ;
292290
293291 if ( count < splitRemoteFileCount )
@@ -329,10 +327,10 @@ public async Task InstallMultipleRemotePackageAsync(IEnumerable<string> splitRem
329327 callback ? . Invoke ( new InstallProgressEventArgs ( 0 , splitRemoteFileCount , PackageInstallProgressState . WriteSession ) ) ;
330328
331329 int count = 0 ;
332- await splitRemoteFilePaths . Select ( async splitRemoteFilePath =>
330+ await splitRemoteFilePaths . Select ( async ( splitRemoteFilePath , index ) =>
333331 {
334- await WriteInstallSessionAsync ( session , $ "split{ count ++ } ", splitRemoteFilePath , cancellationToken ) . ConfigureAwait ( false ) ;
335- callback ? . Invoke ( new InstallProgressEventArgs ( count , splitRemoteFileCount , PackageInstallProgressState . WriteSession ) ) ;
332+ await WriteInstallSessionAsync ( session , $ "split{ index } ", splitRemoteFilePath , cancellationToken ) . ConfigureAwait ( false ) ;
333+ callback ? . Invoke ( new InstallProgressEventArgs ( ++ count , splitRemoteFileCount , PackageInstallProgressState . WriteSession ) ) ;
336334 } ) . WhenAll ( ) . ConfigureAwait ( false ) ;
337335
338336 if ( count < splitRemoteFileCount )
0 commit comments