File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed
Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change 1- import { app } from 'electron'
21import { execFile } from 'child_process'
32import { SerialPortStream } from '@serialport/stream'
43import type { AutoDetectTypes } from '@serialport/bindings-cpp'
54import { createRequire } from 'module'
6- import path from 'path'
75import { promisify } from 'util'
86import { OsrSerialPortInfo , OsrSerialState } from '../src/types'
97
@@ -229,19 +227,9 @@ function getSerialPortBinding(): SerialPortBinding {
229227 return cachedBinding
230228 }
231229
232- const bindingsModule = app . isPackaged
233- ? runtimeRequire (
234- path . join (
235- process . resourcesPath ,
236- 'app.asar.unpacked' ,
237- 'node_modules' ,
238- '@serialport' ,
239- 'bindings-cpp' ,
240- 'dist' ,
241- 'index.js' ,
242- ) ,
243- )
244- : runtimeRequire ( '@serialport/bindings-cpp' )
230+ // Keep JS dependency resolution inside app.asar. Electron still resolves the
231+ // unpacked native addon from the package when needed.
232+ const bindingsModule = runtimeRequire ( '@serialport/bindings-cpp' )
245233
246234 cachedBinding = ( bindingsModule as { autoDetect : ( ) => SerialPortBinding } ) . autoDetect ( )
247235 return cachedBinding
Original file line number Diff line number Diff line change 11{
22 "name" : " scriptplayer-plus" ,
3- "version" : " 0.1.5-exp.6 " ,
3+ "version" : " 0.1.5-exp.7 " ,
44 "description" : " ScriptPlayer+ - Funscript video player with Handy and Intiface support" ,
55 "license" : " PolyForm-Noncommercial-1.0.0" ,
66 "main" : " dist-electron/main.js" ,
You can’t perform that action at this time.
0 commit comments