Skip to content

Commit

Permalink
Merge pull request #19 from rocksdanister/dev-build
Browse files Browse the repository at this point in the history
Dev build v0.8.5
  • Loading branch information
rocksdanister authored Feb 19, 2020
2 parents 40f20a4 + 2baa650 commit c532d20
Show file tree
Hide file tree
Showing 27 changed files with 617 additions and 388 deletions.
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Lively is still in development, if you encounter bugs create a github Issue alon

Help translate lively to other languages: <a href="https://github.com/rocksdanister/lively/blob/master/resources/translations">Translation Document</a>

<a href="https://github.com/rocksdanister/lively/wiki">Documentation</a>
<a href="https://github.com/rocksdanister/lively/wiki">Full Documentation</a>
## Features
*Wait a sec, preview gif clips take some time to load.*
#### Video
Expand Down Expand Up @@ -97,26 +97,33 @@ 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: v0.8.0.0 (Windows 10, 8.1)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v0.8.0.0)
- [`Download`][direct-full-win32]
_90MB, Web wallpaper support & some sample wallpapers included._
##### Latest version: v0.8.5.0 (Windows 10, 8.1)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v0.8.5.0)
- [`Download Lively Installer`][direct-full-win32]
_102MB, Web wallpaper support & some sample wallpapers included._
- [`Download Lively Portable`][direct-full-portable-win32]
_111MB, (No Installation) Web wallpaper support & some sample wallpapers included._

**Portable build: Latest Visual C++ Redistributable is required: [vc_redist.x86.exe](https://aka.ms/vs/16/release/vc_redist.x86.exe)**

**Latest Visual C++ Redistributable is required: [vc_redist.x86.exe](https://aka.ms/vs/16/release/vc_redist.x86.exe)**
[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v0.8.0.0/lively_setup_x86_full_v0800.exe
[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v0.8.0.0/lively_setup_x86_full_v0850.exe

[direct-full-portable-win32]: https://github.com/rocksdanister/lively/releases/download/v0.8.5.0/lively_portable_x86_full_v0850.zip

[Trouble Getting started? ](https://github.com/rocksdanister/lively/wiki/Getting-Started)
**Installer will give Smartscreen warning, [discussion.](https://github.com/rocksdanister/lively/issues/9)**

Certain antivirus software heuristics algorithm will detect lively as a virus, this is a false positive
**lively is fully [opensource](https://en.wikipedia.org/wiki/Free_and_open-source_software), you are free to inspect the code.**

[Having trouble? ](https://github.com/rocksdanister/lively/wiki/Common-Problems)
## Issues
[TODO List](https://trello.com/b/rdFFxuMF/lively-wallpaper-system)
~~[TODO List](https://trello.com/b/rdFFxuMF/lively-wallpaper-system)~~

See github [issues.](https://github.com/rocksdanister/lively/issues)

## Contributing
Code contributions are welcome, check [guidelines](https://github.com/rocksdanister/lively/wiki) for making pull request.

Currently Lively is only human translated English & Spanish, other languages are machine translated.
Currently Lively is only human translated in English, Spanish & Italian; other languages are machine translated.

Help translate lively to other languages: <a href="https://github.com/rocksdanister/lively/blob/master/resources/translations">Translation Document</a>

Expand Down
44 changes: 41 additions & 3 deletions src/lively setup/Inno.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Lively Wallpaper"
#define MyAppVersion "0.8.0.0"
#define MyAppVersion "0.8.5.0"
#define MyAppPublisher "rocksdanister"
#define MyAppURL "https://github.com/rocksdanister/lively"
#define MyAppExeName "livelywpf.exe"
Expand Down Expand Up @@ -94,13 +94,15 @@ Name: "cef"; Description: "Web Wallpaper Support"; Types: full
Name: "wallpapers"; Description: "Sample Wallpapers"; Types: full

[Files]
Source: "VC\VC_redist.x86.exe"; DestDir: {tmp}; Flags: deleteafterinstall

; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: "Release\livelywpf.exe"; DestDir: "{app}"; Flags: ignoreversion;Components: program
Source: "Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: program
Source: "Lively Wallpaper\external\cef\*"; DestDir: "{userdocs}\Lively Wallpaper\external\cef"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: cef
Source: "Lively Wallpaper\wallpapers\*"; DestDir: "{userdocs}\Lively Wallpaper\wallpapers"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall; Components: wallpapers; Check: ShouldInstallWallpapers
; pushing new set of wp's with customisation to existing users, shouldInstallWallpaper check will be added from later version onwards..
Source: "Lively Wallpaper\wallpapers new\*"; DestDir: "{userdocs}\Lively Wallpaper\wallpapers"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall; Components: wallpapers;
; pushing new set of wp's with customisation to existing users (v0.8 only), shouldInstallWallpaper check will be added from later version onwards..
Source: "Lively Wallpaper\wallpapers new\*"; DestDir: "{userdocs}\Lively Wallpaper\wallpapers"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall; Components: wallpapers; Check: ShouldInstallWallpapers

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Expand All @@ -109,11 +111,47 @@ Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: de
[Run]
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...

[Code]
var
isAlreadyInstalled: Boolean;
// Visual C++ redistributive component install.
//ref: https://bell0bytes.eu/inno-setup-vc/
type
INSTALLSTATE = Longint;
const
INSTALLSTATE_INVALIDARG = -2; { An invalid parameter was passed to the function. }
INSTALLSTATE_UNKNOWN = -1; { The product is neither advertised or installed. }
INSTALLSTATE_ADVERTISED = 1; { The product is advertised but not installed. }
INSTALLSTATE_ABSENT = 2; { The product is installed for a different user. }
INSTALLSTATE_DEFAULT = 5; { The product is installed for the current user. }
#IFDEF UNICODE
#DEFINE AW "W"
#ELSE
#DEFINE AW "A"
#ENDIF
{ Visual C++ 2019 v14, the included installer is a bundle consisting of older vers }
VC_2019_REDIST_X86_MIN = '{2E72FA1F-BADB-4337-B8AE-F7C17EC57D1D}';
function MsiQueryProductState(szProduct: string): INSTALLSTATE;
external 'MsiQueryProductState{#AW}@msi.dll stdcall';
function VCVersionInstalled(const ProductID: string): Boolean;
begin
Result := MsiQueryProductState(ProductID) = INSTALLSTATE_DEFAULT;
end;
function VCRedistNeedsInstall: Boolean;
begin
Result := not VCVersionInstalled(VC_2019_REDIST_X86_MIN);
end;
// event fired when the uninstall step is changed: https://stackoverflow.com/revisions/12645836/1
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
Expand Down
48 changes: 31 additions & 17 deletions src/livelywpf/livelySubProcess/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,26 @@ class Program
public static extern Int32 SystemParametersInfo(UInt32 uiAction, UInt32 uiParam, String pvParam, UInt32 fWinIni);
public static UInt32 SPI_SETDESKWALLPAPER = 20;
public static UInt32 SPIF_UPDATEINIFILE = 0x1;
/// <summary>
/// portable lively build, no installer.
/// </summary>
public static readonly bool isPortableBuild = false;
public static string PathData { get; private set; }

static void Main(string[] args)
{

if (isPortableBuild)
{
PathData = AppDomain.CurrentDomain.BaseDirectory;
}
else
{
PathData = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Lively Wallpaper");
}

int livelyId;
Process lively;

if (args.Length == 0)
{
Console.WriteLine("NO arguments sent.");
Expand Down Expand Up @@ -76,7 +89,7 @@ static void Main(string[] args)

lively.WaitForExit();

Console.WriteLine("done waiting, ready to kill *_*");
Console.WriteLine("done waiting, ready to kill..");
//Console.Read();

FileHandle.LoadRunningPrograms();
Expand All @@ -86,8 +99,9 @@ static void Main(string[] args)
Console.WriteLine("pgm list:- " + proc.ProcessName + " " + proc.MainWindowHandle);
foreach (var wproc in FileHandle.runningPrograms)
{
//Pid + Process-name is unique enough to make sure its the correct pgm.
if (proc.ProcessName.Equals(wproc.ProcessName, StringComparison.OrdinalIgnoreCase) && proc.Id == wproc.Pid)//&& IntPtr.Equals(proc.MainWindowHandle,wproc.handle))//proc.Handle == wproc.handle)
{
{
Console.WriteLine("Unclosed pgm, kill:- " + proc.ProcessName);
try
{
Expand Down Expand Up @@ -122,7 +136,7 @@ public RunningProgram()
}

public static List<RunningProgram> runningPrograms = new List<RunningProgram>();
private static string pathData = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "LivelyWallpaper");
//private static string pathData = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Lively Wallpaper");

public class RunningProgramsList
{
Expand All @@ -131,26 +145,19 @@ public class RunningProgramsList

public static void LoadRunningPrograms()
{
if (!File.Exists(Path.Combine(pathData,"lively_running_pgms.json")))
{
return;
}

try
{

// deserialize JSON directly from a file
using (StreamReader file = File.OpenText( Path.Combine(pathData, "lively_running_pgms.json")))
using (StreamReader file = File.OpenText( Path.Combine(Program.PathData, "lively_running_pgms.json")))
{
JsonSerializer serializer = new JsonSerializer();
RunningProgramsList tmp = (RunningProgramsList)serializer.Deserialize(file, typeof(RunningProgramsList));
runningPrograms = tmp.Item;
}

}
catch (Exception e)
catch
{
System.Diagnostics.Debug.WriteLine(e.Message + " " + e.StackTrace);
Debug.WriteLine("failed to read json");
}
}

Expand All @@ -170,10 +177,17 @@ public static void SaveRunningPrograms()
NullValueHandling = NullValueHandling.Include
};

using (StreamWriter sw = new StreamWriter( Path.Combine(pathData, "\\lively_running_pgms.json")))
using (JsonWriter writer = new JsonTextWriter(sw))
try
{
using (StreamWriter sw = new StreamWriter(Path.Combine(Program.PathData, "lively_running_pgms.json")))
using (JsonWriter writer = new JsonTextWriter(sw))
{
serializer.Serialize(writer, tmp);
}
}
catch
{
serializer.Serialize(writer, tmp);
Debug.WriteLine("failed to write json");
}
}

Expand Down
Loading

0 comments on commit c532d20

Please sign in to comment.