Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You must install both Mono and Wine on non-Windows #3778

Open
3 tasks done
guy-bartkus opened this issue Dec 7, 2024 · 2 comments
Open
3 tasks done

You must install both Mono and Wine on non-Windows #3778

guy-bartkus opened this issue Dec 7, 2024 · 2 comments
Labels
blocked/needs-info Issues lacking information for resolution maker/squirrel platform/windows

Comments

@guy-bartkus
Copy link

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.6.0

Electron version

v33.2.1

Operating system

Linux Mint 22

Last known working Electron Forge version

No response

Expected behavior

npm run make -- --platform win32 should make a windows installer.

Actual behavior

Already installed wine32 and mono-xsp4 using sudo dpkg --add-architecture i386 && sudo apt install wine32 mono-xsp4, but error implies one or both is not installed.

~/Documents/Projects/Node/worldbuilder$ npm run make -- --platform win32

> [email protected] make
> electron-forge make --platform win32

✔ Checking your system
✔ Loading configuration
✔ Resolving make targets
  › Making for the following targets:
✔ Running package command
  ✔ Preparing to package application
  ✔ Running packaging hooks
    ✔ Running generateAssets hook
    ✔ Running prePackage hook
  ✔ Packaging application
    ✔ Packaging for x64 on win32 [10s]
  ✔ Running postPackage hook
✔ Running preMake hook
❯ Making distributables
  ✖ Making a squirrel distributable for win32/x64
    › You must install both Mono and Wine on non-Windows
◼ Running postMake hook

An unhandled rejection has occurred inside Forge:
Error: You must install both Mono and Wine on non-Windows
at /home/guy/Documents/Projects/Node/worldbuilder/node_modules/electron-winstaller/lib/index.js:128:31
    at step (/home/guy/Documents/Projects/Node/worldbuilder/node_modules/electron-winstaller/lib/index.js:56:23)
    at Object.next (/home/guy/Documents/Projects/Node/worldbuilder/node_modules/electron-winstaller/lib/index.js:37:53)
    at fulfilled (/home/guy/Documents/Projects/Node/worldbuilder/node_modules/electron-winstaller/lib/index.js:28:58)

My forge.config.js:

const { FusesPlugin } = require('@electron-forge/plugin-fuses');
const { FuseV1Options, FuseVersion } = require('@electron/fuses');

module.exports = {
	packagerConfig: {
		asar: true,
	},
	rebuildConfig: {},
	makers: [
		{
			name: '@electron-forge/maker-squirrel',
			config: {
				icon: "icons/icon.ico"
			},
		}
	],
	plugins: [
		{
			name: '@electron-forge/plugin-auto-unpack-natives',
			config: {},
		},
		// Fuses are used to enable/disable various Electron functionality
		// at package time, before code signing the application
		new FusesPlugin({
			version: FuseVersion.V1,
			[FuseV1Options.RunAsNode]: false,
			[FuseV1Options.EnableCookieEncryption]: true,
			[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
			[FuseV1Options.EnableNodeCliInspectArguments]: false,
			[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
			[FuseV1Options.OnlyLoadAppFromAsar]: true,
		}),
	],
};

Steps to reproduce

Install wine32 and mono-xsp4 using sudo dpkg --add-architecture i386 && sudo apt install wine32 mono-xsp4, then run npm run make -- --platform win32 on linux.

Additional information

No response

@erickzhao
Copy link
Member

The check in electron-winstaller is fairly naive:

  const monoExe = 'mono';
  const wineExe = ['arm64', 'x64'].includes(process.arch) ? 'wine64' : 'wine';

  if (process.platform !== 'win32') {
    useMono = true;
    const [hasWine, hasMono] = await Promise.all([
      checkIfCommandExists(wineExe),
      checkIfCommandExists(monoExe)
    ]);

    if (!hasWine || !hasMono) {
      throw new Error('You must install both Mono and Wine on non-Windows');
    }

https://github.com/electron/windows-installer/blob/4e6d76c83b2bb81e838c46c490d4e801745d2636/src/index.ts#L55-L67

Does running these commands locally work for you?

@erickzhao erickzhao added platform/windows blocked/needs-info Issues lacking information for resolution maker/squirrel labels Dec 9, 2024
@tuckerww
Copy link

tuckerww commented Dec 23, 2024

I began to get this error after I updated my OS from Ubuntu 20 to 24. I was able to get the error to go away by symlinking wine64 to wine in /usr/bin/. Not sure if there's something else more proper that I should have done instead, either in the forge-config, or with some architetcure flags passed to npm run make. But this worked.

$ which wine
/usr/bin/wine
$ which wine64    # returned nothing
$ cd /usr/bin
$ sudo ln -s wine wine64
$ cd /back/to/project/directory/
$ npm run make -- --platform=win32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/needs-info Issues lacking information for resolution maker/squirrel platform/windows
Projects
None yet
Development

No branches or pull requests

3 participants