Electron creates a html file and loads it, and after it is packaged into an exe file, the created file fails?

Hello everyone, I would like to ask a question, I use electron in the process of program execution using the template engine to create different html files, and use BrowserWindow.loadURL to load, there is no problem when debugging under Ubuntu, but after being packaged into exe files, when running on the Windows platform, the creation of html files failed, resulting in loading failure, how to solve this file?
I checked that the packaging program will package the files under Ubuntu into asar files, which is equivalent to a compressed encrypted file, which is readable only, so electron can read it, but it cannot be modified. Is there any good solution for this situation?

Mar.18,2022

if you use electron-builder for packaging, you can set

in package.json .
build: {
    asar: false
}

to prevent app from being packaged as an asar file

Menu