Skip to content

Commit 512e1f4

Browse files
RizlimRizlim
authored andcommitted
1.12.2 - Fix License issues
1 parent ada9ab5 commit 512e1f4

File tree

11 files changed

+72
-52
lines changed

11 files changed

+72
-52
lines changed

.idea/dataSources.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.idea/kotlinc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PoE-Addon-Launcher-Core.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
4242
<excludeFolder url="file://$MODULE_DIR$/target" />
4343
</content>
44-
<orderEntry type="inheritedJdk" />
44+
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
4545
<orderEntry type="sourceFolder" forTests="false" />
4646
<orderEntry type="library" name="Maven: com.atlassian.commonmark:commonmark:0.12.1" level="project" />
4747
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.9" level="project" />

pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>RizlimDev</groupId>
88
<artifactId>PoE-Addon-Launcher-Core</artifactId>
9-
<version>1.11.4</version>
9+
<version>1.12</version>
1010

1111
<properties>
1212
<kotlin.version>1.3.0</kotlin.version>
@@ -25,6 +25,9 @@
2525
<addClasspath>true</addClasspath>
2626
<mainClass>Launcher2</mainClass>
2727
</manifest>
28+
<manifestEntries>
29+
<Class-Path>.</Class-Path>
30+
</manifestEntries>
2831
</archive>
2932
</configuration>
3033
</plugin>
@@ -33,8 +36,12 @@
3336
<configuration>
3437
<archive>
3538
<manifest>
39+
<addClasspath>true</addClasspath>
3640
<mainClass>Launcher2</mainClass>
3741
</manifest>
42+
<manifestEntries>
43+
<Class-Path>.</Class-Path>
44+
</manifestEntries>
3845
</archive>
3946
<descriptorRefs>
4047
<descriptorRef>jar-with-dependencies</descriptorRef>

src/main/kotlin/PAL2/Github/UpdateGrabber.kt

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,60 @@ import Github.connect
44
import SystemHandling.deleteFile
55
import SystemHandling.unzip
66
import SystemHandling.verifyFolder
7+
import mu.KotlinLogging
78
import org.apache.commons.io.FileUtils
89
import java.io.File
910
import java.net.URL
1011

12+
private val logger = KotlinLogging.logger {}
13+
1114
/**
1215
*
1316
*/
14-
fun getUpdate(install: String)
17+
fun checkUpdate()
18+
{
19+
if (!GlobalData.debugging)
20+
{
21+
val gh = connect()
22+
if (gh.rateLimit.remaining > 3)
23+
{
24+
val repo = gh.getRepository("")
25+
}
26+
}
27+
}
28+
29+
fun getUpdate()
1530
{
1631
// Get Token from DB if DB exists and if token is != ""
1732
if (!GlobalData.debugging)
1833
{
1934
val gh = connect()
20-
if (gh.rateLimit.remaining > 5)
35+
if (gh.rateLimit.remaining > 3)
2136
{
22-
val repo = gh.getRepository("POE-Addon-Launcher/PAL2")
37+
val repo = gh.getRepository("POE-Addon-Launcher/PALRelease")
2338
val latest = repo.latestRelease
2439
val latest_tag = latest.tagName
2540
if(latest_tag != GlobalData.version)
2641
{
2742
val down_folder = File("${GlobalData.pal_folder}")
28-
29-
val temp_update = File("$install${File.separator}latest")
30-
3143
verifyFolder(down_folder)
32-
verifyFolder(temp_update)
3344

34-
val dest = File("${down_folder.path}${File.separator}pal.zip")
45+
val dest = File("${GlobalData.install_dir}${File.separator}new${File.separator}PAL2.jar")
46+
val destFolder = File("${GlobalData.install_dir}${File.separator}new")
3547
if (dest.exists())
36-
{
3748
deleteFile(dest)
38-
}
49+
50+
if (!destFolder.exists())
51+
destFolder.mkdir()
3952

4053
val download_url = latest.assets[0].browserDownloadUrl
4154
FileUtils.copyURLToFile(URL(download_url), dest)
4255

43-
println("Unzipping: ${dest.path} in ${temp_update.path}")
44-
unzip(dest, temp_update)
56+
logger.debug { "Downloaded update [$latest_tag] to: $dest" }
4557

46-
val stateONE = File("${GlobalData.pal_folder.path}${File.separator}1.state")
47-
stateONE.createNewFile()
48-
// Launch the newest version instead.
49-
Runtime.getRuntime().exec("\"$temp_update${File.separator}PAL2.exe\"")
58+
//rundll32 url.dll,FileProtocolHandler
59+
println(">>> \"${GlobalData.install_dir}${File.separator}PAL2.exe\" <<")
60+
Runtime.getRuntime().exec("\"${GlobalData.install_dir}${File.separator}PAL2.exe\"")
5061

5162
System.exit(99)
5263
}

src/main/kotlin/PAL2/GlobalData.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class GlobalData
1010
{
1111
companion object
1212
{
13-
var version = "1.11.4"
13+
var version = "1.12.2"
1414
var debugging = false
1515
var install_dir = ""
1616
var github_token = ""

src/main/kotlin/PAL2/Launcher.kt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ class Launcher2
2222
// Set Locale to US to avoid any locale issues.
2323
Locale.setDefault(Locale.US)
2424

25+
if (!GlobalData.debugging)
26+
{
27+
var fInstall = File(Launcher2::class.java.protectionDomain.codeSource.location.toURI())
28+
29+
if (fInstall.isFile)
30+
{
31+
fInstall = fInstall.parentFile
32+
}
33+
GlobalData.install_dir = fInstall.path
34+
35+
36+
}
37+
38+
39+
/*
2540
if (!GlobalData.debugging)
2641
{
2742
var fInstall = File(Launcher2::class.java.protectionDomain.codeSource.location.toURI())
@@ -52,7 +67,7 @@ class Launcher2
5267
deleteFile(newest_update)
5368
deleteFile(stateTWO)
5469
}
55-
}
70+
}*/
5671

5772
try
5873
{

src/main/kotlin/PAL2/SystemHandling/Init.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import PAL2.Database.*
66
import PAL2.GUI.Configurator.ConfiguratorApplication
77
import PAL2.GUI.CoreApplication
88
import PAL2.GUI.Loader.Loader
9+
import PAL2.Github.checkUpdate
910
import PAL2.Github.getUpdate
1011
import PAL_DataClasses.PAL_AddonFullData
1112
import PAL_DataClasses.initObjectMapper
@@ -106,7 +107,10 @@ fun moreInit()
106107
}
107108

108109
loader("Checking for Updates to PAL", 0.5)
109-
getUpdate(GlobalData.install_dir)
110+
//getUpdate(GlobalData.install_dir)
111+
112+
getUpdate()
113+
110114
loader("No updates to PAL!", 0.6)
111115

112116

src/main/resources/update_notes.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@
6060

6161
</style>
6262
<body>
63+
<div class="block_1 hline-bottom"><h1>Version 1.12</h1></div>
64+
<ul>
65+
<li>No longer uses Excelsior JET!</li>
66+
<li>License issue won't happen anymore.</li>
67+
<li>Readme's now use Markdown.md from their github repos.</li>
68+
</ul>
69+
6370
<div class="block_1 hline-bottom"><h1>Version 1.11</h1></div>
6471
<ul>
6572
<li>Fix some bugs with Externals</li>

0 commit comments

Comments
 (0)