OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 }); | 80 }); |
81 } | 81 } |
82 | 82 |
83 function runWinInstaller(archive, browserDir) | 83 function runWinInstaller(archive, browserDir) |
84 { | 84 { |
85 // Procedure inspired from mozinstall: | 85 // Procedure inspired from mozinstall: |
86 // https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozinstall/
mozinstall/mozinstall.py | 86 // https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozinstall/
mozinstall/mozinstall.py |
87 // Also uninstaller will need to be run. | 87 // Also uninstaller will need to be run. |
88 return new Promise((resolve, reject) => | 88 return new Promise((resolve, reject) => |
89 { | 89 { |
90 exec([archive, `/extractdir=${browserDir}`].join(" "), | 90 exec(`"${archive}" /extractdir=${browserDir}`, |
91 err => | 91 err => |
92 { | 92 { |
93 if (err) | 93 if (err) |
94 reject(err); | 94 reject(err); |
95 else | 95 else |
96 resolve(); | 96 resolve(); |
97 }); | 97 }); |
98 }); | 98 }); |
99 } | 99 } |
100 | 100 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return download(url, archive); | 171 return download(url, archive); |
172 } | 172 } |
173 console.info(`Reusing cached archive ${archive}`); | 173 console.info(`Reusing cached archive ${archive}`); |
174 }) | 174 }) |
175 .then(() => extractArchive(archive, browserDir)) | 175 .then(() => extractArchive(archive, browserDir)) |
176 .then(() => browserDir); | 176 .then(() => browserDir); |
177 }).then(dir => getFirefoxExecutable(dir)); | 177 }).then(dir => getFirefoxExecutable(dir)); |
178 } | 178 } |
179 | 179 |
180 module.exports.ensureFirefox = ensureFirefox; | 180 module.exports.ensureFirefox = ensureFirefox; |
OLD | NEW |