electron / windows-installer

Build Windows Installers for Electron apps
MIT License
1.58k stars 261 forks source link

Why does it produce a tgz file containing my source code? #297

Closed J-Cake closed 4 years ago

J-Cake commented 5 years ago

I've got the following script:

const winstaller = require('electron-winstaller');
const path = require('path');

resultPromise = winstaller.createWindowsInstaller({
    appDirectory: './release-builds/<Packaged App Name>-win32-ia32/',
    outputDirectory: '/release-builds/installers',
    authors: '<Devs names>',
    exe: '<Output>.exe',
    loadingGif: path.join(__dirname, 'src', 'res', 'Installer-backdrop.gif'),
    iconUrl: path.join(__dirname, 'src', 'res', 'favicon.ico')
});

resultPromise.then(() => console.log("It worked!"), (e) => console.log(`No dice: ${e.message}`));

and when I run it, nothing but a tgz file in my root dir. When extracting it, I get nothing but the unbuilt react app. Mind you, I used the electron-packager on the output of the react build but still, only a .tgz. Why?

kaatt commented 4 years ago

For posterity, this happened to me because I set scripts.pack in package.json to my electron build command and npm/yarn pack is a predefined command: https://yarnpkg.com/lang/en/docs/cli/pack/

J-Cake commented 4 years ago

Oh gosh this was a while ago, I don't even have that project anymore.

But thanks for the response. This will certainly help others.