aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.yml2
-rw-r--r--.github/workflows/backport.yml19
-rw-r--r--.github/workflows/pr-comment.yml61
-rw-r--r--README.md3
-rw-r--r--launcher/Application.cpp1
-rw-r--r--launcher/MMCZip.cpp2
-rw-r--r--launcher/launch/steps/CheckJava.cpp16
-rw-r--r--launcher/launch/steps/CheckJava.h2
-rw-r--r--launcher/ui/dialogs/AboutDialog.ui27
-rw-r--r--program_info/CMakeLists.txt3
-rw-r--r--program_info/win_install.nsi.in14
11 files changed, 56 insertions, 94 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index b387f46a..bac73932 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -27,7 +27,7 @@ body:
attributes:
label: Version of PolyMC
description: The version of PolyMC used in the bug report.
- placeholder: PolyMC 1.2.2
+ placeholder: PolyMC 1.3.2
validations:
required: true
- type: textarea
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml
deleted file mode 100644
index fa287a2c..00000000
--- a/.github/workflows/backport.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-name: Backport PR to stable
-on:
- pull_request:
- branches: [ develop ]
- types: [ closed ]
-jobs:
- release_pull_request:
- if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'backport')
- runs-on: ubuntu-latest
- steps:
- - name: checkout
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - name: Backport PR by cherry-pick-ing
- uses: Nathanmalnoury/gh-backport-action@master
- with:
- pr_branch: 'stable'
- github_token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml
deleted file mode 100644
index f0f5b8cc..00000000
--- a/.github/workflows/pr-comment.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-name: Comment on pull request
-on:
- workflow_run:
- workflows: ['Build Application']
- types: [completed]
-jobs:
- pr_comment:
- if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/github-script@v5
- with:
- # This snippet is public-domain, taken from
- # https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
- script: |
- async function upsertComment(owner, repo, issue_number, purpose, body) {
- const {data: comments} = await github.rest.issues.listComments(
- {owner, repo, issue_number});
-
- const marker = `<!-- bot: ${purpose} -->`;
- body = marker + "\n" + body;
-
- const existing = comments.filter((c) => c.body.includes(marker));
- if (existing.length > 0) {
- const last = existing[existing.length - 1];
- core.info(`Updating comment ${last.id}`);
- await github.rest.issues.updateComment({
- owner, repo,
- body,
- comment_id: last.id,
- });
- } else {
- core.info(`Creating a comment in issue / PR #${issue_number}`);
- await github.rest.issues.createComment({issue_number, body, owner, repo});
- }
- }
-
- const {owner, repo} = context.repo;
- const run_id = ${{github.event.workflow_run.id}};
-
- const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }};
- if (!pull_requests.length) {
- return core.error("This workflow doesn't match any pull requests!");
- }
-
- const artifacts = await github.paginate(
- github.rest.actions.listWorkflowRunArtifacts, {owner, repo, run_id});
- if (!artifacts.length) {
- return core.error(`No artifacts found`);
- }
- let body = `Download the artifacts for this pull request:\n`;
- for (const art of artifacts) {
- body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
- }
-
- core.info("Review thread message body:", body);
-
- for (const pr of pull_requests) {
- await upsertComment(owner, repo, pr.number,
- "nightly-link", body);
- }
diff --git a/README.md b/README.md
index 1e4e5caf..e1f04b81 100644
--- a/README.md
+++ b/README.md
@@ -80,8 +80,7 @@ To modify download information or change packaging information send a pull reque
## Forking/Redistributing/Custom builds policy
-We don't care what you do with your fork/custom build as long as you do the following as a basic courtesy:
-- Follow the terms of the [license](LICENSE) (not just a courtesy, but also a legal responsibility)
+We don't care what you do with your fork/custom build as long as you follow the terms of the [license](LICENSE) (this is a legal responsibility), and if you made code changes rather than just packaging a custom build, please do the following as a basic courtesy:
- Make it clear that your fork is not PolyMC and is not endorsed by or affiliated with the PolyMC project (https://polymc.org).
- Go through [CMakeLists.txt](CMakeLists.txt) and change PolyMC's API keys to your own or set them to empty strings (`""`) to disable them (this way the program will still compile but the functionality requiring those keys will be disabled).
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index ab3110a3..85b0d788 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -626,6 +626,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_settings->registerSetting("JavaPath", "");
m_settings->registerSetting("JavaTimestamp", 0);
m_settings->registerSetting("JavaArchitecture", "");
+ m_settings->registerSetting("JavaRealArchitecture", "");
m_settings->registerSetting("JavaVersion", "");
m_settings->registerSetting("JavaVendor", "");
m_settings->registerSetting("LastHostname", "");
diff --git a/launcher/MMCZip.cpp b/launcher/MMCZip.cpp
index 627ceaf1..d7ad4428 100644
--- a/launcher/MMCZip.cpp
+++ b/launcher/MMCZip.cpp
@@ -305,7 +305,7 @@ nonstd::optional<QStringList> MMCZip::extractSubDir(QuaZip *zip, const QString &
QString path;
if(name.contains('/') && !name.endsWith('/')){
path = name.section('/', 0, -2) + "/";
- FS::ensureFolderPathExists(path);
+ FS::ensureFolderPathExists(FS::PathCombine(target, path));
name = name.split('/').last();
}
diff --git a/launcher/launch/steps/CheckJava.cpp b/launcher/launch/steps/CheckJava.cpp
index 3226fae7..ef5db2c9 100644
--- a/launcher/launch/steps/CheckJava.cpp
+++ b/launcher/launch/steps/CheckJava.cpp
@@ -75,11 +75,14 @@ void CheckJava::executeTask()
qlonglong javaUnixTime = javaInfo.lastModified().toMSecsSinceEpoch();
auto storedUnixTime = settings->get("JavaTimestamp").toLongLong();
auto storedArchitecture = settings->get("JavaArchitecture").toString();
+ auto storedRealArchitecture = settings->get("JavaRealArchitecture").toString();
auto storedVersion = settings->get("JavaVersion").toString();
auto storedVendor = settings->get("JavaVendor").toString();
m_javaUnixTime = javaUnixTime;
// if timestamps are not the same, or something is missing, check!
- if (javaUnixTime != storedUnixTime || storedVersion.size() == 0 || storedArchitecture.size() == 0 || storedVendor.size() == 0)
+ if (javaUnixTime != storedUnixTime || storedVersion.size() == 0
+ || storedArchitecture.size() == 0 || storedRealArchitecture.size() == 0
+ || storedVendor.size() == 0)
{
m_JavaChecker = new JavaChecker();
emit logLine(QString("Checking Java version..."), MessageLevel::Launcher);
@@ -92,8 +95,9 @@ void CheckJava::executeTask()
{
auto verString = instance->settings()->get("JavaVersion").toString();
auto archString = instance->settings()->get("JavaArchitecture").toString();
+ auto realArchString = settings->get("JavaRealArchitecture").toString();
auto vendorString = instance->settings()->get("JavaVendor").toString();
- printJavaInfo(verString, archString, vendorString);
+ printJavaInfo(verString, archString, realArchString, vendorString);
}
emitSucceeded();
}
@@ -124,10 +128,11 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
case JavaCheckResult::Validity::Valid:
{
auto instance = m_parent->instance();
- printJavaInfo(result.javaVersion.toString(), result.realPlatform, result.javaVendor);
+ printJavaInfo(result.javaVersion.toString(), result.mojangPlatform, result.realPlatform, result.javaVendor);
printSystemInfo(true, result.is_64bit);
instance->settings()->set("JavaVersion", result.javaVersion.toString());
instance->settings()->set("JavaArchitecture", result.mojangPlatform);
+ instance->settings()->set("JavaRealArchitecture", result.realPlatform);
instance->settings()->set("JavaVendor", result.javaVendor);
instance->settings()->set("JavaTimestamp", m_javaUnixTime);
emitSucceeded();
@@ -136,9 +141,10 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
}
}
-void CheckJava::printJavaInfo(const QString& version, const QString& architecture, const QString & vendor)
+void CheckJava::printJavaInfo(const QString& version, const QString& architecture, const QString& realArchitecture, const QString & vendor)
{
- emit logLine(QString("Java is version %1, using %2 architecture, from %3.\n\n").arg(version, architecture, vendor), MessageLevel::Launcher);
+ emit logLine(QString("Java is version %1, using %2 (%3) architecture, from %4.\n\n")
+ .arg(version, architecture, realArchitecture, vendor), MessageLevel::Launcher);
}
void CheckJava::printSystemInfo(bool javaIsKnown, bool javaIs64bit)
diff --git a/launcher/launch/steps/CheckJava.h b/launcher/launch/steps/CheckJava.h
index 68cd618b..d084b132 100644
--- a/launcher/launch/steps/CheckJava.h
+++ b/launcher/launch/steps/CheckJava.h
@@ -35,7 +35,7 @@ private slots:
void checkJavaFinished(JavaCheckResult result);
private:
- void printJavaInfo(const QString & version, const QString & architecture, const QString & vendor);
+ void printJavaInfo(const QString & version, const QString & architecture, const QString & realArchitecture, const QString & vendor);
void printSystemInfo(bool javaIsKnown, bool javaIs64bit);
private:
diff --git a/launcher/ui/dialogs/AboutDialog.ui b/launcher/ui/dialogs/AboutDialog.ui
index 70c5009d..6323992b 100644
--- a/launcher/ui/dialogs/AboutDialog.ui
+++ b/launcher/ui/dialogs/AboutDialog.ui
@@ -89,9 +89,15 @@
</item>
<item>
<widget class="QLabel" name="versionLabel">
+ <property name="cursor">
+ <cursorShape>IBeamCursor</cursorShape>
+ </property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
+ <property name="textInteractionFlags">
+ <set>Qt::TextSelectableByMouse</set>
+ </property>
</widget>
</item>
<item>
@@ -133,6 +139,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
+ <property name="textInteractionFlags">
+ <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
+ </property>
</widget>
</item>
<item>
@@ -160,32 +169,50 @@
</item>
<item>
<widget class="QLabel" name="platformLabel">
+ <property name="cursor">
+ <cursorShape>IBeamCursor</cursorShape>
+ </property>
<property name="text">
<string>Platform:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
+ <property name="textInteractionFlags">
+ <set>Qt::TextSelectableByMouse</set>
+ </property>
</widget>
</item>
<item>
<widget class="QLabel" name="buildNumLabel">
+ <property name="cursor">
+ <cursorShape>IBeamCursor</cursorShape>
+ </property>
<property name="text">
<string>Build Number:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
+ <property name="textInteractionFlags">
+ <set>Qt::TextSelectableByMouse</set>
+ </property>
</widget>
</item>
<item>
<widget class="QLabel" name="channelLabel">
+ <property name="cursor">
+ <cursorShape>IBeamCursor</cursorShape>
+ </property>
<property name="text">
<string>Channel:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
+ <property name="textInteractionFlags">
+ <set>Qt::TextSelectableByMouse</set>
+ </property>
</widget>
</item>
<item>
diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt
index 1000be23..8d835322 100644
--- a/program_info/CMakeLists.txt
+++ b/program_info/CMakeLists.txt
@@ -1,6 +1,7 @@
set(Launcher_CommonName "PolyMC")
-set(Launcher_Copyright "PolyMC Contributors\\n© 2012-2021 MultiMC Contributors" PARENT_SCOPE)
+set(Launcher_Copyright "PolyMC Contributors\\n© 2012-2021 MultiMC Contributors")
+set(Launcher_Copyright "${Launcher_Copyright}" PARENT_SCOPE)
set(Launcher_Domain "polymc.org" PARENT_SCOPE)
set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE)
set(Launcher_DisplayName "${Launcher_CommonName}" PARENT_SCOPE)
diff --git a/program_info/win_install.nsi.in b/program_info/win_install.nsi.in
index e5687de7..987798b6 100644
--- a/program_info/win_install.nsi.in
+++ b/program_info/win_install.nsi.in
@@ -104,7 +104,11 @@ OutFile "../@Launcher_CommonName@-Setup.exe"
; Version info
VIProductVersion "@Launcher_RELEASE_VERSION_NAME4@"
VIFileVersion "@Launcher_RELEASE_VERSION_NAME4@"
-VIAddVersionKey "FileVersion" "@Launcher_RELEASE_VERSION_NAME4@"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "@Launcher_CommonName@"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "@Launcher_CommonName@ Installer"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "@Launcher_Copyright@"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "@Launcher_RELEASE_VERSION_NAME4@"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "@Launcher_RELEASE_VERSION_NAME4@"
;--------------------------------
@@ -140,7 +144,10 @@ Section "@Launcher_CommonName@"
WriteRegStr HKCU "${UNINST_KEY}" "QuietUninstallString" '"$INSTDIR\uninstall.exe" /S'
WriteRegStr HKCU "${UNINST_KEY}" "InstallLocation" "$INSTDIR"
WriteRegStr HKCU "${UNINST_KEY}" "Publisher" "@Launcher_CommonName@ Contributors"
- WriteRegStr HKCU "${UNINST_KEY}" "ProductVersion" "@Launcher_RELEASE_VERSION_NAME4@"
+ WriteRegStr HKCU "${UNINST_KEY}" "Version" "@Launcher_RELEASE_VERSION_NAME4@"
+ WriteRegStr HKCU "${UNINST_KEY}" "DisplayVersion" "@Launcher_RELEASE_VERSION_NAME@"
+ WriteRegStr HKCU "${UNINST_KEY}" "VersionMajor" "@Launcher_VERSION_MAJOR@"
+ WriteRegStr HKCU "${UNINST_KEY}" "VersionMinor" "@Launcher_VERSION_MINOR@"
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
IntFmt $0 "0x%08X" $0
WriteRegDWORD HKCU "${UNINST_KEY}" "EstimatedSize" "$0"
@@ -157,7 +164,7 @@ Section "Start Menu Shortcut" SM_SHORTCUTS
SectionEnd
-Section "Desktop Shortcut" DESKTOP_SHORTCUTS
+Section /o "Desktop Shortcut" DESKTOP_SHORTCUTS
CreateShortcut "$DESKTOP\@Launcher_CommonName@.lnk" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" "" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" 0
@@ -245,6 +252,7 @@ Function .onInit
${GetParameters} $R0
${GetOptions} $R0 "/NoShortcuts" $R1
${IfNot} ${Errors}
+${OrIf} ${FileExists} "$InstDir\@Launcher_APP_BINARY_NAME@.exe"
!insertmacro UnselectSection ${SM_SHORTCUTS}
!insertmacro UnselectSection ${DESKTOP_SHORTCUTS}
${EndIf}