diff --git a/Build.bat b/Build.bat
new file mode 100644
index 000000000..8ee0b9dc0
--- /dev/null
+++ b/Build.bat
@@ -0,0 +1,15 @@
+
+rmdir /s /q build
+cd src
+Msbuild Jackett.sln /t:Clean,Build /p:Configuration=Release
+cd ..
+
+xcopy src\Jackett.Console\bin\Release Build\ /e /y
+copy /Y src\Jackett.Service\bin\Release\JackettService.exe build\JackettService.exe
+copy /Y src\Jackett.Service\bin\Release\JackettService.exe.config build\JackettService.exe.config
+copy /Y src\Jackett.Tray\bin\Release\JackettTray.exe build\JackettTray.exe
+copy /Y src\Jackett.Tray\bin\Release\JackettTray.exe.config build\JackettTray.exe.config
+cd build
+del *.pdb
+del *.xml
+cd ..
diff --git a/Installer.iss b/Installer.iss
new file mode 100644
index 000000000..9c6361bc4
--- /dev/null
+++ b/Installer.iss
@@ -0,0 +1,58 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+#define MyAppName "Jackett"
+#define MyAppVersion "0.5"
+#define MyAppPublisher "Jackett Inc."
+#define MyAppURL "https://github.com/zone117x/Jackett"
+#define MyAppExeName "JackettTray.exe"
+
+[Setup]
+; NOTE: The value of AppId uniquely identifies this application.
+; Do not use the same AppId value in installers for other applications.
+; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
+AppId={{C2A9FC00-AA48-4F17-9A72-62FBCEE2785B}
+AppName={#MyAppName}
+AppVersion={#MyAppVersion}
+;AppVerName={#MyAppName} {#MyAppVersion}
+AppPublisher={#MyAppPublisher}
+AppPublisherURL={#MyAppURL}
+AppSupportURL={#MyAppURL}
+AppUpdatesURL={#MyAppURL}
+DefaultDirName={pf}\{#MyAppName}
+DefaultGroupName={#MyAppName}
+DisableProgramGroupPage=yes
+OutputBaseFilename=setup
+SetupIconFile=O:\Documents\JackettKayo\src\Jackett.Console\jackett.ico
+Compression=lzma
+SolidCompression=yes
+
+[Languages]
+Name: "english"; MessagesFile: "compiler:Default.isl"
+
+[Tasks]
+Name: "windowsService"; Description: "Install as a Windows Service"
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+
+[Files]
+Source: "O:\Documents\JackettKayo\Build\JackettTray.exe"; DestDir: "{app}"; Flags: ignoreversion
+Source: "O:\Documents\JackettKayo\Build\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+; NOTE: Don't use "Flags: ignoreversion" on any shared system files
+
+[Icons]
+Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
+Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
+Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
+
+[Run]
+Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
+
+[Run]
+Filename: "{app}\JackettConsole.exe"; Parameters: "/u"; Flags: waituntilterminated;
+Filename: "{app}\JackettConsole.exe"; Parameters: "/r"; Flags: waituntilterminated;
+Filename: "{app}\JackettConsole.exe"; Parameters: "/i"; Flags: waituntilterminated; Tasks: windowsService
+
+[UninstallRun]
+Filename: "{app}\JackettConsole.exe"; Parameters: "/u"; Flags: waituntilterminated skipifdoesntexist
+
+
diff --git a/src/Jackett.Console/Jackett.Console.csproj b/src/Jackett.Console/Jackett.Console.csproj
index 54ba94594..918f669ff 100644
--- a/src/Jackett.Console/Jackett.Console.csproj
+++ b/src/Jackett.Console/Jackett.Console.csproj
@@ -77,6 +77,10 @@
..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll
True
+
+ False
+ ..\packages\NLog.4.0.1\lib\net45\NLog.dll
+
..\packages\Owin.1.0\lib\net40\Owin.dll
True
diff --git a/src/Jackett.Console/Program.cs b/src/Jackett.Console/Program.cs
index d1d4c9429..99a610f7c 100644
--- a/src/Jackett.Console/Program.cs
+++ b/src/Jackett.Console/Program.cs
@@ -16,62 +16,34 @@ namespace JackettConsole
{
static void Main(string[] args)
{
-
-
- Server.Start();
- Console.ReadKey();
-
-
- /* var serverTask = Task.Run(async () =>
- {
- ServerInstance = new Server();
- await ServerInstance.Start();
- });
-
try
{
- if (Program.IsWindows)
+ if (args.Length > 0)
{
-#if !__MonoCS__
- Application.Run(new Main());
-#endif
+ switch (args[0].ToLowerInvariant())
+ {
+ case "/i":
+ Engine.ServiceConfig.Install();
+ return;
+ case "/r":
+ Engine.Server.ReserveUrls();
+ return;
+ case "/u":
+ Engine.Server.ReserveUrls(false);
+ Engine.ServiceConfig.Uninstall();
+ return;
+ }
}
+
+ Engine.Server.Start();
+ Engine.Logger.Info("Running in headless mode.");
+ Engine.RunTime.Spin();
+ Engine.Logger.Info("Server thread exit");
}
- catch (Exception)
+ catch(Exception e)
{
-
- }*/
-
- Console.WriteLine("Running in headless mode.");
-
-
-
- // Task.WaitAll(serverTask);
- Console.WriteLine("Server thread exit");
- }
-
- /* public static void RestartServer()
- {
-
- ServerInstance.Stop();
- ServerInstance = null;
- var serverTask = Task.Run(async () =>
- {
- ServerInstance = new Server();
- await ServerInstance.Start();
- });
- Task.WaitAll(serverTask);
- }*/
-
-
-
-
-
- static public void RestartAsAdmin()
- {
- // var startInfo = new ProcessStartInfo(Application.ExecutablePath.ToString()) { Verb = "runas" };
- // Process.Start(startInfo);
- Environment.Exit(0);
+ Engine.Logger.Error(e, "Top level exception");
+ }
}
}
}
diff --git a/src/Jackett.Console/packages.config b/src/Jackett.Console/packages.config
index 4878b92aa..90c9bc1e4 100644
--- a/src/Jackett.Console/packages.config
+++ b/src/Jackett.Console/packages.config
@@ -14,5 +14,6 @@
+
\ No newline at end of file
diff --git a/src/Jackett.Service/App.config b/src/Jackett.Service/App.config
index 88fa4027b..e74e545f8 100644
--- a/src/Jackett.Service/App.config
+++ b/src/Jackett.Service/App.config
@@ -1,6 +1,30 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Jackett.Service/Jackett.Service.csproj b/src/Jackett.Service/Jackett.Service.csproj
index 6e2370814..b9614e42a 100644
--- a/src/Jackett.Service/Jackett.Service.csproj
+++ b/src/Jackett.Service/Jackett.Service.csproj
@@ -36,8 +36,65 @@
jackett.ico
+
+ False
+ ..\packages\Autofac.3.5.0\lib\net40\Autofac.dll
+
+
+ ..\packages\Autofac.Owin.3.1.0\lib\net45\Autofac.Integration.Owin.dll
+
+
+ False
+ ..\packages\Autofac.WebApi2.3.4.0\lib\net45\Autofac.Integration.WebApi.dll
+
+
+ ..\packages\Autofac.WebApi2.Owin.3.2.0\lib\net45\Autofac.Integration.WebApi.Owin.dll
+
+
+ False
+ ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll
+
+
+ False
+ ..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll
+
+
+ ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll
+
+
+ False
+ ..\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll
+
+
+ False
+ ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll
+
+
+ False
+ ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll
+
+
+ False
+ ..\packages\NLog.4.0.1\lib\net45\NLog.dll
+
+
+ False
+ ..\packages\Owin.1.0\lib\net40\Owin.dll
+
+
+ False
+ ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll
+
+
+ False
+ ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll
+
+
+ False
+ ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll
+
@@ -58,10 +115,17 @@
+
+
+
+ {e636d5f8-68b4-4903-b4ed-ccfd9c9e899f}
+ Jackett
+
+