<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Notes-on-electron-builder</id>
	<title>Notes-on-electron-builder - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Notes-on-electron-builder"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Notes-on-electron-builder&amp;action=history"/>
	<updated>2026-04-05T17:41:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=Notes-on-electron-builder&amp;diff=107&amp;oldid=prev</id>
		<title>imported&gt;Justin: Created page with &quot;Notes on Creating Images via ElectronBuilder ============================================   We can use Electron Builder to create AppImages for Linux, DMG images for Mac OS X,...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Notes-on-electron-builder&amp;diff=107&amp;oldid=prev"/>
		<updated>2019-01-14T23:00:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Notes on Creating Images via ElectronBuilder ============================================   We can use Electron Builder to create AppImages for Linux, DMG images for Mac OS X,...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Notes on Creating Images via ElectronBuilder&lt;br /&gt;
============================================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can use Electron Builder to create AppImages for Linux, DMG images for Mac OS X,&lt;br /&gt;
and an image file to be determined via Windows.&lt;br /&gt;
&lt;br /&gt;
To get AppImage to work on various systems, we need to keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
1.  The AppImage needs to include all libraries and other dependencies that are not&lt;br /&gt;
    part of the base systems that the AppImage is intended to run on.&lt;br /&gt;
&lt;br /&gt;
2.  The binaries contained in the AppImage need to be compiled on a system not newer&lt;br /&gt;
    than the oldest base system that the AppImage is intended to run on.&lt;br /&gt;
&lt;br /&gt;
3.  The AppImage should actually be tested on the base systems that it is intended&lt;br /&gt;
    to run on.&lt;br /&gt;
&lt;br /&gt;
For Mac OS X dmg images, these guidlines don't matter as much, as I understand it,&lt;br /&gt;
because Mac OS doesn't have the variations that Linux distributions have.  If we can&lt;br /&gt;
test our packages on previous versions of Mac OS X, though, it probably wouldn't hurt,&lt;br /&gt;
but there should be limits on how far back we should be willing to go.&lt;br /&gt;
&lt;br /&gt;
Similarly, I expect the image compiled for Windows should work fine as well, once we&lt;br /&gt;
figure out how to create the image.&lt;br /&gt;
&lt;br /&gt;
Theoretically we should be able to compile images for all three platforms on one&lt;br /&gt;
machine (although Windows images require Wine on Linux to do this, and Mac OS X requires&lt;br /&gt;
compilation to be done on a Mac OS X computer if we desire to sign the image), but in&lt;br /&gt;
practice, we generate binary files from Chicken Scheme, which will pretty much require us&lt;br /&gt;
to either figure out how to cross-compile Chicken Scheme source into binaries (which seems&lt;br /&gt;
to me that would lead to madness), or we will of necessity have to compile versions using&lt;br /&gt;
each of the three operating systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
**TODO ITEMS**&lt;br /&gt;
&lt;br /&gt;
1.  Determine the oldest system we wish to have Electron run on, and build on it.&lt;br /&gt;
    For stupid reasons (ie, I just like Debian) I chose Debian Jesse (which is one less&lt;br /&gt;
    than the current version), but there might be a better choice for a &amp;quot;base&amp;quot; system.&lt;br /&gt;
&lt;br /&gt;
2.  Determine which systems we wish to test.  IDEALLY, it would be a half a dozen&lt;br /&gt;
    or so, and MAY even include weird ones like Gentoo.  PRACTICALLY, we would certainly&lt;br /&gt;
    want to target three or four popular ones:  MINT, UBUNTU, FEDORA, MANDRIVA,&lt;br /&gt;
    SUSE.  NOTE:  If we target DEBIAN, we JUST MIGHT get MINT and UBUNTU for free!&lt;br /&gt;
    SIMILARLY, if we target FEDORA, we probably get CENT OS and RED HAT for free&lt;br /&gt;
    (although RED HAT could probably be ignored, and CENT OS can probably be a&lt;br /&gt;
    good target too....)&lt;br /&gt;
&lt;br /&gt;
    RANDOM THOUGHT:  It would be nice to target NIX OS, but when I attempted to do so,&lt;br /&gt;
    I kept on running into weird memory errors that I couldn't overcome, due to a loss&lt;br /&gt;
    of patience.  I'd like to get more familiar with NIX OS in general, though, because&lt;br /&gt;
    I want to have a better understanding of its package management system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Virtual Machine Notes&lt;br /&gt;
---------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have chosen to use VirtualBox for testing images in other distributions, mostly because I&lt;br /&gt;
ran into problems getting Qemu working (which philosophically I would prefer), but also because&lt;br /&gt;
I have more experience with VirtualBox.&lt;br /&gt;
&lt;br /&gt;
It's desirable to build this in a Virtual Machine, in order for AppImage to be able to run in&lt;br /&gt;
older versions (in an attempt to maximize compatibility).  I have done this in Debian Jessie&lt;br /&gt;
(which is one less than the current version) by creating a VM with a shared folder between&lt;br /&gt;
the VM and my host system.  Symbolic links in shared folders are disabled by default, however,&lt;br /&gt;
due to compatibility and security problems between Windows and Linux/Mac OS distributions, so&lt;br /&gt;
compilation will only work if symbolic links are enabled.&lt;br /&gt;
&lt;br /&gt;
Per an answer to an &amp;quot;Ask Ubuntu&amp;quot; question [found here](https://askubuntu.com/questions/446317/how-to-make-guest-os-follow-symlinks-from-shared-folder), this is done via:&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
VBoxManage setextradata &amp;lt;[VM_NAME]&amp;gt; VBoxInternal2/SharedFoldersEnableSymlinksCreate/&amp;lt;[SHARE_NAME]&amp;gt; 1&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
After running this command, it's necessary to restart the VirtualBox VM in question for the change to&lt;br /&gt;
take effect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes For Creating Electron Apps&lt;br /&gt;
--------------------------------&lt;br /&gt;
&lt;br /&gt;
It looks like Electron has several options for creating a standalon app file:&lt;br /&gt;
manual creation, electron-packager, electron-builder, electron-forger.  As far as&lt;br /&gt;
I can determine, &amp;quot;electron-builder&amp;quot; is the most flexible of the three; in addition&lt;br /&gt;
to being able to create Windows, OSX and Linux AppImage builds, it can create &amp;quot;deb&amp;quot;,&lt;br /&gt;
&amp;quot;rpm&amp;quot; and other Linux distribution formats.&lt;br /&gt;
&lt;br /&gt;
Here are some links that seem important:&lt;br /&gt;
&lt;br /&gt;
[The electron-builder README introduction](https://github.com/electron-userland/electron-builder)&lt;br /&gt;
&lt;br /&gt;
[An _electron-builder_ tutorial](https://medium.com/how-to-electron/a-complete-guide-to-packaging-your-electron-app-1bdc717d739f)&lt;br /&gt;
&lt;br /&gt;
[Electron Builder command line options](https://www.electron.build/cli)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The settings for building the project are found in &amp;quot;package.json&amp;quot;.  The following&lt;br /&gt;
settings are particularly important for building new things.  (I _really_ wish we&lt;br /&gt;
could add comments to the &amp;quot;package.json&amp;quot; file, but unfortunately comments are NOT&lt;br /&gt;
a part of the JSON standard, and thus would potentially be stripped out!  :-( )&lt;br /&gt;
&lt;br /&gt;
NOTE:  It looks like the build system can also use an &amp;quot;electron-builder.yml&amp;quot; file,&lt;br /&gt;
which allows comments.  Perhaps we should use that.  This may mean that some of&lt;br /&gt;
the settings will be seperated from others (since we'll still need a &amp;quot;package.json&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;scripts&amp;quot; -- not unique to &amp;quot;electron-rebuild&amp;quot;, but used to identify scripts&lt;br /&gt;
  that is used by npm/yarn to run and/or build the application.  Several options&lt;br /&gt;
  under scripts are of note:&lt;br /&gt;
&lt;br /&gt;
  * &amp;quot;pack&amp;quot; -- if I understand correctly, this is used to create &amp;quot;test runs&amp;quot;&lt;br /&gt;
              for packaging.  It's necessary to specify a directory where&lt;br /&gt;
              the files for this test run will be added.&lt;br /&gt;
&lt;br /&gt;
  * &amp;quot;dist&amp;quot; -- creates a single file ideally ready for distribution.&lt;br /&gt;
&lt;br /&gt;
  For both of these commands, the default target is the system the command&lt;br /&gt;
  is run on; if we want to sign for MacOS, it will be necessary to run this&lt;br /&gt;
  on MacOS; if we want to create something on Linux for Windows, apparently&lt;br /&gt;
  we need to have Wine (Wine Is Not an Emulator) installed.&lt;br /&gt;
&lt;br /&gt;
  Apparently the options we'll want to use are:&lt;br /&gt;
&lt;br /&gt;
  --mac, -m, -o --macos (for Mac OSX),  &lt;br /&gt;
  --linux, -l (for Linux),  &lt;br /&gt;
  --win, -w, --windows (for Windows),  &lt;br /&gt;
  -lmw (for all three)&lt;br /&gt;
&lt;br /&gt;
  NOTE:  Since we use Chicken Scheme, which compiles binaries for a particular&lt;br /&gt;
  platform, it's likely that regardless of which system we wish to generate,&lt;br /&gt;
  we'll probably need to generate the files on the platforms we wish to target,&lt;br /&gt;
  rather than generate them all in one place -- unless we want to try to configure&lt;br /&gt;
  Chicken Scheme to cross-compile (which may very well lead to madness).  Mac OS X&lt;br /&gt;
  in particular *requires* us to compile on Mac OS X if we want to digitally sign&lt;br /&gt;
  the package in question...&lt;br /&gt;
&lt;br /&gt;
  If we want to create multiple types of packages (say, &amp;quot;AppImage&amp;quot;&lt;br /&gt;
  and &amp;quot;deb&amp;quot; for Linux) we can include target lists that specify what&lt;br /&gt;
  we want.&lt;br /&gt;
&lt;br /&gt;
  If we wanted to do something weird, say &amp;quot;prebuild&amp;quot;, this is probably&lt;br /&gt;
  where we would include the option.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;build&amp;quot; -- this is used to store settings for different types of builds.&lt;br /&gt;
             The options that seem to be of greatest interest are:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;dmg&amp;quot; -- build options for MacOS X (I'm still trying to figure out what&lt;br /&gt;
           &amp;quot;contents&amp;quot; means)&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;win&amp;quot; -- build options for Windows&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;linux&amp;quot; -- options for Linux&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;extraFiles&amp;quot; -- extra non-JS files that need to be included in the build;&lt;br /&gt;
                  this is likely where we specify that we want to include&lt;br /&gt;
                  files related to RhoLang and Ganache....&lt;br /&gt;
&lt;br /&gt;
                  Each entry has a &amp;quot;from&amp;quot; dir, a &amp;quot;to&amp;quot; dir, and a &amp;quot;filter&amp;quot;&lt;br /&gt;
                  to determine what files should be included.  These can be&lt;br /&gt;
                  included in each target type, so that we could include&lt;br /&gt;
                  files especially for Windows, Linux, and MacOS, as well&lt;br /&gt;
                  as generic files for all systems.&lt;br /&gt;
&lt;br /&gt;
                  Apparently symbolic links are copied as symbolic links,&lt;br /&gt;
                  which is a bad idea.....&lt;br /&gt;
&lt;br /&gt;
Apparently icon files, to be recognized by Electron Builder, need to be&lt;br /&gt;
named &amp;quot;build/icon.icns&amp;quot;, and it needs to be at most a 1024x1024-sized&lt;br /&gt;
ICNS file.  This can be converted readily enough from PNG files with the&lt;br /&gt;
right tools.&lt;br /&gt;
&lt;br /&gt;
By default Linux uses the icons that are designated for the Mac OS X target.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up correctly, we create the package via&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
yarn run dist&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
If everything goes &amp;quot;well&amp;quot; (where &amp;quot;well&amp;quot; means it somehow works, even if it produces&lt;br /&gt;
a weird error that I haven't yet come to terms with), there will be a directory called&lt;br /&gt;
&amp;quot;dist&amp;quot; which contains the file or files that we desire.  Additionally, there's a&lt;br /&gt;
sub-directory called &amp;quot;linux-unpacked&amp;quot; which apparently contains the files that go&lt;br /&gt;
into the AppImage file.&lt;br /&gt;
&lt;br /&gt;
When I rerun a build, I typically remove &amp;quot;dist&amp;quot; first, but it's unclear to me whether or&lt;br /&gt;
not this is necessary.  Sometimes I'll even remove `node_modules` and start completely&lt;br /&gt;
from scratch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Miscellaneous Notes&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
**Binary Files**&lt;br /&gt;
&lt;br /&gt;
Binary files (such as &amp;quot;rholangCLI.jar&amp;quot;) need to be kept in a &amp;quot;bin&amp;quot; folder, where AppImage&lt;br /&gt;
can find them, and where Cryptofex IDE can find them when run from the command line.  Specific&lt;br /&gt;
information on setting up the necessary symlinks can be found in `[electron-ide]/bin/BIN_README.md`.&lt;br /&gt;
(**NOTE**:  The file system has changed quite a bit since Alpheus originally made notes&lt;br /&gt;
about this; symlinks may no longer be needed....)&lt;br /&gt;
&lt;br /&gt;
Binary files that are generated via our build process (such as via Chicken Scheme) are&lt;br /&gt;
accessed through modules; thus, we don't need to include the results of such compilations in&lt;br /&gt;
&amp;quot;bin&amp;quot; (unless we had a very good reason to keep the file completely 100% seperate from&lt;br /&gt;
Cryptofex IDE).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
**Cryptofex IDE Directories**&lt;br /&gt;
&lt;br /&gt;
When Cryptofex IDE is first run, it creates two default directories in the home directory:&lt;br /&gt;
&amp;quot;.cryptofex&amp;quot; to keep track of IDE settings (right now, only global settings, but at some point&lt;br /&gt;
we'll want to add session settings here too) and &amp;quot;cryptofex-ide&amp;quot; to provide default files&lt;br /&gt;
for an introduction to some of Cryptofex IDE's features.&lt;br /&gt;
&lt;br /&gt;
AppImage expects these files to be found in &amp;quot;[electron-ide]/ide/intro-files&amp;quot;; thus, any&lt;br /&gt;
changes to default files need to be made in this directory.  Currently, Cryptofex IDE doesn't&lt;br /&gt;
track changes to these files; thus, for changes in this directory to take effect, it is&lt;br /&gt;
necessary to delete this directory, so that the IDE will see that it's missing, and fill in the&lt;br /&gt;
directory with the current files.  If there exists file named &amp;quot;cryptofex-ide&amp;quot;, Cryptofex IDE&lt;br /&gt;
defaults showing the home directory in the file browser.&lt;br /&gt;
&lt;br /&gt;
(It just occurred to me that I have no idea why Cryptofex IDE seems to do the right thing when&lt;br /&gt;
run from the command line, when it should likely have the same kinds of issues that it has with&lt;br /&gt;
the &amp;quot;bin&amp;quot; directory; perhaps it doesn't, and I'm too tired at the moment to test to see if it&lt;br /&gt;
does.  I'm not 100% sure I care at the moment, either, since it's easy to populate this&lt;br /&gt;
directory by running an AppImage of some sort.)&lt;br /&gt;
&lt;br /&gt;
**IDEA**  I have considered the possibility of checking the &amp;quot;cryptofex-ide&amp;quot; file to see if&lt;br /&gt;
we could glean some information about directories, and then start Cryptofex IDE in the&lt;br /&gt;
identified directory.&lt;br /&gt;
&lt;br /&gt;
**IDEA**  *(A far better one, actually)*  Perhaps when a user starts Cryptofex IDE, we should&lt;br /&gt;
pop up a window asking the user what directory they wish to start out with; we should default&lt;br /&gt;
to &amp;quot;cryptofex-ide&amp;quot; if that directory exists, or &amp;quot;home&amp;quot; otherwise, but nonetheless let the user&lt;br /&gt;
navigate to the correct directory.&lt;/div&gt;</summary>
		<author><name>imported&gt;Justin</name></author>
	</entry>
</feed>