Prabhu
Prabhu

Reputation: 3538

Generating EXE out of IronPython script

I am using IronPython studio to create IronPython scripts and convert them into executables. When converted to executables, it creates a Main exe and two dlls (IronMath.dll and IronPython.dll). Is it possible to create the executables without IronPython studio. I tried PYC downloaded from codeplex.com. It creates an exe and a dll with the same name as that of the exe (say main.exe and main.dll). But I need an exe and two dlls (similar to what is created by the IronPython studio). So that I can use other IronPython exes without any separate dlls (these 2 dlls would be enough for any FePy exe).

Upvotes: 0

Views: 3913

Answers (3)

Prabhu
Prabhu

Reputation: 3538

I have created a C# application that uses the IronPython.dll and IronMath.dll to convert the IronPython scripts to executables. This doesn't require IronPython studio to be present. Only the DLLs are enough. The behavior of exe is same as that created by IronPython studio(Integrated with VS2008)

Upvotes: 2

Kenneth Reitz
Kenneth Reitz

Reputation: 8856

A DLL is a dynamically linked library. It's required for your application to run properly. All applications written in .NET use them. You just don't know it, because support is built into the .NET framework, which most everyone has installed on their systems. Yay, way to go Microsoft. The DLR (Dynamic Language Runtime) isn't built into any .NET destributable at this time, however (this will change in .NET 4.0). That's why you get the dll file.

Are you writing software that utilizes any .NET libraries? If not, just write it in good 'ol cpython (the way you're supposed to). Then, uou should look into a program called py2exe. Have you ever used uTorrent? I'm assuming you have. It's build using strait up cpython + py2exe.

Enjoy. :)

Upvotes: 0

Lukas Cenovsky
Lukas Cenovsky

Reputation: 5670

I maybe don't understand the question well but copying IronMath.dll and IronPython.dll to the folder with main.exe and main.dll should work for Ironpython 1.x. These .dlls are different for IronPython 2.x.

Edit: Well, I tried PYC with IP 1.1 and it does not work. That means you have to use it with at least IP 2.0.2 (it is located in Samples\pyc folder). For simple script 'print 'hello' you need to ship (along with hello.dll and hello.exe).

  • IronPython.dll
  • Microsoft.Scripting.Core.dll
  • Microsoft.Scripting.dll
  • Microsoft.Scripting.ExtensionAttribute.dll

For more complicated script you will probably need IronPython.Modules.dll as well.

Upvotes: 1

Related Questions