electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

standby.mp4 File Not Unpacked Properly During Installation Despite Correct Packaging

Open necro-wbj opened this issue 1 year ago • 1 comments

Electron-Builder Version: 24.13.3 Node Version: v20.9.0 Electron Version: 32.0.1 Electron-Updater Version: 6.3.0 Target: windows, NSIS,

Issue: I am encountering an issue where a file named standby.mp4 is not being unpacked as expected, even though I have configured "asar": false in my Electron build settings. The standby.mp4 file is correctly included in the dist/win-unpacked/UI directory, but after installation, the file is missing from the installation directory. Upon investigation, I found that the file is still being included inside the app.asar archive, despite my configuration.

Steps to Reproduce:

Configure electron-builder with the following build settings in package.json:

"build": {
  "extraFiles": [
    {
      "from": "UI/standby.mp4",
      "to": "UI/standby.mp4"
    }
  ],
  "asar": false
}

Build the Electron application using electron-builder. Inspect the dist/win-unpacked directory and observe that standby.mp4 is correctly placed in UI/standby.mp4. Install the built application and notice that standby.mp4 is missing from the installation directory. Expected Behavior: The standby.mp4 file should be unpacked into the installation directory as a standalone file and not included inside the app.asar archive when asar is set to false.

Actual Behavior: The standby.mp4 file is missing from the installation directory but is included inside the app.asar archive, even though asar is set to false.

Additional Information:

If I rename standby.mp4 to standby.test, the file is correctly unpacked as expected. This issue suggests that specific file types (such as .mp4) might be inadvertently excluded or not handled correctly during the packaging process.

necro-wbj avatar Aug 27 '24 08:08 necro-wbj

it seems not the mp4 problem. I see the nsis file size is changing to 0 and setup file not changed. maybe the nsis quit for big file,so Weird

chenyuncai avatar Nov 16 '24 18:11 chenyuncai

same issus here; you need to config the precompressedfileextensions option, https://www.electron.build/nsis.html#precompressedfileextensions, and delete the .mp4

WShiBin avatar Feb 25 '25 07:02 WShiBin

same issus here; you need to config the precompressedfileextensions option, https://www.electron.build/nsis.html#precompressedfileextensions, and delete the .mp4

This is usefull, Thank you!

yuerugoutql avatar Mar 04 '25 12:03 yuerugoutql

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Apr 04 '25 00:04 github-actions[bot]

@mmaietta Do you know why does the packaging process for .exe files default to filtering out video formats like .mp4?

beyondkmp avatar Apr 07 '25 07:04 beyondkmp

 file=~\node_modules\7zip-bin\win\x64\7za.exe args=a -bd -mx=9 -md=1m -mtc=off -ms=off -mtm=off -mta=off application\dist\TestApp-25.1.3611-x64.nsis.7z . -xr!*.avi -xr!*.mov -xr!*.m4v -xr!*.mp4 -xr!*.m4p -xr!*.qt -xr!.mkv -xr!.webm -xr!*.vmdk cwd=application\dist\win-unpacked

Instead of using -xr!*.mp4 to exclude these file formats, the parameter -m0=*.mp4 should be used to specify that such files are stored without compression. This is because video format files are usually already compressed, so further compression would be meaningless.

beyondkmp avatar Apr 07 '25 08:04 beyondkmp

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar May 08 '25 00:05 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar Jun 07 '25 00:06 github-actions[bot]

I wonder this too. I have some .mp4 files I want to copy over to the installer package as extraFiles. If I don't supply a preCompressedFileExtensions option omitting mp4's, I don't get the .mp4 files in the package.

baranelitez avatar Jun 13 '25 07:06 baranelitez