* Ask user if the app should be moved to the applications folder (macOS).
()
| 23 | * Ask user if the app should be moved to the applications folder (macOS). |
| 24 | */ |
| 25 | async function promptMoveToApplicationsFolder() { |
| 26 | if (!isMacOS()) { |
| 27 | return; |
| 28 | } |
| 29 | |
| 30 | if (isDevMode() || app.isInApplicationsFolder()) { |
| 31 | return; |
| 32 | } |
| 33 | |
| 34 | const { response } = await dialog.showMessageBox({ |
| 35 | type: 'question', |
| 36 | buttons: ['Move to Applications Folder', 'Do Not Move'], |
| 37 | defaultId: 0, |
| 38 | message: 'Move to Applications Folder?', |
| 39 | }); |
| 40 | |
| 41 | if (response === 0) { |
| 42 | app.moveToApplicationsFolder(); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Returns the absolute path to the first-run marker file in the user data directory. |
no test coverage detected