Skip to content

Commit a931f83

Browse files
committed
Mac: use updater as launcher
- Ensure ~/Applications exists before creating the link. - Put the Unvanquished icon in the app bundle, so that it will be shown when viewing the link in the Launchpad menu. - Have the link go to updater2.app instead of Unvanquished.app.
1 parent 38bbe9f commit a931f83

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

osx.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,19 @@ bool validateInstallPath(const QString&)
5050

5151
bool install()
5252
{
53+
QDir applications(QDir::homePath() + "/Applications");
54+
if (!applications.exists()) {
55+
if (!applications.mkpath(".")) {
56+
qDebug() << "can't create ~/Applications";
57+
return false;
58+
}
59+
}
5360
Settings settings;
54-
QFile::link(settings.installPath() + "/Unvanquished.app",
55-
QDir::homePath() + "/Applications/Unvanquished.app");
61+
if (!QFile::link(settings.installPath() + QDir::separator() + "updater.app",
62+
applications.absoluteFilePath("Unvanquished.app"))) {
63+
qDebug() << "failed to create Applications link";
64+
return false;
65+
}
5666
return true;
5767
}
5868

updater2.pro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ unix:LIBS += -lz "-L$$PWD/aria2/src/.libs" -laria2
4444

4545
win32:RC_FILE = updater.rc
4646

47+
# Plain Unvanquished icon, used for the app bundle and hence the Launchpad shortcut.
48+
# When the updater is running, the one with arrows is displayed as its icon.
49+
mac: ICON = resources/Unvanquished.icns
50+
4751
# Additional import path used to resolve QML modules in Qt Creator's code model
4852
QML_IMPORT_PATH += fluid/src/imports/controls/qmldir
4953

0 commit comments

Comments
 (0)