Skip to content

Instantly share code, notes, and snippets.

View steve981cr's full-sized avatar

Steve C. steve981cr

  • San Francisco, CA
View GitHub Profile
@steve981cr
steve981cr / electron-store-fix.md
Created August 30, 2023 20:17
Electron-Store interim fix to Electron Forge packaging error

Electron-Store interim fix to Electron Forge packaging error

The problem: Electron's recommended app packager is Electron Forge. My app uses electron-store to persist small amounts of data used in the main process. It works fine in development mode but for some reason when I package the app with Electron-forge it will thrown an error and crash the app.

Interim solution: My solution was to build my own super simple storage module using the same file and method names used by electron store. It is not as robust as electron-store but it was sufficient for my needs so I thought I would pass this on to anyone else running into this issue. This is not an npm package, rather you can just copy the code below to make your own local module. If you are already using electron-store you do not have to modify any of your code except for adding the relative path to your module in the require statement.


Electron-store.js

Create a file named electron

@steve981cr
steve981cr / How-to-Release-an-Electron-App-on-the-Microsoft-Store.md
Last active October 11, 2024 03:14
Step by step instructions on how to release an Electron app on the Microsoft Store. Uses Electron-builder to package the app.
@steve981cr
steve981cr / How-to-Release-an-Electron-App-on-the-Mac-App-Store.md
Last active November 7, 2024 10:37
Step by step instructions on how to release an Electron app on the Mac App Store. Uses Electron-builder to package the app.

Self Sign a Windows Desktop Application with SignTool

Requires PowerShell to be installed on your PC. Will require installing the signtool which is part of Windows SDK. There are 4 major steps.

Step 1) Get your Microsoft Developer Publisher Id

Go to partner.microsoft.com/en-us/dashboard/apps-and-games > Select your app > click Product Identity > Copy the Package/Identity/Publisher value.
It should be formatted something like CN=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX replacing the Xs with hexadecimal characters.

Step 2) Create a self signed certificate

Use the New-SelfSignedCertificate PowerShell cmdlet.