How to create a windows installer for an application built with Electron Framework



Read the original article here: http://ourcodeworld.com/articles/read/365/how-to-create-a-windows-installer-for-an-application-built-with-electron-framework

Please subscribe to our channel. For more awesome content visit
http://ourcodeworld.com

Music: http://www.bensound.com/

Follow us on Twitter

Like us on Facebook:
http://www.facebook.com/ourcodeworld

38 thoughts on “How to create a windows installer for an application built with Electron Framework”

  1. Good tutorial, but when I try to install the app using the msi file, I'm getting a loading window which closes after 2-3 sec!
    Github issue: https://github.com/electron/windows-installer/issues/255

    What's the solution for this?

    Reply
  2. this tutorial isnt working for most people in the comments. how about you use your mic and explain how to do it and how things work

    Reply
  3. Another way to make exe from an application built with Electron is BoxedApp Packer. You can see tutorial here:
    https://www.boxedapp.com/boxedapppacker/usecases/pack_electron_app_into_single_exe.html

    Reply
  4. the command i used :
    "node build.js"

    error message i got :
    "Well, sometimes you are not so lucky: Failed with exit code: 1

    Output:

    Attempting to build package from 'myapp.nuspec'.

    Description is required."

    I have followed every single step in the tutorial, yet i am getting this error. Please educate me about the same if anyone found the possible solution for the same.

    P.S.

    "devDependencies": {

    "electron": "^3.0.10"

    },

    "dependencies": {

    "electron-packager": "^12.2.0",

    "electron-squirrel-startup": "^1.0.0"

    }

    The above mentioned are the versions of the dependencies used in this project…. #Just for the reference.

    Reply
  5. I am working on react js project. i create an .exe when i install it than got error : TypeError: Cannot read property 'isBuffer' of undefined at Object.

    Reply
  6. Thank you for this tuturial. This installation is a bit too transparent for the user, is it possbile to add the standard installations pages of Windows with that let the user choose the installation path with the Next button?

    Reply
  7. $node build.js
    creating windows installer
    ENOENT: no such file or directory, open 'release-builds/VAIOTI/resources/app/package.json'

    Reply
  8. hey !
    Your code description is working fine but during building .exe file I have faced some problem.Although ".nupkg" has been created after that my console shows some error like this.

    Well, sometimes you are not so lucky: Failed with exit code: 4294967295
    Output:
    System.AggregateException: One or more errors occurred. —> System.ComponentModel.Win32Exception: The specified executable is not a valid application for this OS platform.
    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    at System.Diagnostics.Process.Start()
    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
    at Squirrel.Utility.<InvokeProcessAsync>d__11.MoveNext()
    — End of stack trace from previous location where exception was thrown —
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Squirrel.Utility.<CreateZipFromDirectory>d__23.MoveNext()
    — End of inner exception stack trace —
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
    at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, Func`2 releaseNotesProcessor, Action`1 contentsPostProcessHook)
    at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi, String
    frameworkVersion, Boolean generateDeltas)
    at Squirrel.Update.Program.executeCommandLine(String[] args)
    at Squirrel.Update.Program.main(String[] args)
    at Squirrel.Update.Program.Main(String[] args)
    —> (Inner Exception #0) System.ComponentModel.Win32Exception (0x80004005): The specified executable is not a valid application for this OS platform.
    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    at System.Diagnostics.Process.Start()
    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
    at Squirrel.Utility.<InvokeProcessAsync>d__11.MoveNext()
    — End of stack trace from previous location where exception was thrown —
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Squirrel.Utility.<CreateZipFromDirectory>d__23.MoveNext()<—
    Please guide me for solving this problem ….

    Reply
  9. I'm working in IT since 1994 and with Computer in general since 1984 but this stuff never get's easier! Everytime I see somebody messing around with a command prompt I get a seizure! It's 21 century for God sake!

    Reply
  10. While creating executable in windows 7 32 bit, IT got this error.

    failed with exit code 4294967295
    System.ComponentModel .Win32Exception: The specified executable is not a valid application for this os platform

    Reply
  11. hi… does we need nodejs or any requirements on windows ? i'm using linux for developing and want deploy to windows

    Reply
  12. Hi, I got this error

    Command failed: npm prune –production
    npm WARN test@1.0.0 No repository field.

    npm ERR! May not delete: C:UsersROMANAppDataLocalTempelectron-packagerwin
    32-x64weSolve-built-win32-x64resourcesappnode_modules.bin

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:UsersROMANAppDataRoamingnpm-cachelogs2017-07-21T14_49_58
    238Z-debug.log

    any chance you know how to fix this?
    THANKS!

    Reply
  13. I am getting this error — End of inner exception stack trace —
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
    at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, Func`2 releaseNotesProcessor, Action`1 contentsPostProcessHoo
    k)
    at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingO
    pts, String baseUrl, String setupIcon, Boolean generateMsi, String frameworkVersion, Boolean generateDeltas)
    at Squirrel.Update.Program.executeCommandLine(String[] args)
    at Squirrel.Update.Program.main(String[] args)
    at Squirrel.Update.Program.Main(String[] args)
    —> (Inner Exception #0) System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less t
    han 260 characters, and the directory name must be less than 248 characters.
    at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
    at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
    at System.IO.Directory.CreateDirectory(String path)
    at Squirrel.ReleasePackage.<>c__DisplayClass14_0.<extractZipWithEscaping>b__0()
    at System.Threading.Tasks.Task.InnerInvoke()
    at System.Threading.Tasks.Task.Execute()<—

    Reply
  14. hi
    I have some errors in creating installer.
    Help me.

    C:UsersTigerDesktopworkspaceelectron>node build.js
    Well, sometimes you are not so lucky: Failed with exit code: 1
    Output:
    Attempting to build package from 'electron_quick_start.nuspec'.
    Description is required.

    Reply
  15. Awesome tutorial for beginners. i created the app using your steps, i install the setup file it works fine for me and checked with another system it returns the error "The application requires .NET Framework 4.5. Please install the .NET Framework then run your installer again" please advice. and app first page loading take too much time in other systems

    Reply
  16. Great tutorial but I have an error when building installer: Failed with exit code 4294967295. Failed to link Wix Template setup.wixobj , error LGTH0311 Setup.wxs "A string was provided with characters that are not available in the specified database code page '1252'. And no installer is created. In Windows.

    Reply
  17. i have ERROR 'electron-packager' is not recognized as an internal or external command,
    operable program or batch file.

    Reply
  18. Amazing video again thnx. in the future when I build my electron app I need to update the app but I don't know how to do it, I have some ideas to make a repository on GitHub and I make 2 versions 1 for staging and 1 more the real app. now how I gonna make a change on the app (update) and this update is gonna install automatically for all the users like for example the visual studio code sometimes have something popups and is say update is available and if you click update now is gonna update the app you know what is the best method to do this, or other methods . between my app environment is with NWJS like the electron. thnx if you read my msg.

    Reply

Leave a Comment