Removed ngen from the installer

Moved the SvgImage to GreenshotPlugin, so it's available everywhere
Upgraded Dapplo.Jira to a more modern version, but still far from current.
This commit is contained in:
Robin Krom 2020-02-19 22:01:56 +01:00
commit 7e99478b86
8 changed files with 172 additions and 190 deletions

View file

@ -595,19 +595,6 @@ begin
Result := netfxspversion(NetFx4x, '') >= 71;
end;
function getNGENPath(argument: String) : String;
var
installPath: string;
begin
if not RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'InstallPath', installPath) then begin
if not RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client', 'InstallPath', installPath) then begin
// 3.5 doesn't have NGEN and is using the .net 2.0 installation
installPath := ExpandConstant('{dotnet20}');
end;
end;
Result := installPath;
end;
// Initialize the setup
function InitializeSetup(): Boolean;
begin
@ -640,14 +627,8 @@ begin
end;
[Run]
Filename: "{code:getNGENPath}\ngen.exe"; Parameters: "install ""{app}\{#ExeName}.exe"""; StatusMsg: "{cm:optimize}"; Flags: runhidden runasoriginaluser
Filename: "{code:getNGENPath}\ngen.exe"; Parameters: "install ""{app}\GreenshotPlugin.dll"""; StatusMsg: "{cm:optimize}"; Flags: runhidden runasoriginaluser
Filename: "{app}\{#ExeName}.exe"; Description: "{cm:startgreenshot}"; Parameters: "{code:GetParamsForGS}"; WorkingDir: "{app}"; Flags: nowait postinstall runasoriginaluser
Filename: "http://getgreenshot.org/thank-you/?language={language}&version={#Version}"; Flags: shellexec runasoriginaluser
[InstallDelete]
Name: {app}; Type: dirifempty;
[UninstallRun]
Filename: "{code:GetNGENPath}\ngen.exe"; Parameters: "uninstall ""{app}\{#ExeName}.exe"""; StatusMsg: "Cleanup"; Flags: runhidden
Filename: "{code:GetNGENPath}\ngen.exe"; Parameters: "uninstall ""{app}\GreenshotPlugin.dll"""; StatusMsg: "Cleanup"; Flags: runhidden

View file

@ -20,12 +20,12 @@
*/
using System;
using System.Globalization;
using System.Windows.Forms;
using Dapplo.Jira.Entities;
using GreenshotPlugin.Controls;
using GreenshotPlugin.Core;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using GreenshotPlugin.IniFile;
@ -176,7 +176,9 @@ namespace GreenshotJiraPlugin.Forms {
}
item.SubItems.Add(issue.Key);
item.SubItems.Add(issue.Fields.Created.ToString("d", DateTimeFormatInfo.InvariantInfo));
item.SubItems.Add(issue.Fields.Created.HasValue
? issue.Fields.Created.Value.ToString("d", DateTimeFormatInfo.InvariantInfo)
: string.Empty);
item.SubItems.Add(issue.Fields.Assignee?.DisplayName);
item.SubItems.Add(issue.Fields.Reporter?.DisplayName);
item.SubItems.Add(issue.Fields.Summary);

View file

@ -12,7 +12,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj" />
<PackageReference Include="Dapplo.Jira" version="0.5.12" />
<PackageReference Include="Svg" version="2.3.0" />
<PackageReference Include="Dapplo.Jira" version="0.6.50" />
</ItemGroup>
</Project>

View file

@ -90,21 +90,6 @@ namespace GreenshotJiraPlugin {
LogSettings.RegisterDefaultLogger<Log4NetLogger>(LogLevels.Fatal);
}
// Add a SVG converter, although it doesn't fit to the Jira plugin there is currently no other way
ImageHelper.StreamConverters["svg"] = (stream, s) =>
{
stream.Position = 0;
try
{
return SvgImage.FromStream(stream).Image;
}
catch (Exception ex)
{
Log.Error("Can't load SVG", ex);
}
return null;
};
return true;
}

View file

@ -60,6 +60,21 @@ namespace GreenshotPlugin.Core {
return surface.GetImageForExport();
};
// Add a SVG converter
StreamConverters["svg"] = (stream, s) =>
{
stream.Position = 0;
try
{
return SvgImage.FromStream(stream).Image;
}
catch (Exception ex)
{
Log.Error("Can't load SVG", ex);
}
return null;
};
static Image DefaultConverter(Stream stream, string s)
{
stream.Position = 0;

View file

@ -22,15 +22,14 @@
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using GreenshotPlugin.Core;
using Svg;
namespace GreenshotJiraPlugin
namespace GreenshotPlugin.Core
{
/// <summary>
/// Create an image look like of the SVG
/// </summary>
public class SvgImage : IImage
public sealed class SvgImage : IImage
{
private readonly SvgDocument _svgDocument;
@ -88,7 +87,7 @@ namespace GreenshotJiraPlugin
public float VerticalResolution => Image.VerticalResolution;
/// <summary>
/// Unterlying image, or an on demand rendered version with different attributes as the original
/// Underlying image, or an on demand rendered version with different attributes as the original
/// </summary>
public Image Image
{

View file

@ -15,6 +15,7 @@
<ItemGroup>
<PackageReference Include="log4net" version="2.0.8" />
<PackageReference Include="Svg" Version="3.0.102" />
<Reference Include="Accessibility" />
<Reference Include="CustomMarshalers" />
</ItemGroup>