Merge pull request #296 from Razzeee/update-fix-autolaunch
Make sure our auto launch link is up do date
This commit is contained in:
21
src/main.js
21
src/main.js
@@ -17,17 +17,28 @@ process.on('uncaughtException', (error) => {
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
var cmd = process.argv[1];
|
||||
var AutoLaunch = require('auto-launch');
|
||||
var appLauncher = new AutoLaunch({
|
||||
name: 'Mattermost',
|
||||
isHidden: true
|
||||
});
|
||||
if (cmd === '--squirrel-uninstall') {
|
||||
var AutoLaunch = require('auto-launch');
|
||||
var appLauncher = new AutoLaunch({
|
||||
name: 'Mattermost',
|
||||
isHidden: true
|
||||
});
|
||||
// If we're uninstalling, make sure we also delete our auto launch registry key
|
||||
appLauncher.isEnabled().then(function(enabled) {
|
||||
if (enabled)
|
||||
appLauncher.disable();
|
||||
});
|
||||
}
|
||||
else if (cmd === '--squirrel-install' || cmd === '--squirrel-updated') {
|
||||
// If we're updating and already have an registry entry for auto launch, make sure to update the path
|
||||
appLauncher.isEnabled().then(function(enabled) {
|
||||
if (enabled) {
|
||||
return appLauncher.disable().then(function() {
|
||||
return appLauncher.enable();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
app.setAppUserModelId('com.squirrel.mattermost.Mattermost'); // Use explicit AppUserModelID
|
||||
|
Reference in New Issue
Block a user