Cross-compile a distributed Electron App
Greg, The JavaScript Whisperer

Greg, The JavaScript Whisperer @jswhisperer

About: Specialist in performance oriented javascript architecture for web, mobile, client and server side. Passionate about realtime web.

Location:
London, UK
Joined:
May 13, 2017

Cross-compile a distributed Electron App

Publish Date: Oct 17 '24
1 1

Another quick post, I see a lot of developers would rather complain on github than go into hacker mode and solve their issue.

My last post around LiveCaptioning mentions WhisperScript a macOS only electron app. On the thread there are (rightly so) 50ish complaints about it not being availalbe for Windows or Linux.

Let's fix that! Electron was great back in the day, but security was never one of them. A lot of these app even commercially distributed unknowingly I hope, ship there source code. 🫨🫨🫨

An electron package app format is called ASAR, and luckily for us you can unpack it, it's basically a zip or rar type compression format.

Easiest if you can install to say mac then right click and show package contents.

Image description

Let's find the ASAR here, Contents/Resources

Image description

Now one liner npx asar pack untouched app.asar

Naviagte to the newly created "app" folder install the deps eg. yarn

and repackage npx electron-forge package --platform=win32 --arch="x64"

windows users rejoice, there may be additional fiddling with native binaries etc but this is 90% the work.

It is important to of course only do this on properly licensed (APACHE etc) or rather unlicensed software.

We are in luck
Image description

Comments 1 total

  • Greg, The JavaScript Whisperer
    Greg, The JavaScript WhispererOct 17, 2024

    If you are compiling from macOS to Windows you will need Wine... to drink optional but the app. brew install --cask wine-stable

Add comment