Current state of Electron / meteor-desktop

There’s a lot of discussion here about whether meteor-dekstop should have first party support, or if PWA has eliminated that. But putting that aside, the fact is that right now I need to bundle with Electron because I have a client who needs an app to have local filesystem access. So unless there’s another way of reading/writing to local files, I’m asking for help in the quickest way of getting Electron working…

That thread also includes people who’ve done it, but say that it’s difficult. Are any of you wiling to share a quick bullet list of what to do? I’d like to build in linux, or possibly windows. Not mac. Deployment target it windows. @larry, @efrancis, @linegel, @ajaay? Is hot-code-push possible?

Thanks for your help - I’m sure others would benefit from an up-to-date set of instructions also!

2 Likes

To follow up on this, I went ahead and followed the instructions and it all just worked! Including HCP.

Now I have a single code-base giving me web, android, iOS and multi-platform desktop!

My client is very happy with the new possibilities this opens up, so I have a lot of work to do adding new features.

7 Likes

Awesome @wildhart! Would you want to write about this at all? The Meteor Community has recently been approved for a free open source GitBook account where we are starting to create community driven GitBooks that can have a longer life & easier maintenance cycle than some other formats that have been used in the community before.

I know I got pretty excited about PWAs on the other thread for desktop & mobile, but I really believe we need Meteor to have a solid supported path to Electron and other options too.

If you haven’t used a GitBook before, it’s the fastest & easiest way to create really great looking docs, guides, books, etc. and keep it in sync with a GitHub repo of your own. I’ve now tested this out and started to create some really simple guidelines for the community that will work really well!

Check out the starter GitBook Guide here: https://meteorjs.gitbook.io/meteor-open-source-gitbooks-guide/

You could have your own GitBook that is free forever to write things that might help the community and also probably write about some of your packages :package: you’ve made because they look really nice!

I’ve seen you share enough knowledge here on the forum to put you in the firm Expert class, so it would be my joy to make it easier for you to share & maintain amazing stuff.

The goal is to give people spaces to write solid, maintainable docs, & guide that might even one day be able to be handed off to the community if in the long run theoriginall creators get to busy to maintain them.

I’ll send you an invite on the Meteor Slack :sunglasses:

2 Likes

Hi @mullojo, thanks for your kind words.

Much as I would love to help document what I’ve done (I have done previously [1 2 3] when I though it was something novel and not just following someone else’s instructions), in this case the meteor-desktop instructions were pretty much all I needed, plus a bit of trouble-shooting skill.

Also, unfortunately I don’t have any spare time at the moment - with a full time dev job, my own product plus a couple of private contracts, not to mention a family, I really don’t have enough spare time as it is! Sorry!

1 Like

Thanks for thinking about it @wildhart … We’ll be getting more & more of these books & guides into the community so feel free to add any inputs / comments along the way. Initially I think it’s good to have come individuals lead GitBook creation, but eventually I think it will be a lot of fun for contributors to add pages (sub-topics) here & there too :grinning:

1 Like

That’s great to hear you’ve got it working because we’re having huge problems and it doesn’t work at all. Not only our customer but also me is on an old version but no matter what we try, HCP seems to not working and the documentation isn’t helping much.

We have seen errors on hash mismatch and also when we add new assets they cannot be found.

Examples:

[autoupdate] Download failure: Skipping downloading new version because the .desktop compatibility version have changed and is potentially incompatible (89a6788ba698360debc19e0cb84ddfb6 != 7dcbe810ebf17b8df9c4133d0ce91b7b)

[autoupdate] Download failure: failed at verifyResponse: non-success status code 404 for asset: daa405ad589d3e6a46f5c88b469d7843c3ebddc8.stats.json

[autoupdate] Download failure: skipping downloading blacklisted version: 0c059eac3a2c3516003fb8f7ecf56294ee5dfe4a

Any help is appreciated, thanks!

Yeah, I found that the HCP compatibility version was too sensitive for some reason. The hash would change with each build even if the plugin versions don’t change.

For that reason I ignore the compatibility check with:

 // .desktop/settings.json
    "desktopHCP": true,
    "desktopHCPIgnoreCompatibilityVersion": true,

This gets HCP working every time, but could mean I could get incompatibilities when I add new packages which desktop uses.

When I do add a new package I test for it at start up and if it doesn’t exist I send a message to the user and inform the user that they need to download the new version:

// .desktop/desktop.js
desktop.on('checkModules', (e, fetchId) => {
    const failed = [];

    try {
        const sendkeys = require('sendkeys');
        ...  // Setup sendKey handlers.
    } catch(e) {
        failed.push('sendkeys');
    }
    
    try {
        const PizZip = require('pizzip');
        ... // setup PizZip
    } catch(e) {
        failed.push('pizzip'); 
    }

    ...

    return desktop.respond('checkModules', fetchId, {failed});
});

Note that after disabling the incompatibility check you and your users will still have to manually install the version with the check disabled. After that HCP should work.

3 Likes

Could you explain this a little further? I don’t really understand how HCP works fully and I’ve run into this issue right now after updating to Meteor 2.0 since it’s considered an incompatible version. Tbh I don’t fully understand the role of HCP within an Electron application since we use electron-builder and electron-updater to get auto-updating working for our app.

If I set "desktopHCPIgnoreCompatibilityVersion": true, will the app still get updates to both application code and npm dependencies, or are you saying that it will never get updates to npm dependencies used by the Electron app after enabling desktopHCPIgnoreCompatibilityVersion if I change their versions in .desktop/settings.json?

@wildhart can you give me an instructions, how to do it? :smiley: I spend a days on it, and the result was:

  • android, somehow builded with old Cordova but It was not able to publish to Google Play,
  • ios not works
  • desktop not works.

@klaucode unfortunately it’s been a long time since I’ve done this, plus I’m stuck on an older version of Meteor so things have probably changed. At some point I might get the time to update my stack and then I’ll see if Electron is holding me back… So I’m not really in a position to give step by step instructions or help troubleshoot issues at the moment, sorry.

@wildhart …understand, but It’s great, that you managed to get it up and running. In my case nothing works :frowning:

I had problems on almost every deploy, especially with the MacOS versions that was asking to go to MacUpdate URL and also errors in the log files of “unable to write to local file” bla bla.

Yesterday again, even worse both Windows and MacOS didn’t work until I decided to turn DesktopHCP off. Guess what? All is running smooth, no problems with the build, no strange error messages.

I fully agree with this, hence I turned it off. It was never really working for me anyways. Two less packages as well:

communitypackages:meteor-desktop-watcher@=3.0.1
communitypackages:meteor-desktop-bundler@=3.0.1

So overall a win-win. Maybe you want to try this, @klaucode ?