Beispiel #1
0
    function packageInstaller(cb_) {
      console.log('Windows: Creating installer...');

      installer.createWindowsInstaller({
        appDirectory: buildPath[0],
        authors: pkg.description,
        description: APP_NAME,
        exe: `${APP_NAME}.exe`,
        iconUrl: `${GITHUB_URL_RAW}/scripts/static/icon.ico`,
        loadingGif: path.join(STATIC_PATH, 'loading.gif'),
        name: APP_NAME,
        noMsi: true,
        outputDirectory: DIST_PATH,
        productName: APP_NAME,
        remoteReleases: GITHUB_URL,
        setupExe: `${BUILD_NAME}-win32-setup-${destArch}.exe`,
        setupIcon: `${APP_ICON}.ico`,
        signWithParams,
        title: APP_NAME,
        usePackageJson: false,
        version: APP_VERSION
      }).then(() => {
        console.log('Windows: Created installer.');
        cb_(null);
      }).catch(cb_);
    }
Beispiel #2
0
  electronPackager(Object.assign({}, all, win32), function (err, buildPath) {
    if (err) return cb(err)

    console.log('Creating Windows installer...')
    installer.createWindowsInstaller({
      name: config.APP_NAME,
      productName: config.APP_NAME,
      title: config.APP_NAME,
      exe: config.APP_NAME + '.exe',

      appDirectory: buildPath[0],
      outputDirectory: path.join(config.ROOT_PATH, 'dist'),
      version: pkg.version,
      description: config.APP_NAME,
      authors: config.APP_TEAM,
      iconUrl: config.APP_ICON + '.ico',
      setupIcon: config.APP_ICON + '.ico',
      // certificateFile: '', // TODO
      usePackageJson: false,
      loadingGif: path.join(config.STATIC_PATH, 'loading.gif')
    }).then(function () {
      console.log('Created Windows installer.')
      cb(null, buildPath)
    }).catch(cb)
  })
Beispiel #3
0
    function packageInstaller (cb) {
      console.log('Windows: Creating installer...')

      installer.createWindowsInstaller({
        appDirectory: buildPath[0],
        authors: config.APP_TEAM,
        description: config.APP_NAME,
        exe: config.APP_NAME + '.exe',
        iconUrl: config.GITHUB_URL_RAW + '/static/' + config.APP_NAME + '.ico',
        loadingGif: path.join(config.STATIC_PATH, 'loading.gif'),
        name: config.APP_NAME,
        noMsi: true,
        outputDirectory: DIST_PATH,
        productName: config.APP_NAME,
        remoteReleases: config.GITHUB_URL,
        setupExe: config.APP_NAME + 'Setup-v' + config.APP_VERSION + '.exe',
        setupIcon: config.APP_ICON + '.ico',
        signWithParams: signWithParams,
        title: config.APP_NAME,
        usePackageJson: false,
        version: pkg.version
      })
      .then(function () {
        console.log('Windows: Created installer.')
        cb(null)
      })
      .catch(cb)
    }
module.exports = (packagedAppPath) => {
  const archSuffix = process.arch === 'ia32' ? '' : '-' + process.arch
  const options = {
    appDirectory: packagedAppPath,
    authors: 'GitHub Inc.',
    iconUrl: `https://raw.githubusercontent.com/atom/atom/master/resources/app-icons/${CONFIG.channel}/atom.ico`,
    loadingGif: path.join(CONFIG.repositoryRootPath, 'resources', 'win', 'loading.gif'),
    outputDirectory: CONFIG.buildOutputPath,
    noMsi: true,
    remoteReleases: `https://atom.io/api/updates${archSuffix}?version=${CONFIG.appMetadata.version}`,
    setupIcon: path.join(CONFIG.repositoryRootPath, 'resources', 'app-icons', CONFIG.channel, 'atom.ico')
  }

  const cleanUp = () => {
    for (let nupkgPath of glob.sync(`${CONFIG.buildOutputPath}/*.nupkg`)) {
      if (!nupkgPath.includes(CONFIG.appMetadata.version)) {
        console.log(`Deleting downloaded nupkg for previous version at ${nupkgPath} to prevent it from being stored as an artifact`)
        fs.removeSync(nupkgPath)
      }
    }
  }

  console.log(`Creating Windows Installer for ${packagedAppPath}`)
  return electronInstaller.createWindowsInstaller(options)
    .then(cleanUp, error => {
      cleanUp()
      return Promise.reject(error)
    })
}
  electronPackager(Object.assign({}, all, win32), function (err, buildPath) {
    if (err) return cb(err)

    console.log('Creating Windows installer...')
    installer.createWindowsInstaller({
      appDirectory: buildPath[0],
      authors: config.APP_TEAM,
      // certificateFile: '', // TODO
      description: config.APP_NAME,
      exe: config.APP_NAME + '.exe',
      iconUrl: config.GITHUB_URL_RAW + '/static/' + config.APP_NAME + '.ico',
      loadingGif: path.join(config.STATIC_PATH, 'loading.gif'),
      remoteReleases: config.GITHUB_URL,
      name: config.APP_NAME,
      noMsi: true,
      outputDirectory: path.join(config.ROOT_PATH, 'dist'),
      productName: config.APP_NAME,
      setupExe: config.APP_NAME + 'Setup-v' + config.APP_VERSION + '.exe',
      setupIcon: config.APP_ICON + '.ico',
      title: config.APP_NAME,
      usePackageJson: false,
      version: pkg.version
    }).then(function () {
      console.log('Created Windows installer.')
      cb(null, buildPath)
    }).catch(cb)
  })
Beispiel #6
0
gulp.task('bundle_windows', ['bundle_electron_package'], function(done){
	electronInstaller.createWindowsInstaller({
		appDirectory: 'bin/portable/MailboxExplorer-win32-x64',
		outputDirectory: 'bin/win32-x64',
		authors: 'Gyuris Bence',
		noMsi: true,
        iconUrl: "https://raw.githubusercontent.com/gyurisb/mailbox-app/master/src/desktop/appicon.ico",
        setupIcon: "dist/desktop/appicon.ico"
	}).then(() => done(), (e) => done(e));
});
gulp.task('make:win', ['package:win'], (done) => {
  electronInstaller(winstallerConfig)
    .then(() => {
      exec(`vendor\\signtool sign /f ".cert.pfx" /p ${process.env.SIGN_CERT_PASS} /fd sha1 /tr "http://timestamp.geotrust.com/tsa" /v /as "dist/win32/${packageJSON.productName}Setup.exe"`, {}, () => {
        exec(`vendor\\signtool sign /f ".cert.pfx" /p ${process.env.SIGN_CERT_PASS} /fd sha256 /tr "http://timestamp.geotrust.com/tsa" /v /as "dist/win32/${packageJSON.productName}Setup.exe"`, {}, () => {
          done();
        });
      });
    });
});
Beispiel #8
0
gulp.task('build-installer', ['build'], (done) => {
  electronInstaller.createWindowsInstaller({
    appDirectory: './out/Hain-win32-ia32',
    outputDirectory: './out',
    authors: 'Heejin Lee',
    title: 'Hain',
    iconUrl: 'https://raw.githubusercontent.com/appetizermonster/Hain/master/build/icon.ico',
    setupIcon: path.resolve('./build/icon.ico'),
    noMsi: true
  }).then(() => {
    fs.renameSync('./out/Setup.exe', './out/HainSetup-ia32.exe');
    done();
  }).catch((err) => done(err));
});
Beispiel #9
0
 return new Promise((resolve, reject) => {
   console.log('[START] Electron Winstaller')
   electronInstaller.createWindowsInstaller({
     appDirectory: './WMail-win32-ia32',
     authors: pkg.author,
     noMsi: true,
     outputDirectory: './WMail-win32-ia32-Installer',
     setupExe: 'WMail Setup.exe',
     setupIcon: path.resolve('./icons/app.ico')
   }).then(() => {
     console.log('[FINISH] Electron Winstaller')
     resolve()
   }).catch(reject)
 })
Beispiel #10
0
const createInstaller = (buildPath, cb) => {
  createWindowsInstaller({
    appDirectory: buildPath[0],
    outputDirectory: 'release/win32',
    authors: 'Alexandre',
    title: 'Getsub',
    noMsi: true,
    setupIcon: './statics/icon.ico',
    setupExe: 'setup-getsub.exe',
    exe: 'getsub.exe'
  })
  .then(cb)
  .catch(cb)
}
Beispiel #11
0
gulp.task('build-installer', ['build'], (done) => {
  const filename = `HainSetup-${ARCH}-v${appPkg.version}.exe`;
  electronInstaller.createWindowsInstaller({
    appDirectory: `./out/Hain-win32-${ARCH}`,
    outputDirectory: './out',
    authors: 'Heejin Lee',
    title: 'Hain',
    iconUrl: 'https://raw.githubusercontent.com/appetizermonster/Hain/master/build/icon.ico',
    setupIcon: path.resolve('./build/icon.ico'),
    loadingGif: path.resolve('./build/installer.gif'),
    noMsi: true
  }).then(() => {
    fs.renameSync('./out/Setup.exe', `./out/${filename}`);
    done();
  }).catch((err) => done(err));
});
module.exports = (packagedAppPath) => {
  const archSuffix = process.arch === 'ia32' ? '' : '-' + process.arch
  const options = {
    appDirectory: packagedAppPath,
    authors: 'GitHub Inc.',
    iconUrl: `https://raw.githubusercontent.com/atom/atom/master/resources/app-icons/${CONFIG.channel}/atom.ico`,
    loadingGif: path.join(CONFIG.repositoryRootPath, 'resources', 'win', 'loading.gif'),
    outputDirectory: CONFIG.buildOutputPath,
    noMsi: true,
    noDelta: CONFIG.channel === 'nightly', // Delta packages are broken for nightly versions past nightly9 due to Squirrel/NuGet limitations
    remoteReleases: `https://atom.io/api/updates${archSuffix}?version=${CONFIG.computedAppVersion}`,
    setupExe: `AtomSetup${process.arch === 'x64' ? '-x64' : ''}.exe`,
    setupIcon: path.join(CONFIG.repositoryRootPath, 'resources', 'app-icons', CONFIG.channel, 'atom.ico')
  }

  const cleanUp = () => {
    const releasesPath = `${CONFIG.buildOutputPath}/RELEASES`
    if (process.arch === 'x64' && fs.existsSync(releasesPath)) {
      fs.renameSync(releasesPath, `${releasesPath}-x64`)
    }

    for (let nupkgPath of glob.sync(`${CONFIG.buildOutputPath}/atom-*.nupkg`)) {
      if (!nupkgPath.includes(CONFIG.computedAppVersion)) {
        console.log(`Deleting downloaded nupkg for previous version at ${nupkgPath} to prevent it from being stored as an artifact`)
        fs.unlinkSync(nupkgPath)
      } else {
        if (process.arch === 'x64') {
          // Use the original .nupkg filename to generate the `atom-x64` name by inserting `-x64` after `atom`
          const newNupkgPath = nupkgPath.replace('atom-', 'atom-x64-')
          fs.renameSync(nupkgPath, newNupkgPath)
        }
      }
    }

    return `${CONFIG.buildOutputPath}/${options.setupExe}`
  }

  console.log(`Creating Windows Installer for ${packagedAppPath}`)
  return electronInstaller.createWindowsInstaller(options)
    .then(cleanUp, error => {
      cleanUp()
      return Promise.reject(error)
    })
}
Beispiel #13
0
function buildInstaller(arch) {
  const filename = `HainSetup-${arch}-v${appPkg.version}.exe`;
  return electronInstaller
    .createWindowsInstaller({
      appDirectory: path.resolve(`./out/hain-win32-${arch}`),
      outputDirectory: `./out/${arch}`,
      authors: 'Heejin Lee',
      title: 'Hain',
      iconUrl:
        'https://raw.githubusercontent.com/hainproject/Hain/master/build/icon.ico',
      setupIcon: path.resolve('./build/icon.ico'),
      loadingGif: path.resolve('./build/installer.gif'),
      skipUpdateIcon: true, // HACK to resolve rcedit error (electron-winstaller)
      noMsi: true
    })
    .then(() => {
      fs.renameSync(`./out/${arch}/Setup.exe`, `./out/${filename}`);
    });
}
  electronPackager(Object.assign({}, all, win32), function (err, buildPath) {
    if (err) return cb(err)
    console.log('Windows: Packaged electron.')

    var signWithParams
    if (process.platform === 'win32') {
      if (argv.sign) {
        var certificateFile = path.join(CERT_PATH, 'authenticode.p12')
        var certificatePassword = fs.readFileSync(path.join(CERT_PATH, 'authenticode.txt'), 'utf8')
        var timestampServer = 'http://timestamp.comodoca.com'
        signWithParams = `/a /f "${certificateFile}" /p "${certificatePassword}" /tr "${timestampServer}" /td sha256`
      } else {
        printWarning()
      }
    } else {
      printWarning()
    }

    console.log('Windows: Creating installer...')
    installer.createWindowsInstaller({
      appDirectory: buildPath[0],
      authors: config.APP_TEAM,
      description: config.APP_NAME,
      exe: config.APP_NAME + '.exe',
      iconUrl: config.GITHUB_URL_RAW + '/static/' + config.APP_NAME + '.ico',
      loadingGif: path.join(config.STATIC_PATH, 'loading.gif'),
      name: config.APP_NAME,
      noMsi: true,
      outputDirectory: path.join(config.ROOT_PATH, 'dist'),
      productName: config.APP_NAME,
      remoteReleases: config.GITHUB_URL,
      setupExe: config.APP_NAME + 'Setup-v' + config.APP_VERSION + '.exe',
      setupIcon: config.APP_ICON + '.ico',
      signWithParams: signWithParams,
      title: config.APP_NAME,
      usePackageJson: false,
      version: pkg.version
    }).then(function () {
      console.log('Windows: Created installer.')
      cb(null, buildPath)
    }).catch(cb)
  })
    buildArtifactList.forEach(function(buildArtifact) {

        // Deployment: Input folder
        var inputFolder = path.join(buildArtifact);

        // Deployment: Target folder
        var deploySubfolder = path.join(path.resolve(deployFolder), path.basename(buildArtifact).replace(/\s+/g, '_').toLowerCase() + '-v' + buildOptions['app-version']);

        // Deployment: Installer extension
        var deployExtension = '.exe';

        // Deployment: Options
        var deployOptions = {
            appDirectory: inputFolder,
            outputDirectory: deploySubfolder,
            setupExe: path.basename(buildArtifact).replace(/\s+/g, '_').toLowerCase() + deployExtension,
            exe: buildOptions['name'] + '.exe',
            authors: buildOptions['app-company'],
            title: buildOptions['name'],
            iconUrl: buildOptions['iconUrl'],
            setupIcon: buildOptions['icon'],
            description: buildOptions['description']
        };

        // Deployment: Subfolder
        deleteFromFilesystem(deploySubfolder);
        createOnFilesystem(deploySubfolder);

        // Deployment: Start
        var deployHelper = windowsInstaller.createWindowsInstaller(deployOptions);

        // Deployment: Result
        deployHelper.then(function() {
            moveFolderToPackage(deploySubfolder, deployExtension);
        }, function(err) {
            log('Packaging error', err);
            return process.exit(1);
        });
    });
Beispiel #16
0
gulp.task('create-windows-installer',function(){
  del('./release/**/*');
  return resultPromise = winInstaller.createWindowsInstaller({
    appDirectory: './build/tagifier-win32-x64',
    outputDirectory: './release',
    title: pjson.name,
    description: pjson.name,
    loadingGif: './dist/web/img/updater.gif',
    authors: pjson.author,
    iconUrl: __dirname+'/dist/web/img/tgf/icon_circle.ico',
    setupIcon : './dist/web/img/tgf/icon_setup.ico',
    exe: 'Tagifier.exe',
    setupExe:'Setup.exe',
    noMsi : true,
    title : 'Tagifier'
  });

  console.log(iconUrl);

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

});
Beispiel #17
0
    function packageInstaller (filesPath, destArch, cb) {
      console.log(`Windows: Creating ${destArch} installer...`)

      const archStr = destArch === 'ia32' ? '-ia32' : ''

      installer.createWindowsInstaller({
        appDirectory: filesPath,
        authors: config.APP_TEAM,
        description: config.APP_NAME,
        exe: config.APP_NAME + '.exe',
        iconUrl: config.GITHUB_URL_RAW + '/static/' + config.APP_NAME + '.ico',
        loadingGif: path.join(config.STATIC_PATH, 'loading.gif'),
        name: config.APP_NAME,
        noMsi: true,
        outputDirectory: DIST_PATH,
        productName: config.APP_NAME,
        /**
         * Only create delta updates for the Windows x64 build because 90% of our
         * users have Windows x64 and the delta files take a *very* long time to
         * generate. Also, the ia32 files on GitHub have non-standard Squirrel
         * names (i.e. RELEASES-ia32 instead of RELEASES) and so Squirrel won't
         * find them unless we proxy the requests.
         */
        // TODO: Re-enable Windows 64-bit delta updates when we confirm that they
        //       work correctly in the presence of the "ia32" .nupkg files. I
        //       (feross) noticed them listed in the 64-bit RELEASES file and
        //       manually edited them out for the v0.17 release. Shipping only
        //       full updates for now will work fine, with no ill-effects.
        // remoteReleases: destArch === 'x64'
        //   ? config.GITHUB_URL
        //   : undefined,
        /**
         * If you hit a "GitHub API rate limit exceeded" error, set this token!
         */
        // remoteToken: process.env.WEBTORRENT_GITHUB_API_TOKEN,
        setupExe: config.APP_NAME + 'Setup-v' + config.APP_VERSION + archStr + '.exe',
        setupIcon: config.APP_ICON + '.ico',
        signWithParams: signWithParams,
        title: config.APP_NAME,
        usePackageJson: false,
        version: pkg.version
      })
        .then(function () {
          console.log(`Windows: Created ${destArch} installer.`)

          /**
         * Delete extraneous Squirrel files (i.e. *.nupkg delta files for older
         * versions of the app)
         */
          fs.readdirSync(DIST_PATH)
            .filter((name) => name.endsWith('.nupkg') && !name.includes(pkg.version))
            .forEach((filename) => {
              fs.unlinkSync(path.join(DIST_PATH, filename))
            })

          if (destArch === 'ia32') {
            console.log('Windows: Renaming ia32 installer files...')

            // RELEASES -> RELEASES-ia32
            const relPath = path.join(DIST_PATH, 'RELEASES-ia32')
            fs.renameSync(
              path.join(DIST_PATH, 'RELEASES'),
              relPath
            )

            // WebTorrent-vX.X.X-full.nupkg -> WebTorrent-vX.X.X-ia32-full.nupkg
            fs.renameSync(
              path.join(DIST_PATH, `${config.APP_NAME}-${config.APP_VERSION}-full.nupkg`),
              path.join(DIST_PATH, `${config.APP_NAME}-${config.APP_VERSION}-ia32-full.nupkg`)
            )

            // Change file name inside RELEASES-ia32 to match renamed file
            const relContent = fs.readFileSync(relPath, 'utf8')
            const relContent32 = relContent.replace('full.nupkg', 'ia32-full.nupkg')
            fs.writeFileSync(relPath, relContent32)

            if (relContent === relContent32) {
            // Sanity check
              throw new Error('Fixing RELEASES-ia32 failed. Replacement did not modify the file.')
            }

            console.log('Windows: Renamed ia32 installer files.')
          }

          cb(null)
        })
        .catch(cb)
    }
Beispiel #18
0
var electronInstaller = require('electron-winstaller');

resultPromise = electronInstaller.createWindowsInstaller({
    appDirectory: 'build/demoRepo-win32-x64',
    outputDirectory: 'build/windows',
    authors: 'My App Inc.',
    exe: 'demoRepo.exe'
  });

resultPromise.then(() => console.log("It worked!"), (e) => console.log(`No dice: ${e.message}`));
  var certPassword = process.env.CERT_PASSWORD
  if (!certPassword) {
    throw new Error('Certificate password required. Set environment variable CERT_PASSWORD.')
  }

  // Because both x64 and ia32 creates a RELEASES and a .nupkg file we
  // need to store the output files in separate directories
  outDir = path.join(outDir, arch)

  var electronInstaller = require('electron-winstaller')
  var resultPromise = electronInstaller.createWindowsInstaller({
    appDirectory: buildDir,
    outputDirectory: outDir,
    title: 'Brave',
    authors: 'Brave Software',
    loadingGif: 'res/brave_splash_installing.gif',
    setupIcon: 'res/app.ico',
    iconUrl: 'https://brave.com/favicon.ico',
    signWithParams: format('-a -fd sha256 -f "%s" -p "%s" -t http://timestamp.verisign.com/scripts/timstamp.dll', path.resolve(cert), certPassword),
    exe: 'Brave.exe'
  })
  resultPromise.then(() => {
    cmds = [
      `mv ${outDir}/Setup.exe ${outDir}/BraveSetup-${arch}.exe`,
      `mv ${outDir}/Setup.msi ${outDir}/BraveSetup-${arch}.msi`,
      // Change the casing of the output file name, Windows won't allow this in a single mv
      `mv ${outDir}/brave-${VersionInfo.braveVersion}-full.nupkg ${outDir}/Brave-${VersionInfo.braveVersion}-full.nupkg2`,
      `mv ${outDir}/Brave-${VersionInfo.braveVersion}-full.nupkg2 ${outDir}/Brave-${VersionInfo.braveVersion}-full.nupkg`
    ]
    execute(cmds, {}, console.log.bind(null, 'done'))
  }, (e) => console.log(`No dice: ${e.message}`))
Beispiel #20
0
var electronInstaller = require('electron-winstaller');

resultPromise = electronInstaller.createWindowsInstaller({
  appDirectory: '../open_built/OPEN-win32-x64/',
  outputDirectory: '../installer/',
  authors: "Endava",
  owners: "OpenTheWindows",
  title: "Open Launcher",
  exe: 'OPEN.exe',
  loadingGif: 'progress.gif',
  setupIcon: 'Icon.ico',
  iconUrl: 'https://raw.githubusercontent.com/despotovska/OPEN_Launcher/master/Icon.ico',
  noMsi: true
});

resultPromise.then(() => console.log("Installer successfully created!"), (e) => console.log(`No dice: ${e.message}`));
Beispiel #21
0
var electronInstaller = require('electron-winstaller');

resultPromise = electronInstaller.createWindowsInstaller({
    appDirectory: "./release/package/Alan Files' Electron Timer-win32-x64",
    outputDirectory: './release/installer',
    authors: 'Alan Files',
    exe: "Alan Files' Electron Timer.exe"
  });

resultPromise.then(() => console.log("It worked!"), (e) => console.log(`No dice: ${e.message}`));
Beispiel #22
0
            appDirectory: path.join(path.join((path.join('./'), 'win_packager'), json.name + "-" + spec['platform']['win'] + "-" + spec['arch']['64'] + '/')),
            outputDirectory: path.join(path.join('./'), 'win_installer'),
            authors: '',
            exe: json.name + '.exe',
            name: json.name.replace(/-/g, "_")
        };

        if (fs.existsSync('./win_installer')) {
            console.log('Removing existing ./win_installer...');
            execSync("del /s /q win_installer && rmdir /s /q win_installer", { maxBuffer: 1024 * 2048 });
            console.log('Successfully removed ./win_installer/');
        }

        console.log('Creating windows installer...');

        resultPromise = electronInstaller.createWindowsInstaller(settings);

        resultPromise.then(() => {
            console.log('Removing win_packager...');
            exec("del /s /q win_packager && rmdir /s /q win_packager", { maxBuffer: 1024 * 2048 }, (error) => {
                if (!error) {
                    console.log("Successfully created installer at ./win_installer/");
                } else {
                    console.log('Error : ' + error);
                }
            });
        }, (e) => {
            console.log('Error : ' + e.message);
        });
        break;
    default:
Beispiel #23
0
#! /usr/bin/env node
var electronInstaller = require('electron-winstaller');
var fs = require('fs');

if (fs.existsSync('build/Node-RED-win32-ia32')) {
    console.log("Building setup app for Windows 32bit");
    resultPromise = electronInstaller.createWindowsInstaller({
        appDirectory: 'build/Node-RED-win32-ia32',
        outputDirectory: '../electron-bin/',
        authors: 'IBM Corp.',
        exe: 'Node-RED.exe',
        setupExe: 'Node-RED-Electron-ia32.exe',
        setupIcon: 'nodered.ico',
        loadingGif: 'loading.gif',
        skipUpdateIcon: true
    });
    resultPromise.then(
        () => console.log("32bit build completed."),
        (e) => console.log(`32bit build failed: ${e.message}`)
    );
}
Beispiel #24
0
#!/usr/bin/env node

const fs = require('fs');
//https://github.com/electron/windows-installer
const electronInstaller = require('electron-winstaller');

//before running this, you need to run "npm run pack" to generate packes/kdinstall2-win32-x64
//installer will be in /tmp (will take 10 - 15 mins)

//to run signtool.exe on wine, it requires mfc42
//winetricks mfc42

resultPromise = electronInstaller.createWindowsInstaller({
    appDirectory: 'packed/kdinstall2-win32-x64',
    outputDirectory: '/home/hayashis/Dropbox/Public/kdinstall',
    authors: 'IU / SciApt',
    exe: 'kdinstall2.exe',
    setupExe: 'kdinstall2.exe',
    
    //winstaller fails
    //certificateFile: '/home/hayashis/.ssh/sciapt.pfx',
    //certificatePassword: fs.readFileSync('/home/hayashis/.ssh/sciapt_codesigning.pass').toString().trim(),
});

resultPromise.then(() => console.log("It worked!"), (e) => console.log(`No dice: ${e.message}`));
module.exports = function (packagedAppPath, codeSign) {
  const archSuffix = process.arch === 'ia32' ? '' : '-' + process.arch
  const options = {
    appDirectory: packagedAppPath,
    authors: 'GitHub Inc.',
    iconUrl: `https://raw.githubusercontent.com/atom/atom/master/resources/app-icons/${CONFIG.channel}/atom.ico`,
    loadingGif: path.join(CONFIG.repositoryRootPath, 'resources', 'win', 'loading.gif'),
    outputDirectory: CONFIG.buildOutputPath,
    remoteReleases: `https://atom.io/api/updates${archSuffix}`,
    setupIcon: path.join(CONFIG.repositoryRootPath, 'resources', 'app-icons', CONFIG.channel, 'atom.ico')
  }

  // Remove this once an x64 version is published or atom.io is returning blank instead of 404 for RELEASES-X64
  if (process.arch === 'x64') {
    options.remoteReleases = null
  }

  const certPath = path.join(os.tmpdir(), 'win.p12')
  const signing = codeSign && process.env.ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL

  if (signing) {
    downloadFileFromGithub(process.env.ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL, certPath)
    var signParams = []
    signParams.push(`/f ${certPath}`) // Signing cert file
    signParams.push(`/p ${process.env.ATOM_WIN_CODE_SIGNING_CERT_PASSWORD}`) // Signing cert password
    signParams.push('/fd sha256') // File digest algorithm
    signParams.push('/tr http://timestamp.digicert.com') // Time stamp server
    signParams.push('/td sha256') // Times stamp algorithm
    options.signWithParams = signParams.join(' ')
  } else {
    console.log('Skipping code-signing. Specify the --code-sign option and provide a ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL environment variable to perform code-signing'.gray)
  }

  const cleanUp = function () {
    if (fs.existsSync(certPath)) {
      console.log(`Deleting certificate at ${certPath}`)
      fs.removeSync(certPath)
    }

    for (let nupkgPath of glob.sync(`${CONFIG.buildOutputPath}/*.nupkg`)) {
      if (!nupkgPath.includes(CONFIG.appMetadata.version)) {
        console.log(`Deleting downloaded nupkg for previous version at ${nupkgPath} to prevent it from being stored as an artifact`)
        fs.removeSync(nupkgPath)
      }
    }
  }

  // Squirrel signs its own copy of the executables but we need them for the portable ZIP
  const extractSignedExes = function() {
    if (signing) {
      for (let nupkgPath of glob.sync(`${CONFIG.buildOutputPath}/*-full.nupkg`)) {
        if (nupkgPath.includes(CONFIG.appMetadata.version)) {
          nupkgPath = path.resolve(nupkgPath) // Switch from forward-slash notation
          console.log(`Extracting signed executables from ${nupkgPath} for use in portable zip`)
          spawnSync('7z.exe', ['e', nupkgPath, 'lib\\net45\\*.exe', '-aoa', `-o${packagedAppPath}`])
          spawnSync(process.env.COMSPEC, ['/c', 'move', '/y', path.join(packagedAppPath, 'squirrel.exe'), path.join(packagedAppPath, 'update.exe')])
          return
        }
      }
    }
  }

  console.log(`Creating Windows Installer for ${packagedAppPath}`)
  return electronInstaller.createWindowsInstaller(options)
    .then(extractSignedExes, function (error) {
      console.log(`Extracting signed executables failed:\n${error}`)
      cleanUp()
    })
    .then(cleanUp, function (error) {
      console.log(`Windows installer creation failed:\n${error}`)
      cleanUp()
    })
}
Beispiel #26
0
/* jshint node: true */
'use strict';

var electronInstaller = require('electron-winstaller');

var resultPromise = electronInstaller.createWindowsInstaller({
  title: 'arkOS Assistant',
  appDirectory: __dirname + '/electron-builds/arkOS Assistant-win32-x64',
  outputDirectory: __dirname + '/electron-builds/arkOS Assistant-win32-x64',
  authors: 'CitizenWeb',
  exe: 'arkOS Assistant.exe',
  setupExe: 'arkOS Assistant Setup.exe',
  setupIcon: __dirname + '/build-includes/icon.ico',
  loadingGif: __dirname + '/build-includes/winstaller.gif',
  noMsi: true
});

resultPromise.then(function() {
  console.log("Installer built.");
}, function(err) {
  console.log(`Installer build failed: ${err.message}`);
});