Skip to content

Commit

Permalink
feat: remove "Space required" text for NSIS installer
Browse files Browse the repository at this point in the history
Close #1566
  • Loading branch information
develar committed May 27, 2017
1 parent 40b0ce0 commit 565740c
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 55 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"///": "all dependencies for all packages (hoisted)",
"dependencies": {
"7zip-bin": "^2.0.4",
"ajv": "^5.1.3",
"ajv": "^5.1.4",
"ajv-keywords": "^2.0.0",
"archiver": "^1.3.0",
"aws-sdk": "^2.56.0",
"aws-sdk": "^2.58.0",
"bluebird-lst": "^1.0.2",
"chalk": "^1.1.3",
"chromium-pickle-js": "^0.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"homepage": "https://github.com/electron-userland/electron-builder",
"dependencies": {
"7zip-bin": "^2.0.4",
"ajv": "^5.1.3",
"ajv": "^5.1.4",
"ajv-keywords": "^2.0.0",
"bluebird-lst": "^1.0.2",
"chalk": "^1.1.3",
Expand Down
1 change: 1 addition & 0 deletions packages/electron-builder/templates/nsis/common.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

BrandingText "${PRODUCT_NAME} ${VERSION}"
ShowInstDetails nevershow
SpaceTexts none
!ifdef BUILD_UNINSTALLER
ShowUninstDetails nevershow
!endif
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-publisher-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"dependencies": {
"fs-extra-p": "^4.3.0",
"aws-sdk": "^2.55.0",
"aws-sdk": "^2.58.0",
"mime": "^1.3.6",
"electron-publish": "~0.0.0-semantic-release",
"electron-builder-util": "~0.0.0-semantic-release"
Expand Down
119 changes: 68 additions & 51 deletions test/vendor/yarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -40805,46 +40805,55 @@ class InstallationIntegrityChecker {
this.config = config;
}

_getModuleLocation(usedRegistries) {
var _this = this;

return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
// build up possible folders
let registries = (_index || _load_index()).registryNames;
if (usedRegistries && usedRegistries.size > 0) {
registries = usedRegistries;
}
const possibleFolders = [];
if (_this.config.modulesFolder) {
possibleFolders.push(_this.config.modulesFolder);
}

// ensure we only write to a registry folder that was used
for (const name of registries) {
const loc = path.join(_this.config.cwd, _this.config.registries[name].folder);
possibleFolders.push(loc);
}

// if we already have an integrity hash in one of these folders then use it's location otherwise use the
// first folder
let loc;
for (const possibleLoc of possibleFolders) {
if (yield (_fs || _load_fs()).exists(path.join(possibleLoc, (_constants || _load_constants()).INTEGRITY_FILENAME))) {
loc = possibleLoc;
break;
}
}

return loc || possibleFolders[0];
})();
}

/**
* Get the location of an existing integrity hash. If none exists then return the location where we should
* write a new one.
*/

_getIntegrityHashLocation(usedRegistries) {
var _this = this;
var _this2 = this;

return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
let locationFolder;

if (_this.config.enableMetaFolder) {
locationFolder = path.join(_this.config.cwd, (_constants || _load_constants()).META_FOLDER);
if (_this2.config.enableMetaFolder) {
locationFolder = path.join(_this2.config.cwd, (_constants || _load_constants()).META_FOLDER);
} else {
// build up possible folders
let registries = (_index || _load_index()).registryNames;
if (usedRegistries && usedRegistries.size > 0) {
registries = usedRegistries;
}
const possibleFolders = [];
if (_this.config.modulesFolder) {
possibleFolders.push(_this.config.modulesFolder);
}

// ensure we only write to a registry folder that was used
for (const name of registries) {
const loc = path.join(_this.config.cwd, _this.config.registries[name].folder);
possibleFolders.push(loc);
}

// if we already have an integrity hash in one of these folders then use it's location otherwise use the
// first folder
let loc;
for (const possibleLoc of possibleFolders) {
if (yield (_fs || _load_fs()).exists(path.join(possibleLoc, (_constants || _load_constants()).INTEGRITY_FILENAME))) {
loc = possibleLoc;
break;
}
}
locationFolder = loc || possibleFolders[0];
locationFolder = yield _this2._getModuleLocation(usedRegistries);
}

const locationPath = path.join(locationFolder, (_constants || _load_constants()).INTEGRITY_FILENAME);
Expand Down Expand Up @@ -40894,7 +40903,7 @@ class InstallationIntegrityChecker {
*/

_generateIntegrityFile(lockfile, patterns, flags, modulesFolder, artifacts) {
var _this2 = this;
var _this3 = this;

return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {

Expand All @@ -40916,11 +40925,11 @@ class InstallationIntegrityChecker {
result.flags.push('ignoreScripts');
}

if (_this2.config.production) {
if (_this3.config.production) {
result.flags.push('production');
}

const linkedModules = _this2.config.linkedModules;
const linkedModules = _this3.config.linkedModules;
if (linkedModules.length) {
result.linkedModules = linkedModules.sort((_misc || _load_misc()).sortAlpha);
}
Expand All @@ -40930,7 +40939,7 @@ class InstallationIntegrityChecker {
});

if (flags.checkFiles) {
result.files = yield _this2._getFilesDeep(modulesFolder);
result.files = yield _this3._getFilesDeep(modulesFolder);
}

return result;
Expand All @@ -40950,7 +40959,7 @@ class InstallationIntegrityChecker {
}

_compareIntegrityFiles(actual, expected, checkFiles, locationFolder) {
var _this3 = this;
var _this4 = this;

return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
if (!expected) {
Expand All @@ -40976,7 +40985,7 @@ class InstallationIntegrityChecker {
if (expected.files.length === 0) {
// edge case handling - --check-fies is passed but .yarn-integrity does not contain any files
// check and fail if there are file in node_modules after all.
const actualFiles = yield _this3._getFilesDeep(locationFolder);
const actualFiles = yield _this4._getFilesDeep(locationFolder);
if (actualFiles.length > 0) {
return 'FILES_MISSING';
}
Expand All @@ -40994,25 +41003,26 @@ class InstallationIntegrityChecker {
}

check(patterns, lockfile, flags) {
var _this4 = this;
var _this5 = this;

return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
// check if patterns exist in lockfile
const missingPatterns = patterns.filter(function (p) {
return !lockfile[p];
});
const loc = yield _this4._getIntegrityHashLocation();

const loc = yield _this5._getIntegrityHashLocation();
if (missingPatterns.length || !loc.exists) {
return {
integrityFileMissing: !loc.exists,
missingPatterns
};
}

const actual = yield _this4._generateIntegrityFile(lockfile, patterns, Object.assign({}, { checkFiles: false }, flags), // don't generate files when checking, we check the files below
loc.locationFolder);
const expected = yield _this4._getIntegrityFile(loc.locationPath);
const integrityMatches = yield _this4._compareIntegrityFiles(actual, expected, flags.checkFiles, loc.locationFolder);
const actual = yield _this5._generateIntegrityFile(lockfile, patterns, Object.assign({}, flags, { checkFiles: false }), ( // don't generate files when checking, we check the files below
yield _this5._getModuleLocation()));
const expected = yield _this5._getIntegrityFile(loc.locationPath);
const integrityMatches = yield _this5._compareIntegrityFiles(actual, expected, flags.checkFiles, loc.locationFolder);

return {
integrityFileMissing: false,
Expand All @@ -41027,10 +41037,10 @@ class InstallationIntegrityChecker {
* Get artifacts from integrity file if it exists.
*/
getArtifacts() {
var _this5 = this;
var _this6 = this;

return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
const loc = yield _this5._getIntegrityHashLocation();
const loc = yield _this6._getIntegrityHashLocation();
if (!loc.exists) {
return null;
}
Expand All @@ -41051,22 +41061,25 @@ class InstallationIntegrityChecker {
* Write the integrity hash of the current install to disk.
*/
save(patterns, lockfile, flags, usedRegistries, artifacts) {
var _this6 = this;
var _this7 = this;

return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
const loc = yield _this6._getIntegrityHashLocation(usedRegistries);
const moduleFolder = yield _this7._getModuleLocation(usedRegistries);
const integrityFile = yield _this7._generateIntegrityFile(lockfile, patterns, flags, moduleFolder, artifacts);

const loc = yield _this7._getIntegrityHashLocation(usedRegistries);
invariant(loc.locationPath, 'expected integrity hash location');

yield (_fs || _load_fs()).mkdirp(path.dirname(loc.locationPath));
const integrityFile = yield _this6._generateIntegrityFile(lockfile, patterns, flags, loc.locationFolder, artifacts);
yield (_fs || _load_fs()).writeFile(loc.locationPath, JSON.stringify(integrityFile, null, 2));
})();
}

removeIntegrityFile() {
var _this7 = this;
var _this8 = this;

return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
const loc = yield _this7._getIntegrityHashLocation();
const loc = yield _this8._getIntegrityHashLocation();
if (loc.exists) {
yield (_fs || _load_fs()).unlink(loc.locationPath);
}
Expand Down Expand Up @@ -54896,7 +54909,7 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default {
const cachedStream = fs.createReadStream(tarballPath);

cachedStream.pipe(validateStream).pipe(extractorStream).on('error', function (err) {
reject(new (_errors || _load_errors()).MessageError(this.config.reporter.lang('fetchErrorCorrupt', err.message, tarballPath)));
reject(new (_errors || _load_errors()).MessageError(_this3.config.reporter.lang('fetchErrorCorrupt', err.message, tarballPath)));
});
});
})();
Expand Down Expand Up @@ -65126,7 +65139,7 @@ function extend() {
module.exports = {
"name": "yarn",
"installationMethod": "unknown",
"version": "0.25.1",
"version": "0.25.3",
"license": "BSD-2-Clause",
"preferGlobal": true,
"description": "📦🐈 Fast, reliable, and secure dependency management.",
Expand Down Expand Up @@ -75498,9 +75511,13 @@ class GitFetcher extends (_baseFetcher || _load_baseFetcher()).default {

const cachedStream = fs.createReadStream(tarballPath);
cachedStream.pipe(hashStream).pipe(untarStream).on('finish', function () {

const expectHash = _this2.hash;
const actualHash = hashStream.getHash();
if (!expectHash || expectHash === actualHash) {

// This condition is disabled because "expectHash" actually is the commit hash
// This is a design issue that we'll need to fix (https://github.com/yarnpkg/yarn/pull/3449)
if (true) {
resolve({
hash: actualHash
});
Expand Down

0 comments on commit 565740c

Please sign in to comment.