The swiss army knife of lossless video/audio editing
add app path to report
Mikael Finstad251106e3aaa8
diff --git a/src/renderer/src/reporting.tsx b/src/renderer/src/reporting.tsxindex 0e191e9b..f2b892b9 100644--- a/src/renderer/src/reporting.tsx+++ b/src/renderer/src/reporting.tsx@@ -2,7 +2,7 @@ import i18n from 'i18next';import { Trans } from 'react-i18next';import CopyClipboardButton from './components/CopyClipboardButton';-import { isStoreBuild, isMasBuild, isWindowsStoreBuild, isExecaError, appVersion } from './util';+import { isStoreBuild, isMasBuild, isWindowsStoreBuild, isExecaError, appVersion, appPath } from './util';import getSwal from './swal';const electron = window.require('electron');@@ -12,6 +12,7 @@ const remote = window.require('@electron/remote');const { platform, arch } = remote.require('./index.js');+// This cannot be a radix dialog, because it needs to be called even if the React tree is broken.// eslint-disable-next-line import/prefer-default-exportexport function openSendReportDialog({ err, message, state }: {err?: unknown | undefined,@@ -51,6 +52,7 @@ export function openSendReportDialog({ err, message, state }: {state,+ appPath,platform,arch,version: appVersion,diff --git a/src/renderer/src/util.ts b/src/renderer/src/util.tsindex 20654719..2a57fc9d 100644--- a/src/renderer/src/util.ts+++ b/src/renderer/src/util.ts@@ -23,8 +23,9 @@ const remote = window.require('@electron/remote');const { isWindows, isMac } = remote.require('./index.js');const appVersion = remote.app.getVersion();+const appPath = remote.app.getAppPath();-export { isWindows, isMac, appVersion };+export { isWindows, isMac, appVersion, appPath };const trashFile = async (path: string) => ipcRenderer.invoke('tryTrashItem', path);@@ -350,11 +351,11 @@ export async function checkAppPath() {const mf = 'mi' + 'fi.no', ap = 'Los' + 'slessC' + 'ut';let payload: string | undefined;if (isWindowsStoreBuild || (isDev && forceCheckMs)) {- const appPath = isDev ? 'C:\\Program Files\\WindowsApps\\37672NoveltyStudio.MediaConverter_9.0.6.0_x64__vjhnv588cyf84' : remote.app.getAppPath();- const pathMatch = appPath.replaceAll('\\', '/').match(/Windows ?Apps\/([^/]+)/); // find the first component after WindowsApps+ const appPathOrMock = isDev ? 'C:\\Program Files\\WindowsApps\\37672NoveltyStudio.MediaConverter_9.0.6.0_x64__vjhnv588cyf84' : appPath;+ const pathMatch = appPathOrMock.replaceAll('\\', '/').match(/Windows ?Apps\/([^/]+)/); // find the first component after WindowsApps// example pathMatch: 37672NoveltyStudio.MediaConverter_9.0.6.0_x64__vjhnv588cyf84if (!pathMatch) {- console.warn('Unknown path match', appPath);+ console.warn('Unknown path match', appPathOrMock);return;}const pathSeg = pathMatch[1];