fix launcher desktop registration and google login flow
This commit is contained in:
+11
-6
@@ -97,14 +97,19 @@ function registerLinuxProtocolHandler(): void {
|
|||||||
if (process.platform !== 'linux') return
|
if (process.platform !== 'linux') return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const desktopFileName = is.dev
|
|
||||||
? 'autonomy-studio-launcher-dev.desktop'
|
|
||||||
: 'autonomy-studio-launcher.desktop'
|
|
||||||
const applicationsDir = join(app.getPath('home'), '.local', 'share', 'applications')
|
const applicationsDir = join(app.getPath('home'), '.local', 'share', 'applications')
|
||||||
|
const installedDesktopFilePath = join(applicationsDir, 'autonomy-studio-launcher.desktop')
|
||||||
|
|
||||||
|
if (!is.dev) {
|
||||||
|
rmSync(installedDesktopFilePath, { force: true })
|
||||||
|
execFile('xdg-mime', ['default', 'autonomy-studio-launcher.desktop', 'x-scheme-handler/autonomy-studio'], () => undefined)
|
||||||
|
execFile('update-desktop-database', [applicationsDir], () => undefined)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const desktopFileName = 'autonomy-studio-launcher-dev.desktop'
|
||||||
const desktopFilePath = join(applicationsDir, desktopFileName)
|
const desktopFilePath = join(applicationsDir, desktopFileName)
|
||||||
const iconPath = is.dev
|
const iconPath = join(process.cwd(), 'resources/icon.png')
|
||||||
? join(process.cwd(), 'resources/icon.png')
|
|
||||||
: join(dirname(process.execPath), 'resources/icon.png')
|
|
||||||
const execArgs = process.defaultApp && process.argv[1]
|
const execArgs = process.defaultApp && process.argv[1]
|
||||||
? `"${escapeDesktopExecValue(process.execPath)}" "${escapeDesktopExecValue(resolve(process.argv[1]))}" %u`
|
? `"${escapeDesktopExecValue(process.execPath)}" "${escapeDesktopExecValue(resolve(process.argv[1]))}" %u`
|
||||||
: `"${escapeDesktopExecValue(process.execPath)}" %u`
|
: `"${escapeDesktopExecValue(process.execPath)}" %u`
|
||||||
|
|||||||
Reference in New Issue
Block a user