tryin something here
parent
a3ef494fd0
commit
bcd56daebd
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "portapy",
|
"name": "portapy",
|
||||||
"version": "0.0.4",
|
"version": "0.0.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -64,6 +64,14 @@
|
||||||
"delayed-stream": "~1.0.0"
|
"delayed-stream": "~1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"copy-dir": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/copy-dir/-/copy-dir-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-mIefrD97nE1XX2th570tR5UQvW6/92czEPGe+oTtrxPAJl+KOKLpzcRa+e38WEpmt/IUN1n65KvRMzPblR+fDQ==",
|
||||||
|
"requires": {
|
||||||
|
"mkdir-p": "~0.0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||||
|
|
@ -217,6 +225,11 @@
|
||||||
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
|
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
|
||||||
},
|
},
|
||||||
|
"mkdir-p": {
|
||||||
|
"version": "0.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/mkdir-p/-/mkdir-p-0.0.7.tgz",
|
||||||
|
"integrity": "sha1-JMXb4m2jqZ7xWKHu+aXC3Z3laDw="
|
||||||
|
},
|
||||||
"oauth-sign": {
|
"oauth-sign": {
|
||||||
"version": "0.9.0",
|
"version": "0.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "portapy",
|
"name": "portapy",
|
||||||
"version": "0.0.4",
|
"version": "0.0.7",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
"url": "https://github.com/marcus13345/portapy/issues"
|
"url": "https://github.com/marcus13345/portapy/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"copy-dir": "^0.4.0",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"python": "0.0.4",
|
"python": "0.0.4",
|
||||||
"request": "^2.88.0"
|
"request": "^2.88.0"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// pip install --target=lib numpy six pypng pyplatec
|
// pip install --target=lib numpy six pypng pyplatec
|
||||||
let {execSync} = require('child_process');
|
let {execSync} = require('child_process');
|
||||||
|
|
||||||
let pythonDownloader = require('./util/downloadpython.js')
|
let pythonDownloader = require('../util/downloadpython.js')
|
||||||
|
|
||||||
|
|
||||||
pythonDownloader.download();
|
pythonDownloader.download();
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,13 @@ const fs = require('fs');
|
||||||
|
|
||||||
let installerFilename = fs.readFileSync('.installerLocation').toString();
|
let installerFilename = fs.readFileSync('.installerLocation').toString();
|
||||||
|
|
||||||
let pythonPath = path.resolve(__dirname, 'Python-Installer', installerFilename);
|
let pythonInstallerPath = path.resolve(__dirname, 'Python-Installer', installerFilename);
|
||||||
|
|
||||||
require('child_process').execSync(`${pythonPath} /passive /uninstall`, {
|
let pythonPath = path.resolve(__dirname, 'Python');
|
||||||
stdio: 'inherit'
|
|
||||||
});
|
fs.rmdirSync(pythonPath);
|
||||||
|
|
||||||
|
|
||||||
|
// require('child_process').execSync(`${pythonInstallerPath} /passive /uninstall`, {
|
||||||
|
// stdio: 'inherit'
|
||||||
|
// });
|
||||||
|
|
@ -7,6 +7,7 @@ const fs = require('fs');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
const {execSync} = require('child_process');
|
const {execSync} = require('child_process');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const copydir = require('copy-dir');
|
||||||
|
|
||||||
async function download() {
|
async function download() {
|
||||||
|
|
||||||
|
|
@ -20,6 +21,9 @@ async function download() {
|
||||||
try {
|
try {
|
||||||
fs.mkdirSync('Python');
|
fs.mkdirSync('Python');
|
||||||
} catch(e) {'';}
|
} catch(e) {'';}
|
||||||
|
try {
|
||||||
|
fs.mkdirSync('Temp-Python');
|
||||||
|
} catch(e) {'';}
|
||||||
try {
|
try {
|
||||||
fs.writeFileSync('.installerLocation', filename);
|
fs.writeFileSync('.installerLocation', filename);
|
||||||
} catch(e) {'';}
|
} catch(e) {'';}
|
||||||
|
|
@ -45,26 +49,31 @@ async function download() {
|
||||||
case 'win32': {
|
case 'win32': {
|
||||||
try {
|
try {
|
||||||
let installerPath = path.join(__dirname, '..', 'Python-Installer/', filename);
|
let installerPath = path.join(__dirname, '..', 'Python-Installer/', filename);
|
||||||
|
let tempPath = path.join(__dirname, '..', 'Temp-Python/');
|
||||||
let targetPath = path.join(__dirname, '..', 'Python/');
|
let targetPath = path.join(__dirname, '..', 'Python/');
|
||||||
execSync(`${installerPath} /passive DefaultJustForMeTargetDir=${targetPath}`, {
|
execSync(`${installerPath} /passive DefaultJustForMeTargetDir=${tempPath}`, {
|
||||||
stdio: "inherit"
|
stdio: "inherit"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("Creating Portable Python Directory");
|
||||||
|
|
||||||
let files = fs.readdirSync(targetPath);
|
copydir.sync(tempPath, targetPath);
|
||||||
files.forEach(function (element) {
|
console.log("Portable Directory Created!");
|
||||||
console.log(element);
|
|
||||||
|
console.log("Uninstalling Unnecessary Python Files");
|
||||||
|
|
||||||
|
execSync(`${installerPath} /passive /uninstall`, {
|
||||||
|
stdio: 'inherit'
|
||||||
});
|
});
|
||||||
|
fs.rmdirSync(tempPath);
|
||||||
|
|
||||||
console.log("Python Installed!");
|
console.log("PordaPy Installed!");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}[]
|
}[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPythonDownloadLink() {
|
function getPythonDownloadLink() {
|
||||||
|
|
|
||||||
Reference in New Issue