Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/03/19 18:16:56 (5 years ago)
Author:
gkronber
Message:

#2964: merged r16309, r16341, r16342, r16343 from trunk to stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame

    r15587 r16492  
    2424using System.Text;
    2525using HeuristicLab.PluginInfrastructure;
     26using System.Runtime.InteropServices;
     27using System.IO;
    2628
    2729namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
     
    4244  [PluginDependency("HeuristicLab.MainForm", "3.3")]
    4345  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
    44   [PluginDependency("HeuristicLab.MathJax", "1.1")]
     46  [PluginDependency("HeuristicLab.MathJax", "1.2")]
    4547  [PluginDependency("HeuristicLab.Optimization","3.3")]
    4648  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
    4749  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
    4850  public class HeuristicLabProblemsDataAnalysisSymbolicViewsPlugin : PluginBase {
     51    // HeuristicLab is marked with zone identifier 'Internet' after download.
     52    // This propagates to all extracted files and can be checked in the file properties.
     53    // IE prevents execution of MathJax JavaScript inside of untrusted html
     54    // Therefore we need to programmatically unblock the displayModelFrame.html file before extracting.
     55    // see http://engram404.net/programmatically-unblocking-downloaded-files/
     56
     57    // for removing the Zone.Identifier alternative NTFS stream (effectively unblocking the file)
     58    [DllImport("kernel32.dll", SetLastError = true)]
     59    private static extern bool DeleteFile(string lpFileName);
     60
     61    public override void OnLoad() {
     62      base.OnLoad();
     63
     64      // unblock mathjax.zip ()
     65      DeleteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "displayModelFrame.html:Zone.Identifier"));
     66    }
    4967  }
    5068}
Note: See TracChangeset for help on using the changeset viewer.