I have deploy my electron app with "electron-packager", but i see that the electron-packager include always "resources" folder which has asar file and app folder with all sources file of my app... how I can deploy without including including "resources" folder so user can not see my codes?
I trid to deleted the "resources" folder, but my app not opening.. and I see some third party app used electron-packager but "resources" folder not included and it's work fine. How they did that please, any suggestion is welcome?
Here is code I have used:
npx electron-packager . electron-tutorial-app --overwrite --no-asar --platform=win32 --arch=x64
Thanks.
Related
I have an Electron+Angular application.
When I build the Angular app, it goes to dist folder, ok. And when I use electron-packager and electron-builder, it put the files inside dist too.
For the first version it's ok. The problem is when I'm building a second version. It packs the old version files that is inside dist folder. And the result is a large .exe file.
These is the commands I'm using to pack and publish my app:
electron-packager . --overwrite --asar=true --platform=win32 --ignore=ˆ/tmp
electron-builder --publish always
How can I prevent the old version files to be packed in new versions? Should I remove them every time I build a new version?
I finally solved my problem
I'm new with Electron, so I though that run electron-packager was necessary before publish new versions.
You only need to run:
electron-builder --publish always
electron-packager packs everything inside dist folder and creates a new folder outside dist.
electron-builder create necessary files to publish but ignores the old version files that was created for it. But if you have that new folder created by electron-packager it'll be published too and your .exe will be very large.
I have problem with project(https://github.com/Gordienko-RU/plant-log), there are angular bundle in dist folder and electron main file into electron folder, but after packaging with electron-builder, application doesn't run.
I guess there are some problems with my config in to package.json
Ok, I had a similar issue with electron-packager. I tried your package.json and did a "npm install". To me it looks like that your build does include native addons (*.node).
In electron-packager the solution was to add the asar unpack option. You are using electron-builder. Therefore you should look at this thread: https://github.com/electron-userland/electron-builder/issues/390 . Maybe you need to specify the modules by hand, like:
"asar": true,
"asarUnpack": [
"../node_modules/uws"
]
I used yeoman to scaffold an angular app and I'm trying to figure out how to use the existing minified file version of the lib in the bower_components folder rather than minifying it in my build process.
Is it possible?
You can use bower-installer which is a node package to control which files to be copied to your lib folder from the downloaded distribution package folder.
https://www.npmjs.com/package/bower-installer
I followed below steps to select which files to be copied to my lib folder
1) Install bower-installer
npm install -g bower-installer
2) Edit bower.json configuration file and specify path
3) Run bower-installer from terminal
I am trying to package and distribute my app which is written in electron. I noticed that when the binaries build is completed, the local resource/source code are also exposed in the final built folder.
In the resource/app folder, you would have all your source code revealed to anyone who can access.
I am wondering if there's anyway to hide these information, and just deliver the built binary.
I am using Electron 1.2 and electron-packager 7.0.4
Beyond mini-/uglifying your js code (can still be viewed) and creating an .asar package (can be extracted) there is not a whole lot you can do to prevent the visibility of your code.
See also this post on the electron-packager github page:
theres nothing built in to electron to do that, so we don't support
anything like that (since we only support what electron supports). you
would have to implement that in your own module and run it on your
code before using electron-packager -maxogden
If 7 years have passed but are still looking for an answer, they can use #electron/asar. When creating an application with electron packager, it creates a file with an .asar extension that will store your code if you type "--asar" on the terminal screen. For example;
electron-packager . {your exe file name} --overwrite --asar --platform=win32 --arch=x64 --icon={your icon file source} --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="product name"
I am trying to package my electron app . Follwing the instruction Here. I added an object to my package.json like below
"osx-package": "node_modules/electron-packager/cli.js
./build/bin --platform=darwin --arch=x64 --version=0.34.0 --overwrite"
When i run
npm run osx-package
I received the messgage below
Packaging app for platform darwin x64 using electron v0.34.0 Wrote new
app to /...../binary-build-darwin-x64
Below is what i can see from by sublime text.
However, when i visit the folder, i can only see three files . Myapp(i.e execuatble ) , licence file and version file. I unhidden hidden files , still couldnt see my files as expected. However, the files were still shown in the directory in sublime . Clicking my app throws an error saying can't find an electron framework etc. Please what am i misssing ? How do i fix this ?
Did your try running it via the console with npm start?
After packaging the OSX app, the following files should be created:
LICENSE
LICENSES.chromium.html
MYAPP.app
version