@@ -23,13 +23,13 @@ public static async Task<int> Main(string[] args)
2323 string redistPath ;
2424 if ( args . Length < 3 )
2525 {
26- Console . WriteLine ( "Wrong usage. Correct usage: UnturnedRedistUpdateTool.exe <path > <redist_path> <app_id> [args]" ) ;
26+ Console . WriteLine ( "Wrong usage. Correct usage: UnturnedRedistUpdateTool.exe <unturned_path > <redist_path> <app_id> [args]" ) ;
2727 return 1 ;
2828 }
2929 unturnedPath = args [ 0 ] ;
3030 redistPath = args [ 1 ] ;
3131 AppId = args [ 2 ] ;
32- Force = ! args . Any ( x => x . Equals ( "--force" , StringComparison . OrdinalIgnoreCase ) ) ;
32+ Force = args . Any ( x => x . Equals ( "--force" , StringComparison . OrdinalIgnoreCase ) ) ;
3333
3434 if ( string . IsNullOrWhiteSpace ( AppId ) )
3535 {
@@ -131,11 +131,13 @@ void UpdateRedist(string unturnedManagedDirectory)
131131
132132 foreach ( var fileInfo in managedFiles )
133133 {
134- var redistFilePath = Path . Combine ( unturnedPath , fileInfo . Name ) ;
135- if ( File . Exists ( redistFilePath ) )
134+ var redistFilePath = Path . Combine ( redistPath , fileInfo . Name ) ;
135+ if ( File . Exists ( redistFilePath ) == false )
136136 {
137- fileInfo . CopyTo ( redistFilePath , true ) ;
137+ continue ;
138138 }
139+
140+ fileInfo . CopyTo ( redistFilePath , true ) ;
139141 }
140142 }
141143 }
@@ -152,7 +154,7 @@ private static string GetUnturnedDataDirectoryName(string unturnedPath)
152154 {
153155 return usual ;
154156 }
155- throw new DirectoryNotFoundException ( "Unturned Data directory cannot be found! " ) ;
157+ throw new DirectoryNotFoundException ( $ "Unturned Data directory cannot be found in { unturnedPath } ") ;
156158 }
157159 private static async Task < ( string version , string buildId ) > GetInfo ( string unturnedPath , string steamappsPath , string appId )
158160 {
0 commit comments