@@ -219,7 +219,7 @@ public int GetFileCount(string sourceDirectory)
219
219
return fileCount ;
220
220
}
221
221
222
- public void CopyDirectory ( string source , string destination , int CurrentCount , Action < int > ReportProgress , Func < bool > CancelPending )
222
+ public void CopyDirectory ( string source , string destination , ref int CurrentCount , Action < int > ReportProgress , Func < bool > CancelPending )
223
223
{
224
224
byte [ ] buffer = new byte [ 0x100000 ] ; //1 MB
225
225
int bytesRead = 0 ;
@@ -287,7 +287,7 @@ public void CopyDirectory(string source, string destination, int CurrentCount, A
287
287
}
288
288
}
289
289
string destinationDir = Path . Combine ( destination , SubDir . Name ) ;
290
- CopyDirectory ( SubDir . FullName , destinationDir , CurrentCount , ReportProgress , CancelPending ) ;
290
+ CopyDirectory ( SubDir . FullName , destinationDir , ref CurrentCount , ReportProgress , CancelPending ) ;
291
291
}
292
292
}
293
293
@@ -442,10 +442,11 @@ public void PerformInstall(Action<bool, bool> ReportComplete, Action<int> Report
442
442
//
443
443
int CompletionPercent = 0 ;
444
444
int LastCompletionPercent = 0 ;
445
+ int CurrentCount = 0 ;
445
446
InstallLogger . Log ( string . Format ( "Copying files..." ) ) ;
446
447
int FileCount = GetFileCount ( sourcePath ) ;
447
448
CreateInstallDirectory ( installPath ) ;
448
- CopyDirectory ( sourcePath , installPath , 0 , delegate ( int CurrentFileCount )
449
+ CopyDirectory ( sourcePath , installPath , ref CurrentCount , delegate ( int CurrentFileCount )
449
450
{
450
451
CompletionPercent = ( CurrentFileCount * 100 ) / FileCount ;
451
452
if ( CompletionPercent > LastCompletionPercent )
0 commit comments