Skip to content

Commit 0ddbd2f

Browse files
committed
updater: Implement deb installer
1 parent 2bbdf33 commit 0ddbd2f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package bisq.updater.linux;
2+
3+
import java.nio.file.Path;
4+
5+
import java.util.List;
6+
7+
import lombok.extern.slf4j.Slf4j;
8+
9+
10+
11+
import bisq.updater.InstallationFailedException;
12+
import bisq.updater.linux.pkexec.PkExec;
13+
14+
@Slf4j
15+
public class DebInstaller {
16+
public static void install(Path debFile) {
17+
log.info("Installing {}", debFile);
18+
19+
var cmd = List.of("dpkg", "--install", debFile.toAbsolutePath().toString());
20+
Process dpkgProcess = PkExec.run(cmd);
21+
22+
int exitCode = dpkgProcess.exitValue();
23+
if (exitCode != 0) {
24+
throw new InstallationFailedException("Deb installation exited with " + exitCode);
25+
}
26+
27+
log.info("Installation finished.");
28+
}
29+
}

0 commit comments

Comments
 (0)