Skip to content

Commit

Permalink
v1.0.7 src: Wallpaper preview and fixes
Browse files Browse the repository at this point in the history
- Wallpaper preview - opens a live preview of the wallpaper in a new window with full input support.
- Fixed a bug where it was not possible to customise wallpaper properties of multiple wallpapers in duplicate mode.
-Resolved: #127
Fixed a bug where system-traymenu appears on different screen than the one where cursor is present.
- Temporarily removed libvlc videoplayer and and disabled Convert to video feature.
- Resolved: #125
Installer now checks whether .net core is installed.
- Updated some localization texts.
  • Loading branch information
rocksdanister committed Sep 9, 2020
1 parent a647198 commit 4ce8720
Show file tree
Hide file tree
Showing 42 changed files with 451 additions and 159 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ Help translate lively to other languages: <a href="https://github.com/rocksdanis

**_I'm not officially affiliated with Unity technologies, godot, shadertoy;_**
## Download
##### Latest version: v1.0.5.0 (Windows 10 1903 or above)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v1.0.5.0)
##### Latest version: v1.0.7.0 (Windows 10 1903 or above)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v1.0.7.0)
- [`Download Lively Wallpaper`][direct-full-win32]

[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v1.0.5.0/lively_setup_x86_full_v1050.exe
[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v1.0.7.0/lively_setup_x86_full_v1070.exe

**Installer will give Smartscreen warning, [discussion.](https://github.com/rocksdanister/lively/issues/9)**

Expand Down
22 changes: 19 additions & 3 deletions src/installer/Script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; https://jrsoftware.org/isinfo.php

#define MyAppName "Lively Wallpaper"
#define MyAppVersion "1.0.5.0"
#define MyAppVersion "1.0.7.0"
#define MyAppPublisher "rocksdanister"
#define MyAppURL "https://github.com/rocksdanister/lively"
#define MyAppExeName "livelywpf.exe"
Expand Down Expand Up @@ -68,6 +68,7 @@ Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType:
[Files]
Source: "VC\VC_redist.x86.exe"; DestDir: {tmp}; Flags: deleteafterinstall
Source: "dotnetcore\windowsdesktop-runtime-3.1.7-win-x86.exe"; DestDir: {tmp}; Flags: deleteafterinstall
Source: "dotnetcore\netcorecheck.exe"; DestDir: {tmp}; Flags: deleteafterinstall

; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: "Release\livelywpf.exe"; DestDir: "{app}"; Flags: ignoreversion;
Expand All @@ -81,8 +82,7 @@ Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: de
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall
;skipifsilent
Filename: "{tmp}\VC_redist.x86.exe"; Check: VCRedistNeedsInstall; StatusMsg: Installing Visual Studio Runtime Libraries...
;todo: check if .net core is already installed.
Filename: "{tmp}\windowsdesktop-runtime-3.1.7-win-x86.exe"; StatusMsg: Installing .Net Core 3.1...
Filename: "{tmp}\windowsdesktop-runtime-3.1.7-win-x86.exe"; Check: NetCoreNeedsInstall('3.1.7'); StatusMsg: Installing .Net Core 3.1...

[Code]
var
Expand Down Expand Up @@ -213,6 +213,7 @@ begin
end;
//////////////////////////////////////////////////////////////////////
// Uninstaller promts user whether to close lively if running before proceeding.
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
Expand All @@ -226,3 +227,18 @@ begin
Result := True;
end;
//////////////////////////////////////////////////////////////////////
// Credits: https://github.com/domgho/InnoDependencyInstaller
// NetCoreCheck tool is necessary for detecting if a specific version of .NET Core/.NET 5.0 is installed: https://github.com/dotnet/runtime/issues/36479
// Source code: https://github.com/dotnet/deployment-tools/tree/master/src/clickonce/native/projects/NetCoreCheck
// Download netcorecheck.exe: https://go.microsoft.com/fwlink/?linkid=2135256
// Download netcorecheck_x64.exe: https://go.microsoft.com/fwlink/?linkid=2135504
function NetCoreNeedsInstall(version: String): Boolean;
var
netcoreRuntime: String;
resultCode: Integer;
begin
// Example: 'Microsoft.NETCore.App', 'Microsoft.AspNetCore.App', 'Microsoft.WindowsDesktop.App'
netcoreRuntime := 'Microsoft.WindowsDesktop.App'
Result := not(Exec(ExpandConstant('{tmp}{\}') + 'netcorecheck.exe', netcoreRuntime + ' ' + version, '', SW_HIDE, ewWaitUntilTerminated, resultCode) and (resultCode = 0));
end;
5 changes: 3 additions & 2 deletions src/livelywpf/UserControls/livelygrid/LivelyGridView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@
<MenuFlyout.Items>
<MenuFlyoutItem x:Name="moreInformation" Text="{x:Bind UIText.TextInformation}" Click="contextMenu_Click"/>
<MenuFlyoutItem x:Name="setWallpaper" Text="{x:Bind UIText.TextSetWallpaper}" Click="contextMenu_Click"/>
<MenuFlyoutItem x:Name="showOnDisk" Text="{x:Bind UIText.TextShowDisk}" Click="contextMenu_Click"/>
<MenuFlyoutItem x:Name="previewWallpaper" Text="{x:Bind UIText.TextPreviewWallpaper}" Click="contextMenu_Click"/>
<MenuFlyoutItem x:Name="customiseWallpaper" Text="{x:Bind UIText.TextCustomise}" Click="contextMenu_Click"/>
<MenuFlyoutItem x:Name="showOnDisk" Text="{x:Bind UIText.TextShowDisk}" Click="contextMenu_Click"/>
<MenuFlyoutItem x:Name="exportWallpaper" Text="{x:Bind UIText.TextExportZip}" Click="contextMenu_Click"/>
<MenuFlyoutItem x:Name="convertVideo" Text="{x:Bind UIText.TextConvertVideo}" Click="contextMenu_Click"/>
<MenuFlyoutItem x:Name="convertVideo" Text="{x:Bind UIText.TextConvertVideo}" Click="contextMenu_Click" IsEnabled="False"/>
<MenuFlyoutItem x:Name="deleteWallpaper" Text="{x:Bind UIText.TextDelete}" Click="contextMenu_Click"/>
</MenuFlyout.Items>
</MenuFlyout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class LocalizeTextGridView
public string TextExportZip { get; set; }
public string TextDelete { get; set; }
public string TextAddWallpaper { get; set; }
public string TextPreviewWallpaper { get; set; }
}

public sealed partial class LivelyGridView : UserControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
</ComboBox>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipBrowserEngine}"/>

<CheckBox Content="{x:Bind UIText.TitleDiskCache}" IsEnabled="False" Margin="0, 5, 0, 0"/>
<CheckBox Content="{x:Bind UIText.TitleDiskCache}" Margin="0, 5, 0, 0" IsChecked="{Binding CefDiskCache, Mode=TwoWay}" IsEnabled="False"/>
<TextBlock Margin="0,10,0,0" FontSize="12" TextWrapping="Wrap" Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" Text="{x:Bind UIText.TipDisCache}"/>

<TextBlock Margin="0, 10, 0, 0" Text="{x:Bind UIText.TitleBrowserDebuggingPort}"/>
Expand Down
1 change: 1 addition & 0 deletions src/livelywpf/livelySubProcess/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace livelySubProcess
/// <summary>
/// Kills external application type wallpapers in the event lively main pgm is killed by taskmanager/other pgms like av software.
/// This is just incase safety, when shutdown properly the "wpItems" list is cleared by lively before exit.
/// The external lively pgms such as livelycefsharp and libmpvplayer etc will close themselves if lively exits without subprocess.
/// </summary>
class Program
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private static void ForwardMessage(int x, int y, int msg, IntPtr wParam)
x.GetWallpaperType() == WallpaperType.godot)
{
if (ScreenHelper.ScreenCompare(display, x.GetScreen(), DisplayIdentificationMode.screenLayout) ||
Program.SettingsVM.Settings.WallpaperArrangement == WallpaperArrangement.span)
Program.SettingsVM.Settings.WallpaperArrangement == WallpaperArrangement.span)
{
//The low-order word specifies the x-coordinate of the cursor, the high-order word specifies the y-coordinate of the cursor.
//ref: https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mousemove
Expand Down
20 changes: 15 additions & 5 deletions src/livelywpf/livelywpf/Core/SetupDesktop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public static void SetWallpaper(LibraryModel wp, LivelyScreen targetDisplay)
}

if(wp.LivelyInfo.Type == WallpaperType.web
|| wp.LivelyInfo.Type == WallpaperType.webaudio
|| wp.LivelyInfo.Type == WallpaperType.url)
|| wp.LivelyInfo.Type == WallpaperType.webaudio
|| wp.LivelyInfo.Type == WallpaperType.url)
{
wp.ItemStartup = true;
var item = new WebProcess(wp.FilePath, wp, targetDisplay);
Expand All @@ -131,8 +131,8 @@ public static void SetWallpaper(LibraryModel wp, LivelyScreen targetDisplay)
item.Show();
}
if (wp.LivelyInfo.Type == WallpaperType.app
|| wp.LivelyInfo.Type == WallpaperType.godot
|| wp.LivelyInfo.Type == WallpaperType.unity)
|| wp.LivelyInfo.Type == WallpaperType.godot
|| wp.LivelyInfo.Type == WallpaperType.unity)
{
System.Windows.MessageBox.Show("not supported currently");
return;
Expand Down Expand Up @@ -217,9 +217,10 @@ public static void SetWallpaper(LibraryModel wp, LivelyScreen targetDisplay)
private static async void SetupDesktop_WallpaperInitialized(object sender, WindowInitializedArgs e)
{
await semaphoreSlimWallpaperInitLock.WaitAsync();
IWallpaper wallpaper = null;
try
{
var wallpaper = (IWallpaper)sender;
wallpaper = (IWallpaper)sender;
wallpapersPending.Remove(wallpaper);
wallpaper.WindowInitialized -= SetupDesktop_WallpaperInitialized;
await System.Windows.Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new ThreadStart(delegate
Expand Down Expand Up @@ -310,6 +311,15 @@ private static async void SetupDesktop_WallpaperInitialized(object sender, Windo
MessageBox.Show(e.Error.Message, Properties.Resources.TitleAppName);
}
}
catch(Exception ex)
{
Logger.Error("Core: Failed processing wallpaper: " + ex.ToString());
if(wallpaper != null)
{
wallpaper.Terminate();
}
WallpaperChanged?.Invoke(null, null);
}
finally
{
semaphoreSlimWallpaperInitLock.Release();
Expand Down
50 changes: 15 additions & 35 deletions src/livelywpf/livelywpf/Core/Wallpapers/WebProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Diagnostics;
using System.IO;
using System.Management;
using System.Text;

namespace livelywpf.Core
{
Expand Down Expand Up @@ -42,56 +43,35 @@ public WebProcess(string path, LibraryModel model, LivelyScreen display)
}
}

string cmdArgs;
if (model.LivelyInfo.Type == WallpaperType.web)
StringBuilder cmdArgs = new StringBuilder();
cmdArgs.Append("--url " + "\"" + path + "\"" + " --display " + "\"" + display + "\"");
cmdArgs.Append(model.LivelyInfo.Type == WallpaperType.url ? " --type online" : " --type local" + " --property " + "\"" + LivelyPropertyCopy + "\"");
//Fail to send empty string as arg; "debug" is set as optional variable in cmdline parser library.
if (!string.IsNullOrWhiteSpace(Program.SettingsVM.Settings.WebDebugPort))
{
//Fail to send empty string as arg; "debug" is set as optional variable in cmdline parser library.
if (string.IsNullOrWhiteSpace(Program.SettingsVM.Settings.WebDebugPort))
{
cmdArgs = "--url " + "\"" + path + "\"" + " --type local" + " --display " + "\"" + display + "\"" +
" --property " + "\"" + LivelyPropertyCopy + "\"";
}
else
{
cmdArgs = "--url " + "\"" + path + "\"" + " --type local" + " --display " + "\"" + display + "\"" +
" --property " + "\"" + LivelyPropertyCopy + "\"" + " --debug " + Program.SettingsVM.Settings.WebDebugPort;
}
cmdArgs.Append(" --debug " + Program.SettingsVM.Settings.WebDebugPort);
}
else if (model.LivelyInfo.Type == WallpaperType.webaudio)

if (Program.SettingsVM.Settings.CefDiskCache)
{
if (string.IsNullOrWhiteSpace(Program.SettingsVM.Settings.WebDebugPort))
{
cmdArgs = "--url " + "\"" + path + "\"" + " --type local" + " --display " + "\"" + display + "\"" + " --audio true" +
" --property " + "\"" + LivelyPropertyCopy + "\"";
}
else
{
cmdArgs = "--url " + "\"" + path + "\"" + " --type local" + " --display " + "\"" + display + "\"" + " --audio true" +
" --property " + "\"" + LivelyPropertyCopy + "\"" + " --debug " + Program.SettingsVM.Settings.WebDebugPort;
}
cmdArgs.Append(" --cache " + "\"" + Path.Combine(Program.AppDataDir, "Cef", "cache", display.DeviceNumber) + "\"");
}
else

if (model.LivelyInfo.Type == WallpaperType.webaudio)
{
if (string.IsNullOrWhiteSpace(Program.SettingsVM.Settings.WebDebugPort))
{
cmdArgs = "--url " + "\"" + path + "\"" + " --type online" + " --display " + "\"" + display + "\"";
}
else
{
cmdArgs = "--url " + "\"" + path + "\"" + " --type online" + " --display " + "\"" + display + "\"" +
" --debug " + Program.SettingsVM.Settings.WebDebugPort;
}
cmdArgs.Append(" --audio true");
}

ProcessStartInfo start = new ProcessStartInfo
{
Arguments = cmdArgs,
Arguments = cmdArgs.ToString(),
FileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "plugins", "cef", "LivelyCefSharp.exe"),
RedirectStandardInput = true,
RedirectStandardOutput = true,
UseShellExecute = false,
WorkingDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "plugins", "cef")
};
cmdArgs.Clear();

Process webProcess = new Process
{
Expand Down
Loading

0 comments on commit 4ce8720

Please sign in to comment.