Skip to content
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

Consider how to package Python as an optional install for Windows #1449

Open
ghutchis opened this issue Nov 9, 2023 · 15 comments
Open

Consider how to package Python as an optional install for Windows #1449

ghutchis opened this issue Nov 9, 2023 · 15 comments

Comments

@ghutchis
Copy link
Member

ghutchis commented Nov 9, 2023

Many features in Avogadro2 expect to find Python in the path.

This would be much easier on Windows if there was a miniconda build, for example, for most users.

Someone should examine how to bundle our NSIS installer with Miniconda:
https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe

For example, it seems like it's possible https://github.com/conda-forge/miniforge?tab=readme-ov-file#non-interactive-install

start /wait "" Miniforge3-Windows-x86_64.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%UserProfile%\Miniforge3
@Surajjalpun2002
Copy link
Contributor

will you be assigning this to a particular individual?

@ghutchis
Copy link
Member Author

ghutchis commented Nov 10, 2023

No, although you seem to be the first interested in helping, so thanks very much for the offer.

I don't know if it's easier to create a new installer that combines Avogadro + Miniforge, etc. .. I don't know much about NSIS since I don't use Windows.

@matterhorn103
Copy link
Contributor

Couldn't we just bundle with the Python installer on Windows and execute it via the command line rather than bundling miniconda?

@ghutchis
Copy link
Member Author

If I'm choosing between the official Python installer and miniconda, I'd go with a miniforge install because it will make installing other packages and setting up environments easier.

As to how it's installed, I don't care - only that it be optional since some people may already have Python installed on Windows.

@Surajjalpun2002
Copy link
Contributor

Surajjalpun2002 commented Dec 1, 2023

I am not sure if I am right, but from what I have searched, I would need the NSIS script used in Avogadro's NSIS installer (which i cant find) and then I might be able to add the miniforge installation conditions within it, although i am not sure yet , as i have tried to install miniforge with simple nsis scripts but failed.

@Harshiths1
Copy link

Do you want a NSIS script (.nsi file) that includes the Miniconda installer (this script downloads the Miniconda installer (Miniconda3-latest-Windows-x86_64.exe) and installs it silently (/S) to the specified directory (/D=C:\Miniconda3)
We could then adjust the paths as per requirements) or do you want to add Miniconda's Scripts and base directories to the PATH in the system registry while instillation itself .

@ghutchis
Copy link
Member Author

ghutchis commented Dec 3, 2023

I would want an NSIS script that offers the option to the user to install Miniconda (the default) .. potentially /S to a specified directory (default = C:\Miniconda3) during installation of Avogadro.

I don't know enough about NSIS to know how to do that (e.g., do you modify the Avogadro .nsi script or create a new script that loads both installers).

@harshit4311
Copy link

I would love working on this issue! Could you please assign it to me?

@Harshiths1
Copy link

I have figured out a way by using the nsDialogs plugins but am not able to find the existing script file through which the current feature has to be added.

@Harshiths1
Copy link

@ghutchis sir how would we test it as the (.exe) file is directly created with the required functionalities as I have build it with a custom script .

@avo-bot
Copy link

avo-bot commented Dec 11, 2023

This issue has been mentioned on Avogadro Discussion. There might be relevant details there:

https://discuss.avogadro.cc/t/managing-python/5098/1

@matterhorn103
Copy link
Contributor

Just want to make a note that these days it's also possible to install miniforge on Windows (or at least, get the installer) using

winget install CondaForge.Miniforge3

@matterhorn103
Copy link
Contributor

And indeed installing via winget both downloads and installs miniforge in non-interactive mode. So the Avogadro installer would simply need to execute the above command and nothing more, if that's possible.

@matterhorn103
Copy link
Contributor

@ghutchis Is there an existing .nsi script? No one seems to be able to find it, myself included. If it doesn't exist, how is the Windows installer currently being prepared? I've searched through a lot of the repo and found nothing...

The other option is that rather than the suggestion to install Python coming at install time, the user is instead prompted on first launch, since there was the idea to have a "Setup Python environment" dialog pop up anyway.

Even if it happens in the installer, it will still be necessary to have an option in the GUI somewhere (maybe in "Python Settings") to do the same thing, so that people who choose no at install time and then change their mind don't have to reinstall.

@ghutchis
Copy link
Member Author

Right now, it's handled by cpack with options in the avogadroapp repo, e.g.:
https://github.com/OpenChemistry/avogadroapp/blob/master/cmake/AvogadroCPackOptions.cmake.in

I agree that it's probably a nice idea to have it prompt in the first launch, although I can imagine in a lab setting, it might be better to have it in both places.

If the command is run more than once, what happens to the previous install?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants