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