Electron wix 安装程序图标

Electron wix installer icon

你好,我叫Alexie,

我的问题是如何从配置中将图标放入 electron wix 安装程序?

代码如下:

const msiCreator = new MSICreator({
    appDirectory: APP_DIR,
    outputDirectory: OUT_DIR,

    // Configure metadata
    description: 'Optimum cuts',
    exe: 'HyperCut',
    name: 'HyperCut',
    manufacturer: 'Omifa',
    version: '1.0.0',

    // Configure installer User Interface
    ui: {
        enabled: true,
        chooseDirectory: true,
        images: {
            banner: __dirname + '\ico\logo.png',
            background: __dirname + '\ico\logo_m.jpg'
        }
    },
});

我在 Angular 应用程序中使用 Electron。 我用于图标的代码是下一个:

// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
const path = require('path')

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow

function createWindow() {
    // Create the browser window.
    mainWindow = new BrowserWindow({
        width: 2024,
        height: 1768,
        minWidth: 400,
        minHeight: 200,
        resizable: true,
        backgroundColor: '#222',
        center: true,
        autoHideMenuBar: true,
        icon: 'produccion.ico',
        label: 'FromScratch',
        title: '',
        webPreferences: {
            preload: path.join(__dirname, 'preload.js')
        }
    })

    // and load the index.html of the app.
    mainWindow.loadFile('Produccion/dist/index.html')

    mainWindow.maximize()

    // Open the DevTools.
    // mainWindow.webContents.openDevTools()

    // Emitted when the window is closed.
    mainWindow.on('closed', function() {
        // Dereference the window object, usually you would store windows
        // in an array if your app supports multi windows, this is the time
        // when you should delete the corresponding element.
        mainWindow = null
    })
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)

// Quit when all windows are closed.
app.on('window-all-closed', function() {
    // On macOS it is common for applications and their menu bar
    // to stay active until the user quits explicitly with Cmd + Q
    if (process.platform !== 'darwin') app.quit()
})

app.on('activate', function() {
    // On macOS it's common to re-create a window in the app when the
    // dock icon is clicked and there are no other windows open.
    if (mainWindow === null) createWindow()
})