Remove COM reference for .NET Core (#6975)

* Remove COM reference for .NET Core

Removing only COM reference to get closer to having Jackett to run on .NET Core for Windows

* Handle resources

https://github.com/microsoft/msbuild/issues/4704

* Remove GenerateResourceUsePreserializedResources

* Remove System.Resources.Extensions
This commit is contained in:
junglebus 2020-01-20 04:50:12 +11:00 committed by garfield69
parent fe3ca03847
commit e695f90c80
4 changed files with 24 additions and 19 deletions

View File

@ -37,6 +37,7 @@
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -12,17 +12,6 @@
<PackageReference Include="CommandLineParser" Version="2.7.82" />
</ItemGroup>
<ItemGroup>
<COMReference Include="IWshRuntimeLibrary.dll">
<Guid>f935dc20-1cf0-11d0-adb9-00c04fd58a0b</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<WrapperTool>tlbimp</WrapperTool>
<Lcid>0</Lcid>
<Isolated>false</Isolated>
</COMReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Jackett.Common\Jackett.Common.csproj" />
</ItemGroup>

View File

@ -139,7 +139,14 @@ namespace Jackett.Tray
{
get
{
return File.Exists(ShortcutPath);
if (File.Exists(ShortcutPath) || File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "Jackett.lnk")))
{
return true;
}
else
{
return false;
}
}
set
{
@ -158,7 +165,7 @@ namespace Jackett.Tray
{
get
{
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "Jackett.lnk");
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "Jackett.url");
}
}
@ -166,12 +173,15 @@ namespace Jackett.Tray
{
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
var appPath = Assembly.GetExecutingAssembly().Location;
var shell = new IWshRuntimeLibrary.WshShell();
var shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(ShortcutPath);
shortcut.Description = Assembly.GetExecutingAssembly().GetName().Name;
shortcut.TargetPath = appPath;
shortcut.Save();
using (StreamWriter writer = new StreamWriter(ShortcutPath))
{
var appPath = Assembly.GetExecutingAssembly().Location;
writer.WriteLine("[InternetShortcut]");
writer.WriteLine("URL=file:///" + appPath);
writer.WriteLine("IconIndex=0");
string icon = appPath.Replace('\\', '/');
writer.WriteLine("IconFile=" + icon);
}
}
}

View File

@ -9,6 +9,11 @@
<ServerGarbageCollection>false</ServerGarbageCollection>
</PropertyGroup>
<!-- Conditionally obtain references for the .NET461 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Jackett.Common\Jackett.Common.csproj" />
</ItemGroup>