mirror of
https://github.com/Difegue/Karen
synced 2025-01-08 11:58:02 +08:00
Revert "Switch to using a native Redis server"
This reverts the last three commits.
This commit is contained in:
parent
3ad0b1a1d9
commit
1a9d2bae6b
@ -1,23 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Karen.Interop
|
|
||||||
{
|
|
||||||
public static class RedisServer
|
|
||||||
{
|
|
||||||
|
|
||||||
public static void Start(string contentFolder)
|
|
||||||
{
|
|
||||||
Process.Start(new ProcessStartInfo(".\\Redis\\redis-server.exe", $".\\Redis\\redis.conf --dir '{contentFolder}/' --daemonize yes") { UseShellExecute = false });
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Stop()
|
|
||||||
{
|
|
||||||
Process.Start(new ProcessStartInfo("taskkill", "/F /IM redis-server.exe") { UseShellExecute = false});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -87,10 +87,8 @@ namespace Karen.Interop
|
|||||||
string contentFolder = GetWSLPath(winPath);
|
string contentFolder = GetWSLPath(winPath);
|
||||||
string thumbnailFolder = string.IsNullOrWhiteSpace(thumbPath) ? contentFolder + "/thumb" : GetWSLPath(thumbPath);
|
string thumbnailFolder = string.IsNullOrWhiteSpace(thumbPath) ? contentFolder + "/thumb" : GetWSLPath(thumbPath);
|
||||||
|
|
||||||
// Start native Redis server
|
|
||||||
RedisServer.Start(winPath);
|
|
||||||
|
|
||||||
var wslCommands = new List<string>();
|
var wslCommands = new List<string>();
|
||||||
|
|
||||||
|
|
||||||
var driveLetter = winPath.Split('\\')[0];
|
var driveLetter = winPath.Split('\\')[0];
|
||||||
if (!IsLocalDrive(driveLetter))
|
if (!IsLocalDrive(driveLetter))
|
||||||
@ -116,7 +114,8 @@ namespace Karen.Interop
|
|||||||
wslCommands.Add($"export LRR_DATA_DIRECTORY='{contentFolder}'");
|
wslCommands.Add($"export LRR_DATA_DIRECTORY='{contentFolder}'");
|
||||||
wslCommands.Add($"export LRR_THUMB_DIRECTORY='{thumbnailFolder}'");
|
wslCommands.Add($"export LRR_THUMB_DIRECTORY='{thumbnailFolder}'");
|
||||||
wslCommands.Add($"cd /home/koyomi/lanraragi && rm -f public/temp/server.pid");
|
wslCommands.Add($"cd /home/koyomi/lanraragi && rm -f public/temp/server.pid");
|
||||||
wslCommands.Add($"mkdir -p log && mkdir -p content && mkdir -p database");
|
wslCommands.Add($"mkdir -p log && mkdir -p content && mkdir -p database && sysctl vm.overcommit_memory=1");
|
||||||
|
wslCommands.Add($"redis-server /home/koyomi/lanraragi/tools/build/docker/redis.conf --dir '{contentFolder}/' --daemonize yes");
|
||||||
wslCommands.Add($"perl ./script/launcher.pl -f ./script/lanraragi");
|
wslCommands.Add($"perl ./script/launcher.pl -f ./script/lanraragi");
|
||||||
|
|
||||||
// Concat all commands into one string we'll throw at WSL
|
// Concat all commands into one string we'll throw at WSL
|
||||||
@ -140,9 +139,7 @@ namespace Karen.Interop
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool? StopApp()
|
public bool? StopApp()
|
||||||
{
|
{
|
||||||
RedisServer.Stop();
|
|
||||||
|
|
||||||
// Kill WSL Process
|
// Kill WSL Process
|
||||||
if (_lrrProc != null && !_lrrProc.HasExited)
|
if (_lrrProc != null && !_lrrProc.HasExited)
|
||||||
{
|
{
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<Separator Height="12" Margin="0"/>
|
<Separator Height="12" Margin="0"/>
|
||||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}">
|
<TextBlock Style="{StaticResource BodyTextBlockStyle}">
|
||||||
You're using the <Hyperlink NavigateUri="https://github.com/Difegue/Karen" RequestNavigate="Hyperlink_RequestNavigate">Karen</Hyperlink> Bootstrapper for <Hyperlink NavigateUri="https://github.com/Difegue/LANraragi" RequestNavigate="Hyperlink_RequestNavigate">LANraragi</Hyperlink>,
|
You're using the <Hyperlink NavigateUri="https://github.com/Difegue/Karen" RequestNavigate="Hyperlink_RequestNavigate">Karen</Hyperlink> Bootstrapper for <Hyperlink NavigateUri="https://github.com/Difegue/LANraragi" RequestNavigate="Hyperlink_RequestNavigate">LANraragi</Hyperlink>,
|
||||||
<LineBreak/> Version 2.8 <emoji:TextBlock Text="🐝"/>
|
<LineBreak/> Version 2.7 <emoji:TextBlock Text="🐝"/>
|
||||||
<LineBreak/>
|
<LineBreak/>
|
||||||
<emoji:TextBlock Text="✨"/> Consider installing <Hyperlink NavigateUri="ms-windows-store://pdp/?ProductId=9MZ6BWWVSWJH&mode=mini" RequestNavigate="Hyperlink_RequestNavigate">LRReader</Hyperlink> from the Microsoft Store! <emoji:TextBlock Text="✨"/>
|
<emoji:TextBlock Text="✨"/> Consider installing <Hyperlink NavigateUri="ms-windows-store://pdp/?ProductId=9MZ6BWWVSWJH&mode=mini" RequestNavigate="Hyperlink_RequestNavigate">LRReader</Hyperlink> from the Microsoft Store! <emoji:TextBlock Text="✨"/>
|
||||||
<LineBreak/>
|
<LineBreak/>
|
||||||
|
@ -13,6 +13,6 @@ Works on Windows 10 1903 and up.
|
|||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
Add the WSL Distro package.tar in External/, alongside an unpacked build of [Redis for Windows](https://github.com/redis-windows/redis-windows) in a "Redis" directory.
|
Add the WSL Distro package.tar in External/, alongside a LxRunOffline folder containing a version of LxRunOffline: https://github.com/DDoSolitary/LxRunOffline/releases
|
||||||
|
|
||||||
Then simply build the solution.
|
Then simply build the solution.
|
||||||
|
@ -40,13 +40,10 @@ namespace Setup
|
|||||||
var project = new Project("LANraragi",
|
var project = new Project("LANraragi",
|
||||||
new Dir(@"%AppData%\LANraragi",
|
new Dir(@"%AppData%\LANraragi",
|
||||||
new Files(@"..\Karen\bin\Release\net472\win7-x64\*.*"),
|
new Files(@"..\Karen\bin\Release\net472\win7-x64\*.*"),
|
||||||
new File(@"..\DistroInstaller\bin\Release\net472\win7-x64\DistroInstaller.exe"), //DesktopBridge.Helpers.dll already in the global Files match above
|
new File(@"..\DistroInstaller\bin\Release\net472\win7-x64\DistroInstaller.exe"), //DesktopBridge.Helpers.dll already in the global Files match above
|
||||||
new File(@"..\External\package.tar"),
|
new File(@"..\External\package.tar"),
|
||||||
new Dir(@"Redis",
|
uninstallerShortcut
|
||||||
new Files(@"..\External\Redis\*.*")
|
),
|
||||||
),
|
|
||||||
uninstallerShortcut
|
|
||||||
),
|
|
||||||
new Dir(@"%ProgramMenu%\LANraragi for Windows",
|
new Dir(@"%ProgramMenu%\LANraragi for Windows",
|
||||||
new ExeFileShortcut("LANraragi", "[INSTALLDIR]Karen.exe", "")),
|
new ExeFileShortcut("LANraragi", "[INSTALLDIR]Karen.exe", "")),
|
||||||
new RegValue(RegistryHive.LocalMachineOrUsers, @"Software\Microsoft\Windows\CurrentVersion\Run", "Karen", "[INSTALLDIR]Karen.exe"),
|
new RegValue(RegistryHive.LocalMachineOrUsers, @"Software\Microsoft\Windows\CurrentVersion\Run", "Karen", "[INSTALLDIR]Karen.exe"),
|
||||||
|
Loading…
Reference in New Issue
Block a user