nylas / nylas-mail

:love_letter: An extensible desktop mail app built on the modern web. Forks welcome!
https://nylas.com/nylas-mail/
MIT License
24.81k stars 1.38k forks source link

Launch on system start doesn't work on Windows #3440

Open hmnd opened 7 years ago

hmnd commented 7 years ago

The Launch on system start checkbox in Preferences creates a shortcut to C:\Users\droiz\AppData\Local\nylas\Update.exe, which is now an incorrect path. As well, changing the path to C:\Users\droiz\AppData\Local\NylasMail\Update.exe and keeping the arguments that Nylas includes in the path causes the Get started page to open and a new profile of Nylas to be created, instead of just launching the existing instance of Nylas.

Are there any related issues?

N/A

What operating system are you using?

Windows 10 Build 16176

What version of Nylas Mail are you using?

2.0.16

Bug?

Do you have any third-party plugins installed? If so, which ones?

GitHub, Jiffy

Is the issue related to a specific email provider (Gmail, Exchange, etc.)?

N/A

Is the issue reproducible with a particular attachment, message, signature, etc?

N/A

lxalln commented 7 years ago

Interestingly, I don't see that option in Preferences at all. Also using version 2.0.16 on Windows 10 (although 14393) image

hmnd commented 7 years ago

@lxalln That's odd. Can you see anything between Use Nylas Mail as default mail client and Show icon in menu bar / system tray if you check Developer Tools?

lxalln commented 7 years ago

Html:

<section>
    <div class="item">
        <input type="checkbox" id="default-client" value="on">
        <label for="default-client">Use Nylas Mail as default mail client</label>
    </div>
    <!-- react-empty: 40489 -->
    <div class="item">
        <input type="checkbox" id="core.workspace.systemTray" value="on">
        <label for="core.workspace.systemTray">Show icon in menu bar / system tray</label>
    </div>
    ...
</section>

React is hiding the option, which leads me to:

Looks like SystemStartService is returning false from checkAvailability(), which appears to be checking for read access to _launcherPath() which is looking for a folder in %LOCALAPPDATA% called nylas. The folder in %LOCALAPPDATA% is actually called NylasMail, which would be why the option isn't showing for me.

I didn't install until 2.0.15, so perhaps you installed a previous version, and have the nylas folder, thus enabling the option, which creates the wrong shortcut.

I can confirm that running that Update.exe does not actually launch the app, just updates the SquirrelSetup.log file with a line that says 2017-04-20 18:02:52> Program: Starting Squirrel Updater: but doesn't actually do anything else.

lxalln commented 7 years ago

Looks like it should be calling the nylas.exe file that's in that same folder. Which does launch the app, and does check for updates whilst it does it.

lxalln commented 7 years ago

@davidbgeek Opened a PR (#3443) which should fix this.