Closed msolters closed 9 years ago
No problem @msolters, thanks for reporting.
I'll take a look at it later.
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
Hello, I've confirmed the problem, looking for the cause tough.
@prasadnpawar @msolters
Closing, fixed in 1.3.5
. Please update, and let me know if it works.
In case the problem persists, please reopen.
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.
Good questions, lets see one by one in detail.
Let me know if it's clear.
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
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.
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.
This leads to two differente cases:
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.
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.
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?
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
Yes, I too can confirm that the Windows builds are now functioning properly.
tks :+1:
@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
thanks in advance.. i am using v2.1.4 @arboleya i have same problem as @msolters. .exe dosn't render anything.
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!
meteor
inside my app, then Electron successfully starts up along with the Meteor server.Electrify.app.package()
, it successfully creates an executable inside/.dist
./.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."