From a8430c79ebf491ba6bfbc19ae59fb4979c5f86bf Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 14 Apr 2021 11:25:40 +0200 Subject: [PATCH] allow manual configuration of hwi executable path --- src/main/java/com/sparrowwallet/sparrow/io/Hwi.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java index eecab4a5..9ec1f0a1 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java @@ -222,7 +222,9 @@ public class Hwi { private synchronized File getHwiExecutable(Command command) { File hwiExecutable = Config.get().getHwi(); if(hwiExecutable != null && hwiExecutable.exists()) { - if(command.isTestFirst() && (!hwiExecutable.getAbsolutePath().contains(VERSION_PREFIX) || !testHwi(hwiExecutable))) { + String tmpDir = System.getProperty("java.io.tmpdir"); + String hwiPath = hwiExecutable.getAbsolutePath(); + if(command.isTestFirst() && hwiPath.startsWith(tmpDir) && (!hwiPath.contains(VERSION_PREFIX) || !testHwi(hwiExecutable))) { if(Platform.getCurrent() == Platform.OSX) { deleteDirectory(hwiExecutable.getParentFile()); } else {