Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Deprecate direct download version (NSIS/DMG) on Mac & Windows #246

Merged
merged 2 commits into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/_layouts/translatium.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ <h1 class="title is-size-3-desktop is-size-4">Translate 100+ Languages Instantly
<p>Translate text in images instantly with our powerful OCR tool. And yes, that includes screenshots.</p>
</div>
<div class="column is-6">
<p class="title is-4 mb-1">Menu bar integration <span class="tag is-black">macOS only</span></p>
<p class="title is-4 mb-1">Menu bar integration</p>
<p>Stay right there in your menu bar, just a shortcut away. No browser switching. No interruptions.</p>
</div>
<div class="column is-6">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"electron-builder": "22.9.1",
"electron-notarize": "1.0.0",
"eslint": "6.8.0",
"eslint-config-airbnb": "18.2.0",
"eslint-config-airbnb": "18.2.1",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.21.5",
Expand Down
36 changes: 35 additions & 1 deletion public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ const {
Tray,
app,
clipboard,
dialog,
globalShortcut,
ipcMain,
nativeImage,
nativeTheme,
shell,
} = require('electron');
const fs = require('fs');
const settings = require('electron-settings');
Expand Down Expand Up @@ -277,7 +279,39 @@ if (!gotTheLock) {
const themeSource = getPreference('themeSource');
nativeTheme.themeSource = themeSource;

createWindowAsync();
createWindowAsync()
.then(() => {
// if (!app.isPackaged) return; // dev environment
// Mac
if (process.platform === 'darwin' && !process.mas) {
dialog.showMessageBox({
type: 'question',
buttons: ['Learn More...', 'OK'],
message: 'The direct download version of Translatium will no longer be updated. Please get the app from the Mac App Store instead.',
cancelId: 1,
})
.then(({ response }) => {
if (response === 0) {
shell.openExternal('https://translatiumapp.com/download/mac?utm_source=mac-dmg');
}
})
.catch(console.log); // eslint-disable-line no-console
// Windows
} else if (process.platform === 'win32' && !process.windowsStore) {
dialog.showMessageBox({
type: 'question',
buttons: ['Learn More...', 'OK'],
message: 'The direct download version of Translatium will no longer be updated. Please get the app from the Microsoft Store instead.',
cancelId: 1,
})
.then(({ response }) => {
if (response === 0) {
shell.openExternal('https://translatiumapp.com/download/windows?utm_source=windows-nsis');
}
})
.catch(console.log); // eslint-disable-line no-console
}
});
createMenu();
setContextMenu();

Expand Down
Loading