Fixed 'access denied' error when dats are set to be read-only

This commit is contained in:
Vhati 2017-11-25 19:50:31 -05:00
parent f6d6bab6af
commit eacd79b3cc

View file

@ -114,6 +114,11 @@ public class ModPatchThread extends Thread {
int modsInstalled = 0; int modsInstalled = 0;
int datsRepacked = 0; int datsRepacked = 0;
// Don't let dats be read-only.
for ( BackedUpDat dat : allDats ) {
if ( dat.datFile.exists() ) dat.datFile.setWritable( true );
}
// Create backup dats, if necessary. // Create backup dats, if necessary.
for ( BackedUpDat dat : allDats ) { for ( BackedUpDat dat : allDats ) {
if ( !dat.bakFile.exists() ) { if ( !dat.bakFile.exists() ) {