mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-10-16 16:04:32 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
60887a4312 | ||
|
a368268038 | ||
|
8beded7b41 | ||
|
91060dcd54 |
@@ -176,7 +176,10 @@ internal class DownloadTask private constructor(val metadata: IndexFile.File, de
|
||||
}
|
||||
|
||||
if (fileSource.hashIsEqual(hash)) {
|
||||
Files.createDirectories(destPath.parent)
|
||||
// isDirectory follows symlinks, but createDirectories doesn't
|
||||
if (!Files.isDirectory(destPath.parent)) {
|
||||
Files.createDirectories(destPath.parent)
|
||||
}
|
||||
Files.copy(data.inputStream(), destPath, StandardCopyOption.REPLACE_EXISTING)
|
||||
data.clear()
|
||||
} else {
|
||||
|
@@ -255,8 +255,7 @@ class UpdateManager internal constructor(private val opts: Options, val ui: IUse
|
||||
return
|
||||
}
|
||||
if (!indexFileSource.hashIsEqual(indexHash)) {
|
||||
// TODO: throw exception
|
||||
println("I was meant to put an error message here but I'll do that later")
|
||||
ui.handleExceptionAndExit(RuntimeException("Your index hash is invalid! Please run packwiz refresh on the pack again"))
|
||||
return
|
||||
}
|
||||
if (stateHandler.cancelButton) {
|
||||
|
@@ -180,9 +180,16 @@ class InstallWindow : IUserInterface {
|
||||
override fun showOptions(options: List<IOptionDetails>): Future<Boolean> {
|
||||
val future = CompletableFuture<Boolean>()
|
||||
EventQueue.invokeLater {
|
||||
OptionsSelectWindow(options, future, frmPackwizlauncher).apply {
|
||||
defaultCloseOperation = JDialog.DISPOSE_ON_CLOSE
|
||||
isVisible = true
|
||||
if (options.isEmpty()) {
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"This modpack has no optional mods!",
|
||||
"Optional mods", JOptionPane.INFORMATION_MESSAGE)
|
||||
future.complete(false)
|
||||
} else {
|
||||
OptionsSelectWindow(options, future, frmPackwizlauncher).apply {
|
||||
defaultCloseOperation = JDialog.DISPOSE_ON_CLOSE
|
||||
isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
return future
|
||||
@@ -201,7 +208,7 @@ class InstallWindow : IUserInterface {
|
||||
|
||||
override fun disableOptionsButton() {
|
||||
btnOptions.apply {
|
||||
text = "Optional mods..."
|
||||
text = "No optional mods"
|
||||
isEnabled = false
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user