H
H
HitGirl2019-03-28 14:58:44
Python
HitGirl, 2019-03-28 14:58:44

How to create a program installer in C# with a Python interpreter?

Hello!
I have a C# program in which I execute Python scripts using an interpreter call. Can you please tell me how to create an installer for a C# program that will install an interpreter for Python? If any articles or examples on this topic?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
rPman, 2019-03-28
@rPman

Surely you thought well before choosing such a strange mixture of architectures?
ps True, I myself could do this if it were necessary to write a complex interface, and the computational logic would already be in python, since it is most convenient to write complex forms in visual studio on .net (IMHO).
If you are not interested in full-fledged update support, and you also don’t care that the installation archive will be thick (this is especially noticed when you make frequent updates), stupidly put the pre-installed python directory in a separate directory and use it (prescribe the maximum environment variables before starting), in In this case, you will be responsible for the update yourself. But even in this case, it would be a good gesture to offer to install the application without python, expecting it to be already installed on the user's machine. Why is it bad to carry a python with you? - support, in three ten years, to run your application with support for modern hardware, you will need a pound of salt and a toilet brush (this is especially true for gpgpu / opencv subsystems).
The most beautiful solution is to download and install everything you need on the user's machine, including the option - download without installation to transfer the directory with this cache to a machine without the Internet.
If you have linux with normal package managers, use them and software packages in their format (apt/rpm/ebuild/..) and they will do everything for you in the best possible way! If windows...
In non-castrated (not homemade) versions of windows10, you can try to run the ubuntu/debian binaries, if no gui is required, this will almost certainly work, i.e. you can use the regular apt package manager, and a couple of commands to install / update everything you need
. You can also install python in silent mode by downloading the installer from the site https://www.python.org/downloads/,it will take up less space, but if you need unusual modules, then you may not be lucky to find those built for windows, and those that are usually require manual installation .. in general, not everything is easily automated there, download paths can suddenly through another year to disappear and users will get a problem.
Universally, you can use the ready-made linux subsystem for windows - cygwin (you will not find such a long and high-quality support for almost everything from the world of windows in linux), and drag them into your installer setup.exe (by the way, it is always available for download from the site one by one and the same url) in Unattended setup mode (--quiet-mode), together with python you will get a basic set of command line utilities and a bunch of other theoretically superfluous things, but believe me, it will not hurt, especially if you need to automate installation management processes on the client's machine.

M
mshak, 2019-03-28
@mshak

wixtoolset.org

D
Darlian, 2020-08-13
@Darlian

Hello, I understand that the question was asked quite a long time ago and yet. What did you use to make C# and Python friends? (If it's IronPython the question is removed). What specific means, can you link to the documentation, if any? And did you manage to make an installer, if so, which way did you go for this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question