Skip to content

Commit a2b515f

Browse files
committed
Switch to geckofx45
This comes in via nuget no longer need to download xulrunner separately.
1 parent 539a126 commit a2b515f

8 files changed

+1058
-43
lines changed

.vs/config/applicationhost.config

+1,038
Large diffs are not rendered by default.

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,5 @@ So GekkotaSharp is trying to find out if we can have the best of both worlds, an
4545
### Building
4646

4747
netsh http add urlacl url=http://+:5432/ user=everyone
48-
unzip http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/18.0.2/runtimes/ into lib, so you have lib/xulrunner.
4948
You'll need npm, grunt, bower, etc.
5049
Open solution, build. That should run npm install and run then angularjs-based sample app.

lib/geckofx18/Geckofx-Winforms-18.dll

-126 KB
Binary file not shown.

lib/geckofx18/geckofx-core-18.dll

-1.98 MB
Binary file not shown.

lib/geckofx18/geckofx-core-18.dll.config

-3
This file was deleted.

src/GekkotaSharp/GeckoFxInitializer.cs

+4-35
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,17 @@
11
using System;
2-
using System.Diagnostics;
32
using System.IO;
43
using System.Reflection;
5-
using System.Runtime.InteropServices;
6-
using System.Windows.Forms;
4+
using Gecko;
75

86
namespace Gekkota
97
{
108
public class GeckoFxInitializer
11-
{
12-
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
13-
[return: MarshalAs(UnmanagedType.Bool)]
14-
static extern bool SetDllDirectory(string lpPathName);
15-
9+
{
1610
public static void SetUpXulRunner()
1711
{
18-
if (Gecko.Xpcom.IsInitialized)
12+
if (Xpcom.IsInitialized)
1913
return;
20-
21-
string xulRunnerPath = Path.Combine(DirectoryOfApplicationOrSolution, "xulrunner");
22-
if (!Directory.Exists(xulRunnerPath))
23-
{
24-
//if this is a programmer, go look in the lib directory
25-
xulRunnerPath = Path.Combine(DirectoryOfApplicationOrSolution,
26-
Path.Combine("lib", "xulrunner"));
27-
}
28-
//Review: an early tester found that wrong xpcom was being loaded. The following solution is from http://www.geckofx.org/viewtopic.php?id=74&action=new
29-
SetDllDirectory(xulRunnerPath);
30-
31-
try
32-
{
33-
Gecko.Xpcom.Initialize(xulRunnerPath);
34-
}
35-
catch (Exception)
36-
{
37-
#if DEBUG
38-
MessageBox.Show("Make sure the directory holding XulRunner 18 is at lib/XulRunner. We'll open a browser there for you now.");
39-
Process.Start("http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/18.0.2/runtimes/");
40-
Environment.FailFast("Exiting for lack of XulRunner");
41-
#endif
42-
43-
throw;
44-
}
45-
14+
Xpcom.Initialize("Firefox");
4615
}
4716

4817
/// <summary>

src/GekkotaSharp/GekkotaSharp.csproj

+15-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />
15+
<NuGetPackageImportStamp>
16+
</NuGetPackageImportStamp>
1517
</PropertyGroup>
1618
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1719
<DebugSymbols>true</DebugSymbols>
@@ -32,11 +34,13 @@
3234
<WarningLevel>4</WarningLevel>
3335
</PropertyGroup>
3436
<ItemGroup>
35-
<Reference Include="geckofx-core-18">
36-
<HintPath>..\..\lib\geckofx18\geckofx-core-18.dll</HintPath>
37+
<Reference Include="Geckofx-Core, Version=45.0.10.0, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=x86">
38+
<HintPath>..\..\packages\Geckofx45.45.0.10.0\lib\net40\Geckofx-Core.dll</HintPath>
39+
<Private>True</Private>
3740
</Reference>
38-
<Reference Include="Geckofx-Winforms-18">
39-
<HintPath>..\..\lib\geckofx18\Geckofx-Winforms-18.dll</HintPath>
41+
<Reference Include="Geckofx-Winforms, Version=45.0.10.0, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=MSIL">
42+
<HintPath>..\..\packages\Geckofx45.45.0.10.0\lib\net40\Geckofx-Winforms.dll</HintPath>
43+
<Private>True</Private>
4044
</Reference>
4145
<Reference Include="Newtonsoft.Json">
4246
<HintPath>..\..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
@@ -86,6 +90,13 @@
8690
<None Include="packages.config" />
8791
</ItemGroup>
8892
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
93+
<Import Project="..\..\packages\Geckofx45.45.0.10.0\build\Geckofx45.targets" Condition="Exists('..\..\packages\Geckofx45.45.0.10.0\build\Geckofx45.targets')" />
94+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
95+
<PropertyGroup>
96+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
97+
</PropertyGroup>
98+
<Error Condition="!Exists('..\..\packages\Geckofx45.45.0.10.0\build\Geckofx45.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Geckofx45.45.0.10.0\build\Geckofx45.targets'))" />
99+
</Target>
89100
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
90101
Other similar extension points exist, see Microsoft.Common.targets.
91102
<Target Name="BeforeBuild">

src/GekkotaSharp/packages.config

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Geckofx45" version="45.0.10.0" targetFramework="net40" />
34
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.20710.0" targetFramework="net40" />
45
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0" targetFramework="net40" />
56
<package id="Microsoft.AspNet.WebApi.SelfHost" version="4.0.20918.0" targetFramework="net40" />

0 commit comments

Comments
 (0)