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

.exe files not included in package after upgrading from 25.1.8 to 26.0.12

Open oinochoe opened this issue 8 months ago • 5 comments

Electron-Builder Version: 26.0.12 Node Version: 20.10.0 Electron Version: 35.2.1 Electron Type (current, beta, nightly): current Target: squirrel

After upgrading from version 25.1.8 to 26.0.12, I've encountered an issue with the packaging process. In version 25.1.8, .exe extension files were properly included in the package. However, after upgrading to version 26.0.12, .exe files are no longer being included in the package. I also upgraded the squirrel version along with this update.

Steps to reproduce:

  1. Package a project containing .exe files using version 25.1.8 → .exe files are properly included
  2. Upgrade to version 26.0.12 and electron-builder-squirrel
  3. Package the same project → .exe files are missing from the package

Could this issue be related to the electron-builder-squirrel upgrade rather than electron-builder itself? Has anyone else experienced similar issues with .exe files not being included after upgrading both components?

oinochoe avatar May 08 '25 06:05 oinochoe

Can you share a sample project or minimum repro repo? We can debug further from there.

@beyondkmp can you take a look at this when you have a chance?

mmaietta avatar May 12 '25 00:05 mmaietta

@mmaietta , @beyondkmp After "squirrel" packaging, all the files set in "extraFiles" are present in "win-unpacked", but after actual installation, only the dll files are included, and the others are missing.

This issue occurs in version 26.0.12, while in version 25.1.8, all files are properly included. Additionally, upon checking the logs, I confirmed that in version 25.1.8, "Squirrel.Windows-1.9.0" is downloaded and used, but in 26.0.12, there are no separate files being downloaded. (I changed the versions of both the "electron-builder" and "electron-builder-squirrel-windows" packages together.)

I am uploading a sample project zip file.

Sample.zip

kikimong30 avatar May 12 '25 09:05 kikimong30

Solution here: https://github.com/electron-userland/electron-builder/issues/9124#issuecomment-2908612024

bennyschmidt avatar May 26 '25 04:05 bennyschmidt

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  <metadata>
    <id><%- name %></id>
    <title><%- title %></title>
    <version><%- version %></version>
    <authors><%- authors %></authors>
    <owners><%- owners %></owners>
    <iconUrl><%- iconUrl %></iconUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description><%- description %></description>
    <copyright><%- copyright %></copyright>
  </metadata>
  <files>
    <file src="locales\**" target="lib\net45\locales" />
    <file src="resources\**" target="lib\net45\resources" />
    <file src="*.bin" target="lib\net45" />
    <file src="*.dll" target="lib\net45" />
    <file src="*.pak" target="lib\net45" />
    <file src="*.exe.config" target="lib\net45" />
    <file src="*.exe.sig" target="lib\net45" />
    <file src="icudtl.dat" target="lib\net45\icudtl.dat" />
    <file src="Squirrel.exe" target="lib\net45\squirrel.exe" />
    <file src="LICENSE" target="lib\net45\LICENSE" />
    <file src="<%- exe %>" target="lib\net45\<%- exe %>" />
    <% additionalFiles.forEach(function(f) { %>
    <file src="<%- f.src %>" target="<%- f.target %>" />
    <% }); %>
  </files>
</package>

It looks like the template has restricted only certain files to be moved under the root directory.

beyondkmp avatar May 29 '25 01:05 beyondkmp

@beyondkmp

Looking at the test file you provided, we declared that exe file extensions should be included within extraFiles, and after the build, we confirmed that they remain properly in the unpack folder. However, when we actually install the app, they are not remaining. We are not using nuget packages, and our environment is Electron + React. I'm also curious if there have been any recent changes regarding how file paths are resolved, such as whether they are searched using absolute paths or relative paths.

This is package.json file.

{
	"name": "my-app",
	"appName": "My First App",
	"version": "1.0.6",
	"description": "",
	"main": "main.js",
	"author": "RTS",
    "authors": [
        "RTS"
    ],
	"scripts": {
		"start": "electron .",
		"publish": "electron-builder --win"
	},
	"license": "ISC",
	"devDependencies": {
		"electron": "35.2.1",
		"electron-builder": "26.0.12",
		"electron-builder-squirrel-windows": "26.0.12"
	},
	"build": {
		"productName": "My First App",
		"win": {
			"target": ["squirrel"],
			"icon": "./resource/app.ico"
		},
		"directories":{
			"output":"squirrelTest/",
			"buildResources": "resource"
		},
		"squirrelWindows": {
            "iconUrl": "https://test/image.png",
            "loadingGif": "./resource/loading.gif"
        },
		"extraFiles":[
			"steam_api.dll",
			"test.txt",
			"test2.json",
			"test3.exe",
			"test4.exe"
		]
	},
	"dependencies": {
		"electron-log": "^2.2.9",
		"electron-updater": "^4.0.0"
	}
}

And to help with understanding, I'm attaching images showing the directory structure when electron-builder is unpacked and the directory structure of the Local folder when actually installed.

Unpack directory Image

Installed directory Image

Check again plz... 😄 cc @kikimong30

oinochoe avatar May 29 '25 02:05 oinochoe