mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Added another try-catch to the native lib version check in case rights settings get weird (reported on MCF).
This commit is contained in:
parent
da264e3aca
commit
ce4316e91d
@ -103,23 +103,29 @@ object LuaStateFactory {
|
||||
// If the file, already exists, make sure it's the same we need, if it's
|
||||
// not disable use of the natives.
|
||||
if (file.exists()) {
|
||||
val inCurrent = libraryUrl.openStream()
|
||||
val inExisting = new FileInputStream(file)
|
||||
var matching = true
|
||||
var inCurrentByte = 0
|
||||
var inExistingByte = 0
|
||||
do {
|
||||
inCurrentByte = inCurrent.read()
|
||||
inExistingByte = inExisting.read()
|
||||
if (inCurrentByte != inExistingByte) {
|
||||
matching = false
|
||||
inCurrentByte = -1
|
||||
inExistingByte = -1
|
||||
try {
|
||||
val inCurrent = libraryUrl.openStream()
|
||||
val inExisting = new FileInputStream(file)
|
||||
var matching = true
|
||||
var inCurrentByte = 0
|
||||
var inExistingByte = 0
|
||||
do {
|
||||
inCurrentByte = inCurrent.read()
|
||||
inExistingByte = inExisting.read()
|
||||
if (inCurrentByte != inExistingByte) {
|
||||
matching = false
|
||||
inCurrentByte = -1
|
||||
inExistingByte = -1
|
||||
}
|
||||
}
|
||||
while (inCurrentByte != -1 && inExistingByte != -1)
|
||||
inCurrent.close()
|
||||
inExisting.close()
|
||||
}
|
||||
catch {
|
||||
case _: Throwable =>
|
||||
matching = false
|
||||
}
|
||||
while (inCurrentByte != -1 && inExistingByte != -1)
|
||||
inCurrent.close()
|
||||
inExisting.close()
|
||||
if (!matching) {
|
||||
// Try to delete an old instance of the library, in case we have an update
|
||||
// and deleteOnExit fails (which it regularly does on Windows it seems).
|
||||
|
Loading…
x
Reference in New Issue
Block a user