Distributing Electron Application Across Platforms - electron

I developed an application on my Macbook and I followed the Application Distribution page instructions on the Electron website. So right now when I double click on my electron.app folder it runs my application perfectly. However, when I transfer that folder to my Windows machine, it just shows a folder. When I double click on the folder it just shows me its contents. How can the package be run on the Windows? I don't care about my code being exposed to others. I just want to be able to run it on Windows. Is the only way of doing so through making an exe file?

Electron has separate binary distributions for Windows, OS X, and Linux, as seen on its releases page. You will need to bundle your application's code under the resources folder in each distribution for each platform you want to release for.
electron-packager exists to make this process a lot less labor-intensive.

Related

Electron share dependencies within multiple electron.js applications

I am working of multiple electron applications and i am not using installer to install my electron application instead of installer i am using win-unpacked folder because i don't want to install application.
since win-unpacked folder hold all the required dependencies it doesn't required installation but i want to use same dependencies for my other electron applications (dependencies such as dll,resources etc) to reduce size of multiple builds.
when i try to put other exe to win-unpacked folder it shows ui of the same application because resources folder is same, i think there must be some way to change resources folder name or at leaset .asar name change while creating build will resolve issue.

Electron NSIS prevent reinstalling

Is there a way to have the NSIS built by Electron not re-install the app everytime it is clicked just like the MSI ? If the app is already installed I would like it to simply open it rather than re-installing.
I would use the MSI but when I open the app installed by it, it doesn't have read/write permissions from files inside the directory even if it is in Appdata (same folder as installation from NSIS). When installed from NSIS for some reason it gives read/write permissions to the app for files inside the installation directory.
Any help would be appreciated.
You need to edit your .nsi script file and do the check manually (skip the installation if an app is already installed) because there is no "switch" for that.
The issue with electron NSIS installers is that script is recreated every time (at least in the tutorials I saw) so you may lose any changes you made there.
In such case you cannot use the building pipeline, but you need to open the .nsi file with text editor, make the changes and compile everything with makensis.
Please post your script with more details.

Instructions for how to lay out the Mac OS X and Linux versions of Electron apps?

I've just spent a very long time looking through everything on https://electron.atom.io/docs/ but I cannot find any mention of how to put the files for Mac and Linux. Only Windows, which I already have set up.
I remember that NW.js had such instructions, which I followed in the past, but it's obviously too ridiculous to accept that I should have to look at a competitor's manual to figure out how to distribute Electron apps.
I remember that at both Linux and Mac had some very fancy/weird packaging need, very unlike Windows.
I would recommend looking into electron-builder which would help you with generating packages for all of the mentioned systems (with auto-update and other goodies).
You can also take a look at electron-boilerplate to see how it can be nicely implemented (this boilerplate has a release command that allows you to generate packages).
For the mac version you can use electron packager to generate a .app file then you can use appdmg to generate a .dmg
For the linux version you can use electron packager to generate a executable although it comes with lots of other files.
I've tried electron-installer-debian but I couldn't install the output .deb

I have to open windows fonts folder after install my application by installaware

I've built a installer by installaware for my application. I'm copying some fonts to windows fonts folder automatically during the installation. When I open the installed application, fonts doesn't displayed correctly until I open and close windows fonts folder or restart the computer. Is there any solution to enable me not need to open fonts folder or restart computer? something like refresh windows newly installed fonts.
I appreciate any suggestions.
The required procedure is described over at MSDN. To summarise:
Copy the font to the %windir%\fonts folder.
Call AddFontResource or AddFontResourceEx.
Broadcast the WM_FONTCHANGE message to all top-level windows.
It may be easier to find a way to persuade your installer tool to do this work for you.

Unable to find ant program

I am an experienced (but retired) Windows software developer, with more years experience than I care to admit, developing in C++, C#, VB and Java. I therefore decided to have a crack at Android development. My development machine is a Windows 7 box. My IDE of choice would be Microsoft Visual Studio but, for now, I am happy doing hand editing and launching tools from the command line.
I started by downloading the Android SDK and various additional items it suggested. I then started working my way through the tutorial at developer.android.com/training/basics/firstapp. Android list targets gave me a couple of choices (Android 4.2.2 and Google APIs:17). I then did Android create project from the command line and that appeared to do its stuff, creating MyFirstApp in my development folder. I then ran Android avd and created an emulator. I also added the android SDK's tools and platform-tools to my path. So far so good.
I fell at the next hurdle. The tutorial told me to change to the root folder of my project and run ant debug. At this point, Windows reports:
'ant' is not recognized as an internal or external command,
operable program or batch file.
I've searched around for ant.exe without success. Did I miss installing something or did I miss a vital step in the set-up? Any advice for this very green newbie would be greatly appreciated.
There is no ant.exe. Only ant.bat. Ant is a Java build tool.
If it comes with the Android SDK, make sure its bin directory is in your PATH environment variable. Otherwise, download it (from [http://ant.apache.org][1]), and follow the installation instructions on the web site.
Normally, simply unzipping it, putting its bin directory in the PATH envieonment variable, and setting a JAVA_HOME environment variable that points to your preferred JDK directory is sufficient.

Resources