Skip to content

Commit c532d20

Browse files
authoredFeb 19, 2020
Merge pull request #19 from rocksdanister/dev-build
Dev build v0.8.5
2 parents 40f20a4 + 2baa650 commit c532d20

27 files changed

+617
-388
lines changed
 

‎README.md

+17-10
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Lively is still in development, if you encounter bugs create a github Issue alon
2828

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

31-
<a href="https://github.com/rocksdanister/lively/wiki">Documentation</a>
31+
<a href="https://github.com/rocksdanister/lively/wiki">Full Documentation</a>
3232
## Features
3333
*Wait a sec, preview gif clips take some time to load.*
3434
#### Video
@@ -97,26 +97,33 @@ Help translate lively to other languages: <a href="https://github.com/rocksdanis
9797

9898
**_I'm not officially affiliated with Unity technologies, godot, shadertoy;_**
9999
## Download
100-
##### Latest version: v0.8.0.0 (Windows 10, 8.1)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v0.8.0.0)
101-
- [`Download`][direct-full-win32]
102-
_90MB, Web wallpaper support & some sample wallpapers included._
100+
##### Latest version: v0.8.5.0 (Windows 10, 8.1)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v0.8.5.0)
101+
- [`Download Lively Installer`][direct-full-win32]
102+
_102MB, Web wallpaper support & some sample wallpapers included._
103+
- [`Download Lively Portable`][direct-full-portable-win32]
104+
_111MB, (No Installation) Web wallpaper support & some sample wallpapers included._
105+
106+
**Portable build: Latest Visual C++ Redistributable is required: [vc_redist.x86.exe](https://aka.ms/vs/16/release/vc_redist.x86.exe)**
103107

104-
**Latest Visual C++ Redistributable is required: [vc_redist.x86.exe](https://aka.ms/vs/16/release/vc_redist.x86.exe)**
105-
106-
[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v0.8.0.0/lively_setup_x86_full_v0800.exe
108+
[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v0.8.0.0/lively_setup_x86_full_v0850.exe
109+
110+
[direct-full-portable-win32]: https://github.com/rocksdanister/lively/releases/download/v0.8.5.0/lively_portable_x86_full_v0850.zip
107111

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

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

117+
[Having trouble? ](https://github.com/rocksdanister/lively/wiki/Common-Problems)
113118
## Issues
114-
[TODO List](https://trello.com/b/rdFFxuMF/lively-wallpaper-system)
119+
~~[TODO List](https://trello.com/b/rdFFxuMF/lively-wallpaper-system)~~
120+
121+
See github [issues.](https://github.com/rocksdanister/lively/issues)
115122

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

119-
Currently Lively is only human translated English & Spanish, other languages are machine translated.
126+
Currently Lively is only human translated in English, Spanish & Italian; other languages are machine translated.
120127

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

‎src/lively setup/Inno.iss

+41-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

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

9696
[Files]
97+
Source: "VC\VC_redist.x86.exe"; DestDir: {tmp}; Flags: deleteafterinstall
98+
9799
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
98100
Source: "Release\livelywpf.exe"; DestDir: "{app}"; Flags: ignoreversion;Components: program
99101
Source: "Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: program
100102
Source: "Lively Wallpaper\external\cef\*"; DestDir: "{userdocs}\Lively Wallpaper\external\cef"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: cef
101103
Source: "Lively Wallpaper\wallpapers\*"; DestDir: "{userdocs}\Lively Wallpaper\wallpapers"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall; Components: wallpapers; Check: ShouldInstallWallpapers
102-
; pushing new set of wp's with customisation to existing users, shouldInstallWallpaper check will be added from later version onwards..
103-
Source: "Lively Wallpaper\wallpapers new\*"; DestDir: "{userdocs}\Lively Wallpaper\wallpapers"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall; Components: wallpapers;
104+
; pushing new set of wp's with customisation to existing users (v0.8 only), shouldInstallWallpaper check will be added from later version onwards..
105+
Source: "Lively Wallpaper\wallpapers new\*"; DestDir: "{userdocs}\Lively Wallpaper\wallpapers"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall; Components: wallpapers; Check: ShouldInstallWallpapers
104106

105107
[Icons]
106108
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
@@ -109,11 +111,47 @@ Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: de
109111
[Run]
110112
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall
111113
;skipifsilent
114+
Filename: "{tmp}\VC_redist.x86.exe"; Check: VCRedistNeedsInstall; StatusMsg: Installing Visual Studio Runtime Libraries...
112115

113116
[Code]
114117
var
115118
isAlreadyInstalled: Boolean;
116119
120+
// Visual C++ redistributive component install.
121+
//ref: https://bell0bytes.eu/inno-setup-vc/
122+
type
123+
INSTALLSTATE = Longint;
124+
125+
const
126+
INSTALLSTATE_INVALIDARG = -2; { An invalid parameter was passed to the function. }
127+
INSTALLSTATE_UNKNOWN = -1; { The product is neither advertised or installed. }
128+
INSTALLSTATE_ADVERTISED = 1; { The product is advertised but not installed. }
129+
INSTALLSTATE_ABSENT = 2; { The product is installed for a different user. }
130+
INSTALLSTATE_DEFAULT = 5; { The product is installed for the current user. }
131+
132+
#IFDEF UNICODE
133+
#DEFINE AW "W"
134+
#ELSE
135+
#DEFINE AW "A"
136+
#ENDIF
137+
138+
{ Visual C++ 2019 v14, the included installer is a bundle consisting of older vers }
139+
VC_2019_REDIST_X86_MIN = '{2E72FA1F-BADB-4337-B8AE-F7C17EC57D1D}';
140+
141+
function MsiQueryProductState(szProduct: string): INSTALLSTATE;
142+
external 'MsiQueryProductState{#AW}@msi.dll stdcall';
143+
144+
function VCVersionInstalled(const ProductID: string): Boolean;
145+
begin
146+
Result := MsiQueryProductState(ProductID) = INSTALLSTATE_DEFAULT;
147+
end;
148+
149+
function VCRedistNeedsInstall: Boolean;
150+
begin
151+
Result := not VCVersionInstalled(VC_2019_REDIST_X86_MIN);
152+
end;
153+
154+
117155
// event fired when the uninstall step is changed: https://stackoverflow.com/revisions/12645836/1
118156
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
119157
begin

‎src/livelywpf/livelySubProcess/Program.cs

+31-17
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,26 @@ class Program
2222
public static extern Int32 SystemParametersInfo(UInt32 uiAction, UInt32 uiParam, String pvParam, UInt32 fWinIni);
2323
public static UInt32 SPI_SETDESKWALLPAPER = 20;
2424
public static UInt32 SPIF_UPDATEINIFILE = 0x1;
25+
/// <summary>
26+
/// portable lively build, no installer.
27+
/// </summary>
28+
public static readonly bool isPortableBuild = false;
29+
public static string PathData { get; private set; }
2530

2631
static void Main(string[] args)
2732
{
2833

34+
if (isPortableBuild)
35+
{
36+
PathData = AppDomain.CurrentDomain.BaseDirectory;
37+
}
38+
else
39+
{
40+
PathData = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Lively Wallpaper");
41+
}
42+
2943
int livelyId;
3044
Process lively;
31-
3245
if (args.Length == 0)
3346
{
3447
Console.WriteLine("NO arguments sent.");
@@ -76,7 +89,7 @@ static void Main(string[] args)
7689

7790
lively.WaitForExit();
7891

79-
Console.WriteLine("done waiting, ready to kill *_*");
92+
Console.WriteLine("done waiting, ready to kill..");
8093
//Console.Read();
8194

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

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

127141
public class RunningProgramsList
128142
{
@@ -131,26 +145,19 @@ public class RunningProgramsList
131145

132146
public static void LoadRunningPrograms()
133147
{
134-
if (!File.Exists(Path.Combine(pathData,"lively_running_pgms.json")))
135-
{
136-
return;
137-
}
138-
139148
try
140149
{
141-
142150
// deserialize JSON directly from a file
143-
using (StreamReader file = File.OpenText( Path.Combine(pathData, "lively_running_pgms.json")))
151+
using (StreamReader file = File.OpenText( Path.Combine(Program.PathData, "lively_running_pgms.json")))
144152
{
145153
JsonSerializer serializer = new JsonSerializer();
146154
RunningProgramsList tmp = (RunningProgramsList)serializer.Deserialize(file, typeof(RunningProgramsList));
147155
runningPrograms = tmp.Item;
148156
}
149-
150157
}
151-
catch (Exception e)
158+
catch
152159
{
153-
System.Diagnostics.Debug.WriteLine(e.Message + " " + e.StackTrace);
160+
Debug.WriteLine("failed to read json");
154161
}
155162
}
156163

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

173-
using (StreamWriter sw = new StreamWriter( Path.Combine(pathData, "\\lively_running_pgms.json")))
174-
using (JsonWriter writer = new JsonTextWriter(sw))
180+
try
181+
{
182+
using (StreamWriter sw = new StreamWriter(Path.Combine(Program.PathData, "lively_running_pgms.json")))
183+
using (JsonWriter writer = new JsonTextWriter(sw))
184+
{
185+
serializer.Serialize(writer, tmp);
186+
}
187+
}
188+
catch
175189
{
176-
serializer.Serialize(writer, tmp);
190+
Debug.WriteLine("failed to write json");
177191
}
178192
}
179193

0 commit comments

Comments
 (0)
Please sign in to comment.