Change python embedding to get standard library from zip, not a dll

* This seems way more reliable and smaller than shipping a compiled .dll
* For some reason I didn't find this method before (I only knew that
  you could ship the loose files which wasn't a good solution).
This commit is contained in:
baldurk
2015-08-23 11:17:46 +02:00
parent bc5afeeef4
commit f6b4b2fe22
9 changed files with 16 additions and 153 deletions
+5 -5
View File
@@ -99,6 +99,11 @@ namespace renderdocui.Windows.Dialogs
searches.Add(Directory.GetCurrentDirectory());
string libspath = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "pythonlibs.zip");
if (File.Exists(libspath))
searches.Add(libspath);
engine.SetSearchPaths(searches);
return engine;
@@ -464,11 +469,6 @@ namespace renderdocui.Windows.Dialogs
scriptEditor.Text = String.Format("# RenderDoc Python scripts, powered by IronPython {0}\n" +
"# The 'renderdoc' object is the Core class instance.\n\n", IronPython.CurrentVersion.AssemblyFileVersion);
if (File.Exists("pythonlibs.dll"))
scriptEditor.Text += "import clr\nclr.AddReference(\"pythonlibs\")\n\n";
else
scriptEditor.Text += "#import clr\n#clr.AddReference(\"pythonlibs\")\n\n";
scriptEditor.Text = scriptEditor.Text.Replace("\n", Environment.NewLine);
}