-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get this working on Windows #71
Comments
diff --git a/main.js b/main.js
index 02ac6aa..9912b26 100644
--- a/main.js
+++ b/main.js
@@ -190,7 +190,7 @@ class DatasetteServer {
async startOrRestart() {
const venv_dir = await this.ensureVenv();
await this.ensurePackagesInstalled();
- const datasette_bin = path.join(venv_dir, "bin", "datasette");
+ const datasette_bin = path.join(venv_dir, "Scripts", "datasette.exe");
let backupPath = null;
if (this.process) {
// Dump temporary to restore later
@@ -319,8 +319,8 @@ class DatasetteServer {
process.env.HOME,
".datasette-app",
"venv",
- "bin",
- "pip"
+ "Scripts",
+ "pip.exe"
);
await this.execCommand(pip_binary, [
"install",
@@ -334,8 +334,8 @@ class DatasetteServer {
process.env.HOME,
".datasette-app",
"venv",
- "bin",
- "pip"
+ "Scripts",
+ "pip.exe"
);
await this.execCommand(pip_binary, [
"uninstall",
@@ -371,7 +371,7 @@ class DatasetteServer {
// Check Python interpreter still works, using
// ~/.datasette-app/venv/bin/python3.9 --version
// See https://github.com/simonw/datasette-app/issues/89
- const venv_python = path.join(venv_dir, "bin", "python3.9");
+ const venv_python = path.join(venv_dir, "Scripts", "python.exe");
try {
await this.execCommand(venv_python, ["--version"]);
shouldCreateVenv = false;
@@ -392,7 +392,7 @@ class DatasetteServer {
for (const [name, requiredVersion] of Object.entries(minPackageVersions)) {
needsInstall.push(`${name}>=${requiredVersion}`);
}
- const pip_path = path.join(venv_dir, "bin", "pip");
+ const pip_path = path.join(venv_dir, "Scripts", "pip.exe");
try {
await this.execCommand(
pip_path,
@@ -456,6 +456,8 @@ function findPython() {
path.join(process.resourcesPath, "python", "bin", "python3.9"),
// In development
path.join(__dirname, "python", "bin", "python3.9"),
+ // On Windows
+ path.join(__dirname, "python", "python.exe"),
];
for (const path of possibilities) {
if (fs.existsSync(path)) { |
And I downloaded and extracted |
Here's the Electron build documentation for Windows, which is pretty thin: https://www.electron.build/configuration/win#WindowsConfiguration-target |
hey @simonw, I saw Jupyter Lab have a cross-platform app running on Electron and thought of this PR (love datasette btw) code signing on Windows [WIP]: jupyterlab/jupyterlab-desktop#202 |
That's a fantastic example, thank you! Looks like the Windows build is generated using this script: https://github.com/jupyterlab/jupyterlab_app/blob/50ce277c2abf844c5eb70cc4aa633653c14c416f/package.json#L25 |
Some tips on getting a certificate: https://www.reddit.com/r/electronjs/comments/101houy/talking_codesigning_applications/ |
Lots to consider here:
/Application/Datasette.app/Content/Resources
- what do I do on Windows?The text was updated successfully, but these errors were encountered: