1

Asking again 'cause I havent had any luck finding this information. Does anyone know where I can find the documentation or steps to package my Electron app for Windows on a Mac running OS Catalina(10.15)? I've successfully published for DMG and and .zip for Mac OS. Using electron-forge currently.

I read the Electron documentation to use wine or mono and I installed both, but I'm not sure what to do after that. I tried running the electron-packager after installing both but it still ignores the squirrel-maker for Windows. Tried running electron-make and publish, all ignore the squirrel-maker.

I got an error once that I needed to use 'electron-compile' but when I installed it and tried using it, it kept throwing an error on my source code when it would come across a dot operator for arrays or objects? Ex:

let object = {Name:"Something"}
let object2 = {Age:20}
let newObject = {
   ...object,
   ...object2
}

Would throw an error when trying to use the 'electron-compile' framework.

Really trying to avoid flipping back and forth between Windows and Mac on my mac and having to install electron on both platforms. package.json file:

"name": "MyApp",
  "productName": "My Fantastic App",
  "version": "1.1.4",
  "description": "The worlds most boring app.",
  "main": "src/index.js",
  "scripts": {
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "publish": "electron-forge publish",
    "lint": "echo \"No linting configured\"",
    "dist": "build",
    "build": "electron-builder build --dir"
  },
  "keywords": [],
  "author": "sychordCoder",
  "license": "MIT",
  "config": {
    "forge": "./custom-not.js"
  },
  "dependencies": {
    "dotenv": "^9.0.2",
    "electron-dl": "^3.2.1",
    "electron-is-dev": "^2.0.0",
    "electron-log": "^4.3.5",
    "electron-squirrel-startup": "^1.0.0",
    "electron-updater": "^4.3.9",
    "firebase": "^8.6.2",
    "jquery": "^3.6.0",
    "pug": "^3.0.2"
  },
  "devDependencies": {
    "@electron-forge/cli": "^6.0.0-beta.54",
    "@electron-forge/maker-deb": "^6.0.0-beta.54",
    "@electron-forge/maker-dmg": "^6.0.0-beta.54",
    "@electron-forge/maker-rpm": "^6.0.0-beta.54",
    "@electron-forge/maker-squirrel": "^6.0.0-beta.54",
    "@electron-forge/maker-zip": "^6.0.0-beta.54",
    "@electron-forge/publisher-github": "^6.0.0-beta.54",
    "electron": "^12.0.0",
    "uglify-js": "^3.13.7"
  }
}

This is my config js file:

module.exports = {
  packagerConfig: {
    name: 'MyApp',
    executableName: 'MyApp',
    asar: true,
    icon: 'src/images/icon128@2x',
    ignore: ["file1source.js","file2source.js"],
    appBundleId: 'MyAppId',
    osxSign: {
      identity: 'Developer ID Application: John Smith(90210)',
      hardenedRuntime: true,
      'gatekeeper-assess': false,
      entitlements: 'static/entitlements.plist',
      'entitlements-inherit': 'static/entitlements.plist',
      'signature-flags': 'library'
    },
    osxNotarize: {
      appleId: process.env.APPLE_ID,
      appleIdPassword: process.env.APPLE_PASSWORD
    }
  },
  makers: [
    {
      name: '@electron-forge/maker-squirrel',
      platforms: [
            "win32"
          ],
      config: {
        name: 'MyApp',
        description: 'The worlds most boring app.',
        version: '1.1.4'
      }
    },
    {
      name: '@electron-forge/maker-zip',
      platforms: [
        'darwin'
      ]
    },
    {
      name: '@electron-forge/maker-deb',
      config: {}
    },
    {
      name: '@electron-forge/maker-rpm',
      config: {}
    },
    {
      name: '@electron-forge/maker-dmg',
      config: {
        overwrite:true,
        icon: 'src/images/icon128@2x.icns'
      }
    }
  ],
  publishers: [
    {
      name: '@electron-forge/publisher-github',
      config: {
        repository: {
          owner: 'githubOwner',
          name: 'gitHubReleases'
        },
        prerelease: false,
        releaseType: "release",
        authToken: process.env.GH_TOKEN
      }
    }
  ]
}

Any help is greatly appreciated. Thank you,

sychordCoder
  • 230
  • 3
  • 14

1 Answers1

0

you should open the wine terminal to run command of build electron.

SEOZEN
  • 21
  • 3