mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Get True Home Path from possible symbolic link (Important for Atomic Distros like Fedora Silverblue) (#1085)
This commit is contained in:
@@ -284,6 +284,8 @@ async function installVRCXappImageLauncher() {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
async function installVRCX() {
|
async function installVRCX() {
|
||||||
|
let homePath = getHomePath();
|
||||||
|
console.log('True Home path:', homePath);
|
||||||
console.log('AppImage path:', appImagePath);
|
console.log('AppImage path:', appImagePath);
|
||||||
if (!appImagePath) {
|
if (!appImagePath) {
|
||||||
console.error('AppImage path is not available!');
|
console.error('AppImage path is not available!');
|
||||||
@@ -300,9 +302,9 @@ async function installVRCX() {
|
|||||||
appImageLauncherInstalled = true;
|
appImageLauncherInstalled = true;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (
|
if (
|
||||||
appImagePath.startsWith(path.join(app.getPath('home'), 'Applications'))
|
appImagePath.startsWith(path.join(homePath, 'Applications'))
|
||||||
) {
|
) {
|
||||||
/*
|
/*
|
||||||
if (appImageLauncherInstalled) {
|
if (appImageLauncherInstalled) {
|
||||||
@@ -331,7 +333,7 @@ async function installVRCX() {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
process.env.APPIMAGE.startsWith(
|
process.env.APPIMAGE.startsWith(
|
||||||
path.join(app.getPath('home'), 'Applications')
|
path.join(homePath, 'Applications')
|
||||||
) &&
|
) &&
|
||||||
path.basename(process.env.APPIMAGE) === 'VRCX.AppImage'
|
path.basename(process.env.APPIMAGE) === 'VRCX.AppImage'
|
||||||
) {
|
) {
|
||||||
@@ -340,7 +342,7 @@ async function installVRCX() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetPath = path.join(app.getPath('home'), 'Applications');
|
const targetPath = path.join(homePath, 'Applications');
|
||||||
console.log('Target Path:', targetPath);
|
console.log('Target Path:', targetPath);
|
||||||
|
|
||||||
// Create target directory if it doesn't exist
|
// Create target directory if it doesn't exist
|
||||||
@@ -368,7 +370,7 @@ async function installVRCX() {
|
|||||||
const iconUrl =
|
const iconUrl =
|
||||||
'https://raw.githubusercontent.com/vrcx-team/VRCX/master/VRCX.png';
|
'https://raw.githubusercontent.com/vrcx-team/VRCX/master/VRCX.png';
|
||||||
const iconPath = path.join(
|
const iconPath = path.join(
|
||||||
app.getPath('home'),
|
homePath,
|
||||||
'.local/share/icons/VRCX.png'
|
'.local/share/icons/VRCX.png'
|
||||||
);
|
);
|
||||||
await downloadIcon(iconUrl, iconPath)
|
await downloadIcon(iconUrl, iconPath)
|
||||||
@@ -386,7 +388,7 @@ StartupWMClass=VRCX
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const desktopFilePath = path.join(
|
const desktopFilePath = path.join(
|
||||||
app.getPath('home'),
|
homePath,
|
||||||
'.local/share/applications/VRCX.desktop'
|
'.local/share/applications/VRCX.desktop'
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
@@ -445,6 +447,20 @@ function getVRCXPath() {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getHomePath() {
|
||||||
|
let relativeHomePath = path.join(app.getPath('home'));
|
||||||
|
// console.log('Relative Home Path: ' + relativeHomePath);
|
||||||
|
try {
|
||||||
|
let absoluteHomePath = fs.realpathSync(relativeHomePath);
|
||||||
|
// console.log('readlink output: ' + absoluteHomePath);
|
||||||
|
return absoluteHomePath;
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
return relativeHomePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function getVersion() {
|
function getVersion() {
|
||||||
let version = 'VRCX (Linux) Build';
|
let version = 'VRCX (Linux) Build';
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user