Create Desktop App + Installer with HTML/CSS/JS - Electron Tutorial 2020

  Рет қаралды 154,523

Red Stapler

Red Stapler

4 жыл бұрын

Electron tutorial (2020 updated version) In this video you'll learn how to
1) Use Electron Forge to setup new project
2) Write a simple CPU monitoring Desktop App
3) Basic concept of IPC (Inter-process communication)
4) Use Node.js Module in Electron
5) Create Executable file and Windows installer (.exe) with Electron Builder
6) Change Application Icon and Display Name in Control Panel
7) Request admin privilege when running your app
Source code: redstapler.co/simple-cpu-moni...
******** Follow us on *********
Facebook: / theredstapler
Website: redstapler.co/
Twitter: / redstapler_twit
******** Studio Equipment *********
Screen Capture Card: amzn.to/3f4wRzP
Mic: amzn.to/2Uy7dKw
Audio Interface: amzn.to/3pspAyJ
#Electron #JavaScript #HTML

Пікірлер: 216
@osikemhekhaigodsfavourbrun2645
@osikemhekhaigodsfavourbrun2645 3 жыл бұрын
The truth is that in the whole of the internet you are the only person who truly explain how to deploy electron app to a lay man understanding. I do really appreciate, you've save a ton of my searches. May God bless you in Jesus Name. I am deeply grateful.
@sammyxf6992
@sammyxf6992 6 ай бұрын
true
@muslim2k
@muslim2k 3 жыл бұрын
"I am a lazy person" - Every programmer ever.
@RivRob
@RivRob 3 жыл бұрын
meh
@LOOKSDOESMATTER1
@LOOKSDOESMATTER1 Жыл бұрын
I'm lazy to turn on my pc 😭😭
@stuvius
@stuvius 2 жыл бұрын
Will try this out but it's a really nice tutorial. Didn't skip the basics, and included everything I needed to know without any sidetracking
@feliuswyvern7189
@feliuswyvern7189 3 жыл бұрын
Was having issues figuring out how to setup an installer. This video helped out a lot
@stephennardone5437
@stephennardone5437 3 жыл бұрын
I am just starting out with Electron JS and this answered so many questions for me. Thank you for this! One thing I would like to know more about is how to integrate other languages and what languages would be best, if at all possible.
@majaysakthishankar8432
@majaysakthishankar8432 4 жыл бұрын
Conclusion : JavaScript is the skill which we need to master in order to all these Cool Stuffs. Thanks Redatapler Love all your Stuffs.
@muslim2k
@muslim2k 3 жыл бұрын
You're using plural noun the wrong way.
@yonggonlee
@yonggonlee 3 жыл бұрын
Finally something actually works! Thank you very much.
@DamienzTheBand
@DamienzTheBand Жыл бұрын
Very nicely paced and thanks for getting into the installer a bit. When getting into a framework the first thing you want to do is to see the whole procedure to the end product. What happens in between, the actual building of the code, is less interesting as it is most likely the same as standard scripting. The next thing would be to see best practices of reading-writing on disk on all systems and the pit-falls therein (cause no 2 OS:es are the same here). Thanks for a clear explanation!
@BurningIceGod
@BurningIceGod 3 жыл бұрын
a short follow-up on how to create and deploy automatic updates for this app would be great :)
@user-hk7px1sx4x
@user-hk7px1sx4x 2 жыл бұрын
I think that is not possible with electron with what I heared
@dragoonussolonar7006
@dragoonussolonar7006 3 жыл бұрын
I've been playing around with Electron last couple of days, got a lot further developing then I imagined, but wanted to test building, a concept as a web developer I am somewhat unfamiliar with. It did not go well. electron-packager, electron-forge, and electron-builder all failing. I had no idea why. I still have no idea why. However, using npm as you have instead of yarn as electron-builder docs suggests magically remedies the epipe issue I had. In only a few minutes nearer the end of your video you've solved hours of me messing. Thank you!!
@dalepres1
@dalepres1 3 жыл бұрын
I've got over 20 years of web development experience with different platforms and frameworks. Even with that background, this is the absolute best tutorial on using electronjs I have seen. Now I think I can actually start building a working electron app. Thanks!
@CodeChrisB
@CodeChrisB Жыл бұрын
"20 years of web development " "I think I can actually start building a working electron app " Something not adding up here
@dalepres1
@dalepres1 Жыл бұрын
@@CodeChrisB What's not adding up? Since you're reading/watching this video, I assume that you, too, weren't able to jump into creating an electron app without the benefit of learning what others have already learned and shared. You're clearly not a developer, or if you are, you're clearly not someone I want on my team - I manage a team of 45 developers right now. Anyone can read the documentation for any new-to-them framework or language and write code. If you think it's a good idea to start from the beginning and charge your employer and clients for the time it takes you to learn all of the ins and outs of a new framework, what works differently from your experience, learning what works and doesn't, then you're definitely not someone I want. I want my team to find experts and learn from them, not having to start by reinventing the wheel in electron apps, for instance. A question I have had in every interview I've had in the past 20+ years, and a question I have asked in every interview I've led in the past 20+ years, is, "When you are trying to develop something new to you or that you're struggling with, what do you do to solve it?" If their answer doesn't include "Google it" or something equivalent, it definitely impacts the interview negatively. So what really doesn't add up is how CodelessChrisB comes to a site with a great video on ElectronJS when an experienced web developer would never need to come to such a site, according to Codeless. Edit to add: And I posted my first post that you complained about a year ago so I don't remember exactly what led to it but, if I recall, there was something in the video that indicated the video creator was targeting new developers. My point in mentioning my long experience in relation to this video is that it didn't/doesn't just help new developers; it is also very valuable for senior or other developers new to electronJS.
@gcristian1417
@gcristian1417 3 жыл бұрын
You're a savior! Thank you very much!!!!! Keep making videos like this!!!!
@CompilingInput
@CompilingInput 3 жыл бұрын
Concise n to the point intro for newbies,luv it 👍
@mattmcewan2550
@mattmcewan2550 3 жыл бұрын
Subscribed! Really well done tutorial - helped a lot, thanks
@kidslovervn
@kidslovervn 2 жыл бұрын
This is what I am looking for! thanks for sharing this tutorial! you are amazing
@yolamontalvan9502
@yolamontalvan9502 10 ай бұрын
Thanks for this lesson. It was easy to understand.
@621ajith
@621ajith 3 жыл бұрын
Thanks for the video. That was really helpful.
@gizzmo1976
@gizzmo1976 3 жыл бұрын
Very well done! Thank you!
@Pranavmanseta
@Pranavmanseta 3 жыл бұрын
Excellent, this helped me..!
@MrBaLe
@MrBaLe 3 жыл бұрын
Thank you! very helpful.
@MrVipulLal
@MrVipulLal 4 жыл бұрын
Thanks for the tutorial. Do the installers uploadable to MAC and Windows App Store?
@lwliang8108
@lwliang8108 3 жыл бұрын
Thanks for the tutorial. Helpful Info. Thumbs
@Hotatoes
@Hotatoes 4 жыл бұрын
nice use case with electron thanks man :D
@kamyarsedghi4602
@kamyarsedghi4602 2 жыл бұрын
My only regret is that I have only one like per video to give. Keep the good work. ❤
@esakib
@esakib 2 жыл бұрын
man you are awesome explainer💖💖
@navzme
@navzme 3 жыл бұрын
Great tutorial Thanks!
@KimionTM
@KimionTM 3 жыл бұрын
If any of you get the "require is not defined" error, try adding contextIsolation: false to the webPreferences
@poldragon458
@poldragon458 3 жыл бұрын
Just type this webPreferences: { nodeIntegration: true, contextIsolation: false, enableRemoteModule: true } }); instead of webPreferences: { nodeIntegration: true } }); (restart the client after making these changes btw)
@gioeleferrari600
@gioeleferrari600 3 жыл бұрын
Thank you so much! I got the error but now is resolved
@rad6626
@rad6626 3 жыл бұрын
@Juergen Rau me too lol
@rad6626
@rad6626 3 жыл бұрын
thank you :)
@citaanggraini116
@citaanggraini116 2 жыл бұрын
I'M WAITING TO SEE COMMENTS LIKE THIS, IT'S REALLY HELPING ME. ALMOST A WEEK OR SO I DON'T KNOW WHAT TO DO. THANK YOU VERY MUCH
@danielevessio8779
@danielevessio8779 3 жыл бұрын
very nice tutorial! Thanks
@sumukhakb2701
@sumukhakb2701 3 жыл бұрын
Awesome tutorial. Please make more videos on electron
@braveru716
@braveru716 3 жыл бұрын
Great tutorial !
@anokidevel
@anokidevel 2 жыл бұрын
Thanks man!
@mynameiskranz
@mynameiskranz 2 жыл бұрын
thank you man!
@simonvanwingerden9666
@simonvanwingerden9666 3 жыл бұрын
Nice tutorial! But I also needed to set contextIsolation = false in webPreferences before it actuly works. (maby changed in last version(s))
@fraserhobbs24
@fraserhobbs24 3 жыл бұрын
Just wondering when you are writing your code out you get the snippets and autocompletion for it all, what are you using for this? i cannot seem to find one for this.
@muhammadashour3793
@muhammadashour3793 4 жыл бұрын
Loved it ❤️ Can you upload a video explaining javascript Asynchronous functions with easy explaining and examples please.. Thanks..
@muslim2k
@muslim2k 3 жыл бұрын
Checkout TheNetNinja or Traversy Media's video.
@muhammedirfan428
@muhammedirfan428 2 жыл бұрын
fantastic. thank you
@catalinim4227
@catalinim4227 4 жыл бұрын
Thanks, completely forgot about Electron
@NzV123
@NzV123 3 жыл бұрын
Hello thanks for the tutorial, this is really helpful. I have a question though- my program has 3 components, the GUI (which is a .exe), the server and backend (which is a .war in a Tomcat server), and the Database (which is a PostgreSQL server). How do I go about creating an installer that handles the installation of the DB and Server/Backend before running the GUI .exe?
@mdhossen7082
@mdhossen7082 2 жыл бұрын
This video is Very helpful
@jaibodele6363
@jaibodele6363 4 жыл бұрын
Yes that is what I want to see
@TomaszSmykowski
@TomaszSmykowski Жыл бұрын
Thanks!
@ChetanBhole
@ChetanBhole 3 жыл бұрын
Very Very Much Thanx.
@SebaM90
@SebaM90 4 жыл бұрын
Nice. Only compile for Windows ??
@GxdKxller
@GxdKxller 3 жыл бұрын
Well done!
@wiryacompchannel
@wiryacompchannel 3 жыл бұрын
good tutorial.. thanks
@RVKAWAAA
@RVKAWAAA Жыл бұрын
Excelente!
@lucasribeiro9089
@lucasribeiro9089 4 жыл бұрын
The video is very good for to start
@ShekharSuman271991
@ShekharSuman271991 3 жыл бұрын
Kudos!
@teddyperera8531
@teddyperera8531 3 жыл бұрын
Thank you
@zinheere
@zinheere 2 жыл бұрын
what!??!?!?! this guy got VERIFIED under 1 mil subs!!! Your INSANE This guy is SOOO UNDERRATED
@thatonecoder737
@thatonecoder737 2 жыл бұрын
anyone can get verified if they have over 100k subs...
@nakulsingh8444
@nakulsingh8444 2 жыл бұрын
Awesome
@victor8068
@victor8068 3 жыл бұрын
Thx!
@sarathkurup1016
@sarathkurup1016 3 жыл бұрын
nice bro ❤️
@verdipratama
@verdipratama 4 жыл бұрын
thank youuuuuuuu
@activelinestories1
@activelinestories1 3 жыл бұрын
wow thank you
@ThePianoKid
@ThePianoKid 3 жыл бұрын
For anybody getting an error when you run "npm run build-installer", add your app icon to a build folder and run "electron-builder --windows --config.nsis.oneClick=false --config.nsis.allowToChangeInstallationDirectory=true" for the same thing
@m.o.7661
@m.o.7661 2 жыл бұрын
This is good tutorial. Can I have my website being displayed as downloadable app to distribute? I don't know if my question make sense! Thanks
@oatmanbecauseilikeoatmeal
@oatmanbecauseilikeoatmeal 3 жыл бұрын
for those not getting the console log in the main window try adding mainWindow.webContents.on('did-finish-load',()=>{ mainWindow.webContents.send(...); }); in the index.js. worked for me
@cmdaltctr
@cmdaltctr 3 жыл бұрын
Hi, I am quite new in this, so pardon the noob question. Why is the app size ~233MB for such a small app?
@rajadvamshi
@rajadvamshi 3 жыл бұрын
Really good one but what’s the point in building an old school app in 2020 when we have uwp and store??
@rishiktiwari
@rishiktiwari 4 жыл бұрын
Why do you think about PWA vs Electron?
@trvebm7812
@trvebm7812 3 жыл бұрын
Would really appreciate if someone could explain how to make the build script for MAc and Linux too!
@hpnguyen2002
@hpnguyen2002 3 жыл бұрын
Excellent guide! Thanks a lot. A question: how to make a Mac runnable program if we use Windows?
@charlesderek7107
@charlesderek7107 3 жыл бұрын
Can ther Electron Desktop apps made create and run executables? Such as creating JSON files, running automated cmd/terminal commands?
@myildizhan
@myildizhan 3 жыл бұрын
Can we compile this apps for Ubuntu or Linux distributions too?
@merajjalaly1277
@merajjalaly1277 4 жыл бұрын
Goooon
@NERO-ez1mn
@NERO-ez1mn 2 жыл бұрын
just for clarifications on the GB mem, You divided it by 1024 for a reason that a gb is 1024byes? or ai am just missing something?
@HimanshuSharma-op2qg
@HimanshuSharma-op2qg 3 жыл бұрын
wah bro wah
@molaimc6411
@molaimc6411 3 жыл бұрын
Hey, I Was Here To Ask If We Can Get Your Whole SRC Folder For Download. Do You Have A GitHub Repo Or Something?
@sqarcle
@sqarcle 3 жыл бұрын
After building it is not loading index.html just showing a white screen . What should I do? I have many images,html files connected with the main.js and index.html
@jeffbro7147
@jeffbro7147 4 ай бұрын
I've tried it and im able to create a setup for my app , i have another requirement . I should be able to add some script that should install sql express server , when ever I press the install button , with addition once the express server is installed , I want to run my another script which will create some tables in the plain db . Im stuck , in how to add the script to install express server and run the db manipulation script
@nandakyawwin9006
@nandakyawwin9006 3 жыл бұрын
nice
@inqzz
@inqzz 2 жыл бұрын
what plugin do you have for the colors in vs code
@taranathniraula3036
@taranathniraula3036 3 жыл бұрын
please make video on how to customize close,minimize,maximize,restore down button and style it
@furbi963
@furbi963 4 жыл бұрын
Gusta 🙊💗
@a1r9r89
@a1r9r89 3 жыл бұрын
i hope u can help me, i tried but in the file .html the console told me i had an error, in the line code " ipcRender.on('cpu', (event,data) =>, the log error says Cannot read property 'on' of undefined. i hopely u can help me, how can i fix it ... :/ P.D. sorry for my english if i had orthography errors or syntaxis, i'm a latino.
@bahidev9245
@bahidev9245 4 жыл бұрын
@teufelsborg176
@teufelsborg176 4 жыл бұрын
console.log in the Main Process does not work for me on Windows. the Renderer process logs to Chromium's devtools fine. and on Mac, it works, the Main logs to the console fine. but on Windows 8.1 a simple console.log() in index.js does not work for me.
@technoinfoworldwide2329
@technoinfoworldwide2329 Жыл бұрын
We need more large projects on electron desktop app, i didnt find many projects in youtube
@sportnewsfc7024
@sportnewsfc7024 Жыл бұрын
Web dev projects should also work on electron as it basically just runs chromium.
@karanjotsandhu237
@karanjotsandhu237 3 жыл бұрын
Hello...how can I create a single exe file using electron packager for all three platforms?
@abdullaahmad5431
@abdullaahmad5431 4 жыл бұрын
@Red stapler, can I delete the default files in src folder & add my own files?! And Can I create app for all systems by electron?!
@junkmeal7292
@junkmeal7292 3 жыл бұрын
Can I create app for all systems by electron?! yes but u need to build it on the other system
@junkmeal7292
@junkmeal7292 3 жыл бұрын
@@Black..Rabbit okey
@vmars316
@vmars316 2 жыл бұрын
How can I check if Electron is installed , an see what version ? Thanks
@mickmc1498
@mickmc1498 3 жыл бұрын
I have an online website builder html, js, elements, images - how do I convert to desktop exe
@MarvBudd
@MarvBudd 2 жыл бұрын
What about redoing this with nodeintegration: false so the app is more secure?
@udeshnishan1142
@udeshnishan1142 3 жыл бұрын
How can I create an extra app config file? to change the configuration after build the application
@fiend_1108
@fiend_1108 Жыл бұрын
Invalid configuration object. electron-builder 23.1.0 has been initialized using a configuration object that does not match the API schema. - configuration.nsis has an unknown property 'liscense' idk what is wrong with this error
@davidsahakyan8790
@davidsahakyan8790 4 жыл бұрын
Yeees
@its_akhr
@its_akhr 3 жыл бұрын
I used the same method to package my app into a installable .exe file. But the videos in the web app is not playing/showing after installation. The videos are playable when I tried npm run start. Can anyone tell me why?
@front-endanimal6359
@front-endanimal6359 4 жыл бұрын
create it with react + electron
@ngodingrek6458
@ngodingrek6458 2 жыл бұрын
how to change the default installation path to program file?
@plebedesign5135
@plebedesign5135 3 жыл бұрын
Package "electron-builder" is only allowed in "devDependencies". Please remove it from the "dependencies" section in your package.json. What to do??
@muhamadimron9785
@muhamadimron9785 3 жыл бұрын
_yarn remove [packagename]_ Then : _yarn add -D [packgname]_
@BurningIceGod
@BurningIceGod 3 жыл бұрын
you can look inside package.json and go to the dependencies section cut the "electron-builder" line and paste it in "devDependencies"
@tigerlep9
@tigerlep9 3 жыл бұрын
for me nothing shows up in the console with the ipc things, I see the cpu usage, mem usage and total mem in the terminal but it doesn't show up in the electron devtools console
@rubentxogg2280
@rubentxogg2280 2 жыл бұрын
That's because the Window don't have time to load the page and load the JS to recieve message. You need to wrap it in the 'did-finish-load' event like this: os.cpuUsage(function (v) { mainWindow.webContents.on('did-finish-load', function(){ console.log('CPU Usage (%): ' + v * 100); mainWindow.webContents.send('cpu', v * 100); console.log('Mem Usage (%): ' + os.freememPercentage() * 100); mainWindow.webContents.send('mem', os.freememPercentage() * 100); console.log('Total Mem (GB): ' + os.totalmem() / 1024); mainWindow.webContents.send('total-mem', os.totalmem() / 1024); }); }); That worked for me.
@thoughtswithzuks
@thoughtswithzuks 3 жыл бұрын
11:28 npm install electron-builder --dev Should now be npm install electron-builder --save-dev Otherwise awesome!!!
@BabarAli-yb1eg
@BabarAli-yb1eg 4 жыл бұрын
Man when you made final build the .exe file was *233 Mb* .. damn for simple app.. Is there any way to reduce it?
@RedStapler_channel
@RedStapler_channel 4 жыл бұрын
nope that's the catch of electron. it needs chromium to run hence the large size.
@BabarAli-yb1eg
@BabarAli-yb1eg 4 жыл бұрын
@@RedStapler_channel desperate times desperate measures
@LetTheWritersWrite
@LetTheWritersWrite 4 жыл бұрын
@@BabarAli-yb1eg look into C++ solutions like Ultralight.ht (formerly Awesomium), Sciter, Librocket, and many other HTMl GUI solutions for C++. Ultralight looks very promising.
@LetTheWritersWrite
@LetTheWritersWrite 4 жыл бұрын
Actually there's a direct comparison to electron to C++ with Ultralight here ultralig.ht/#about
@BabarAli-yb1eg
@BabarAli-yb1eg 4 жыл бұрын
@@LetTheWritersWrite i have worked with c++ but i prefer JavaScript over c++ anytime anyday , so i have to deal with v8 size
@romerlunar757
@romerlunar757 3 жыл бұрын
I have a issue const electron = require(‘electron’); Uncaught referenceerror: require is not defied
@oliverkam6224
@oliverkam6224 3 жыл бұрын
me too pls help
@poldragon458
@poldragon458 3 жыл бұрын
me too
@poldragon458
@poldragon458 3 жыл бұрын
Just type this webPreferences: { nodeIntegration: true, contextIsolation: false, enableRemoteModule: true } }); instead of webPreferences: { nodeIntegration: true } }); (restart the client after making these changes btw)
@jolantamakua7135
@jolantamakua7135 2 жыл бұрын
can you show what script 'make' contains?
@perryedrick
@perryedrick 2 жыл бұрын
when i do it it doesn't build any nsis installer i can't firgure out why
@advaiyalad
@advaiyalad 3 жыл бұрын
Never use nodeIntegration: true. Instead, use contextIsolation: true and add properties to the window in preload.js. THEN use those properties in renderer.js. It is a lot of work, but security is important.
@1eknowy
@1eknowy 2 жыл бұрын
sorry for asking in here, but where is renderer.js? i'm a newbie for learning elektron and javascript can u help me?
@lexuscreations5805
@lexuscreations5805 3 жыл бұрын
Require is not a function uncought reference error
@waterblurr
@waterblurr 2 жыл бұрын
It would be great if you put timestamps in the video for future viewers.
Electron Tutorial - Introduction
3:08
Red Stapler
Рет қаралды 15 М.
ELECTRON: why people HATE it, why devs USE it
17:19
The Linux Experiment
Рет қаралды 182 М.
Stupid Barry Find Mellstroy in Escape From Prison Challenge
00:29
Garri Creative
Рет қаралды 16 МЛН
🌊Насколько Глубокий Океан ? #shorts
00:42
Create an Installer for an Electron App using Electron Forge!
16:27
Israel Quiroz
Рет қаралды 1,7 М.
Electron vs Tauri: This Was Unexpected!!
9:41
DashCruft
Рет қаралды 36 М.
Learn Electron in Less than 60 Minutes - Free Beginner's Course
58:58
CUSTOM Installer w/ Electron
9:15
tylerlaceby
Рет қаралды 22 М.
Learn CSS Animations In 20 Minutes - For Beginners
21:22
Slaying The Dragon
Рет қаралды 957 М.
How To Create A Video Chat App With WebRTC
28:53
Web Dev Simplified
Рет қаралды 896 М.
Learn Sass In 20 Minutes | Sass Crash Course
19:42
developedbyed
Рет қаралды 925 М.
ElectronJS Crash Course 2022
1:30:39
Bitfumes
Рет қаралды 63 М.
i like you subscriber ♥️♥️ #trending #iphone #apple #iphonefold
0:14
Iphone or samsung?
0:14
Obeyfendimen
Рет қаралды 767 М.
AI от Apple - ОБЪЯСНЯЕМ
24:19
Droider
Рет қаралды 125 М.
ТОП-5 культовых телефонов‼️
1:00
Pedant.ru
Рет қаралды 18 М.
сюрприз
1:00
Capex0
Рет қаралды 1,4 МЛН