Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Packaged .exe does not Render #16

Closed
msolters opened this issue Oct 3, 2015 · 12 comments
Closed

Windows: Packaged .exe does not Render #16

msolters opened this issue Oct 3, 2015 · 12 comments
Labels

Comments

@msolters
Copy link

msolters commented Oct 3, 2015

Thanks again for all your help in cleaning up the packaging process. The new version with Electrify.app.package() is far more stable.

But the problem is, while the build and packaging process now works for me on Windows (10), the final .exe doesn't actually render anything. Although the packaging process throws no errors, the .exe doesn't render any application!

  • If I run meteor inside my app, then Electron successfully starts up along with the Meteor server.
  • If I run Electrify.app.package(), it successfully creates an executable inside /.dist.
  • But, when I run the .exe that is generated inside /.dist, I see inside the task manager that two Electron (32 bit) processes are spawned. For the leaderboard example, they take up 2.9MB and 13.7MB respectively. But, no window is ever created. No Electron app ever becomes visible. No icon appears in the task bar. Just those two processes, which must be killed using "End task."
@arboleya
Copy link
Owner

arboleya commented Oct 4, 2015

No problem @msolters, thanks for reporting.

I'll take a look at it later.

@prasadnpawar
Copy link

I am also having the same issue.
Error I can see when I enable developer tool
Uncaught TypeError: Cannot read property 'Electrify' of undefined
template.todos.js:2 Uncaught ReferenceError: Template is not defined
todos.js:1 Uncaught ReferenceError: Mongo is not defined
accounts-ui-unstyled.js:634 Uncaught ReferenceError: Spacebars is not defined

@arboleya
Copy link
Owner

arboleya commented Oct 5, 2015

Hello, I've confirmed the problem, looking for the cause tough.

@arboleya
Copy link
Owner

arboleya commented Oct 6, 2015

@prasadnpawar @msolters

Closing, fixed in 1.3.5. Please update, and let me know if it works.

In case the problem persists, please reopen.

@arboleya arboleya closed this as completed Oct 6, 2015
@prasadnpawar
Copy link

Errors are gone. Now it is working. Thanks Arboleya.
Now, I am curious to know about other stuff like how can I installed this on some other computer? where the Mongodb will be installed ? How can I see database collections? How can I update app without resetting mongodb database? Please point me to the correct direction if possible.

@arboleya
Copy link
Owner

arboleya commented Oct 7, 2015

Good questions, lets see one by one in detail.

Let me know if it's clear.

How can I install this on some other computer?

You should have in mind that the final app is an Electron App.

It will be a .app for OSX, and a folder with files for Windows/Linux.

You can then build installers, like .msi (win) .dmg (osx) .deb (linux) and
so on, by using tools that create these installers, i.e.:

https://github.com/LinusU/node-appdmg

Where the Mongodb will be installed?

MongoDB isn't installed, instead it's distributed in a standalone way, Electrify
starts/stops MongoDB during the app initialization / exits process. The same
happens with the local Meteor server.

The binaries of mongo and mongod lives inside the .electrify/bin folder.

However after packaging the app, everything inside .electrify folder is moved
to the internals folder of the Electron app, which is:

OSX: .dist/your-app-name/your-app-name.app/Contents/Resources/app
WIN: .dist\your-app-name\resources\app (linux is similar to this)

So you'll find the binaries inside Resources/app/bin folder inside the
packaged app.

The actual DBDIR used by Mongo to write its databases to disk will exist only
inside the packaged app - it'll created the first it runs and will exist inside
the Resources/app/db dir.

How can I see database collections?

Having the packaged app up'n'running means that MongoDB is up and accessible,
however you need to know in which port it's running to connect to.

Electrify assures MongoDB will use a currently free/unused port on the user's
machine, therefore the port in which it runs is not predefined. It'll
potentially change everytime the app is started.

To get this port, you can simply run the app from the Terminal and see its
output -- it is, you cannot just double-click the generated .app or .exe
files, because this way you won't see any output.

Osx terminal:

# just type the full path to the ELECTRON binary and press ENTER
.electrify/.dist/your-app-name/your-appname.app/Contents/MacOS/Electron

Windows CMD/Powershell etc:

# just type the full path to the .EXE file binary and press ENTER
.electrify/.dist/your-app-name/your-appname.exe

Watch out the logs, and you'll get the current MongoDB port. Mongo's output
will be something like

[initandlisten] waiting for connections on port 11235

With this, you can use tools such as RoboMongo to
access your database with a Graphical User Interface, or connect via Terminal
as well.

How can I update app without resetting mongodb database?

This leads to two differente cases:

1. Shipping new versions to users

Right now there's no way to preserve the database upon newer installs.

Surely it's not ideal and preserving database between app updates makes total
sense for next/future release.

2. Packaging app multiple times

It's important to know that your Meteor's mongo database is not copied to your
packaged app. The packaged app always starts with a blank database, that is
created during it's first initialization.

So you have to build a kind of seeding approach, that seeds the needed data on
the database in case it doens't exist yet.

if(!Posts.find().count()) {
  Posts.create({/* ... */});
}

But then if you package your app again, the .electrify\.dist folder is
completely removed and rebuilt, making your previous database go away. Much in
the same way it'll happen with newer version shipped to users.

@prasadnpawar
Copy link

Thanks for the prompt reply. But I have a one more question that if it is not possible to update the app without resetting mongon database then is it possible to take backup of db and after updating app (installing new version) restore it again? If yes the how?

@arboleya
Copy link
Owner

arboleya commented Oct 8, 2015

Yes, potentially. Just backup/restore the dbdir, it should work.

OSX: .dist/your-app-name/your-app-name.app/Contents/Resources/app/db
WIN: .dist\your-app-name\resources\app\db

@msolters
Copy link
Author

msolters commented Oct 8, 2015

Yes, I too can confirm that the Windows builds are now functioning properly.

@arboleya
Copy link
Owner

arboleya commented Oct 8, 2015

tks 👍

@yjose
Copy link

yjose commented Sep 11, 2016

@arboleya i have the same problem that the final .exe doesn't actually render anything.
-note that i update electrify to electrify-update-test

thank you to help me to resolve this problem

@ghost
Copy link

ghost commented Mar 12, 2017

thanks in advance..
i am using v2.1.4
@arboleya i have same problem as @msolters.
.exe dosn't render anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants