diff --git a/README.md b/README.md index 686983c..c68aca3 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ -# AutoBloom v1.0 +# AutoBloom -Make Windows 11 Bloom Wallpaper get animated when signing in. - -https://user-images.githubusercontent.com/20214420/136711426-270f258c-090a-4189-a4fb-3e5863ec1586.mp4 +Make Windows 11 Bloom Wallpaper get animated when signing in (light mode only). +https://user-images.githubusercontent.com/59333567/230786657-43061ac4-04f2-4b04-9472-18fbdeee424d.mp4 ## Installation @@ -15,10 +14,10 @@ Note that this software uses scheduled tasks to run during startup. If you move To uninstall just run `uninstall.bat`. -If you encounter "some virus detected" in the release, delete two `.exe` files inside `src` folder and open `compile.bat` in the same folder. It will regenerate new exe files so (hopefully) your antivirus won't complain anymore. +The program should not be detected as a virus anymore, as it does no longer contain compiled VB code. Check [this Virustotal scan](https://www.virustotal.com/gui/file/c4d0e098ca71db2645097d6535b41835e1ed09184bd608d4a326f42f6e3de775?nocache=1) from the [latest update](/willnode/autobloom/pull/16). ## Credits Uses [MPV](https://mpv.io). -All media contents are belongs to Microsoft. +All media contents belong to Microsoft. diff --git a/install.bat b/install.bat index 94a3801..820e204 100644 --- a/install.bat +++ b/install.bat @@ -1,8 +1,10 @@ @echo off if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) -SCHTASKS /CREATE /SC ONLOGON /TN "AUTOBLOOM" /TR "%~dp0src\RunSilent.exe" -SCHTASKS /CREATE /SC ONSTART /TN "AUTOBLOOM PREP" /TR "%~dp0src\off.bat" +SCHTASKS /CREATE /SC ONLOGON /TN "AUTOBLOOM" /TR "wscript '%~dp0src\silent.vbs' 'conhost cmd /c '%~dp0src\run.bat' ch'" +SCHTASKS /CREATE /SC ONSTART /TN "AUTOBLOOM PREP" /TR "wscript '%~dp0src\silent.vbs' 'conhost cmd /c '%~dp0src\prep.bat' '" /RU "SYSTEM" +powershell -Command "Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned" cls echo AutoBloom has been installed! + timeout 3 >nul diff --git a/mpv/README.txt b/mpv/README.md similarity index 50% rename from mpv/README.txt rename to mpv/README.md index 7e02c65..d2cb8ce 100644 --- a/mpv/README.txt +++ b/mpv/README.md @@ -2,8 +2,8 @@ Version: mpv-x86_64-20181002 Source: https://github.com/mpv-player/mpv Files: - - mpv.exe - - mpv.com - - libbdplus.dll - - libaacs.dll - - mpv.conf +- mpv.exe +- mpv.com +- libbdplus.dll +- libaacs.dll +- ~mpv.conf~ diff --git a/mpv/mpv.conf b/mpv/mpv.conf deleted file mode 100644 index 5102c20..0000000 --- a/mpv/mpv.conf +++ /dev/null @@ -1,12 +0,0 @@ -deband=yes -hwdec=auto -border=no -cache=yes -demuxer-max-bytes=488281KiB -demuxer-readahead-secs=120 -autofit=100% -player-operation-mode=pseudo-gui -input-ipc-server=\\.\pipe\mpvsocket -force-window=yes -# Only recommended volume for showcase non for daily use -volume=0 diff --git a/src/ChangeWallpaper.vb b/src/ChangeWallpaper.vb deleted file mode 100644 index a53799e..0000000 --- a/src/ChangeWallpaper.vb +++ /dev/null @@ -1,20 +0,0 @@ -Imports System.Runtime.InteropServices - -Public Module ChangeWallpaper - Public Declare Unicode Function SystemParametersInfoW Lib "user32" (ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer - Public Const SPI_SETDESKWALLPAPER = 20 - Public Const SPIF_SENDWININICHANGE = &H2 - Public Const SPIF_UPDATEINIFILE = &H1 - -Public Sub Main() - Dim Ret as Integer - Dim FName As String - 'Fname = "C:\Windows\Web\Wallpaper\Theme1\img1.jpg" - 'This below line which is commented out takes a filename on the command line - FName = Replace(Command(), """", "") - - Ret = SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, FName, SPIF_SENDWININICHANGE + SPIF_UPDATEINIFILE) - If Ret = 0 Then Msgbox(err.lastdllerror) -End Sub - -End Module \ No newline at end of file diff --git a/src/RunSilent.vb b/src/RunSilent.vb deleted file mode 100644 index e6261b6..0000000 --- a/src/RunSilent.vb +++ /dev/null @@ -1,11 +0,0 @@ -Imports System.Diagnostics - -Public Module ChangeWallpaper - Public Sub Main() - Dim myProcess As New Process - myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden - myProcess.StartInfo.CreateNoWindow = True - myProcess.StartInfo.FileName = (System.AppDomain.CurrentDomain.BaseDirectory() + "run.bat") - myProcess.Start() - End Sub -End Module diff --git a/src/compile.bat b/src/compile.bat deleted file mode 100644 index 7a9982d..0000000 --- a/src/compile.bat +++ /dev/null @@ -1,2 +0,0 @@ -C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc "%~dp0\ChangeWallpaper.vb" /out:"%~dp0\ChangeWallpaper.exe" /target:winexe -C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc "%~dp0\RunSilent.vb" /out:"%~dp0\RunSilent.exe" /target:winexe \ No newline at end of file diff --git a/src/off.bat b/src/off.bat deleted file mode 100644 index d7f28ed..0000000 --- a/src/off.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -set home=%~dp0 -%home%ChangeWallpaper.exe %home%../media/first.bmp diff --git a/src/prep.bat b/src/prep.bat new file mode 100644 index 0000000..6c99101 --- /dev/null +++ b/src/prep.bat @@ -0,0 +1,4 @@ +@echo off +set "_home=%~dp0" +cd /D "%_home%" +powershell -NoP .\wallpaper.ps1 "%_home%..\media\first.bmp" diff --git a/src/run.bat b/src/run.bat index ba40eb3..64f799b 100644 --- a/src/run.bat +++ b/src/run.bat @@ -1,10 +1,14 @@ @echo off -set home=%~dp0 -cd /D "%~dp0" -cd ..\mpv -%home%ChangeWallpaper.exe %home%..\media\first.bmp +if not [%1]==[ch] (start conhost cmd /c "" "%~dpnx0" ch & exit) +powershell -NoP -W hidden ; exit +set "_home=%~dp0" +cd /D "%_home%" + +powershell -NoP .\wallpaper.ps1 "%_home%..\media\first.bmp" + timeout 1 -start /B mpv %home%..\media\bloom.mp4 --no-osc --no-input-default-bindings --no-taskbar-progress +start /B ..\mpv\mpv ..\media\bloom.mp4 --no-osc --no-input-default-bindings --no-taskbar-progress --no-window-dragging ^ + --deband --hwdec=auto --no-border --cache=yes --demuxer-max-bytes=488281KiB --demuxer-readahead-secs=120 --autofit=100%% --player-operation-mode=pseudo-gui --input-ipc-server=\\.\pipe\mpvsocket --force-window=yes --volume=0 cd ..\src -timeout 5 -%home%ChangeWallpaper.exe %home%..\media\last.bmp +timeout 2 +powershell -NoP .\wallpaper.ps1 "%_home%..\media\last.bmp" diff --git a/src/silent.vbs b/src/silent.vbs new file mode 100644 index 0000000..3607cad --- /dev/null +++ b/src/silent.vbs @@ -0,0 +1,2 @@ +Set objShell = WScript.CreateObject("WScript.Shell") +call objShell.Run(WScript.Arguments(0), 0, false) \ No newline at end of file diff --git a/src/wallpaper.ps1 b/src/wallpaper.ps1 new file mode 100644 index 0000000..330d04f --- /dev/null +++ b/src/wallpaper.ps1 @@ -0,0 +1,20 @@ +$imgPath = $args[0] +$code = @' +using System.Runtime.InteropServices; +namespace Win32{ + + public class Wallpaper{ + [DllImport("user32.dll", CharSet=CharSet.Auto)] + static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni) ; + + public static void SetWallpaper(string thePath){ + SystemParametersInfo(20,0,thePath,3); + } + } + } +'@ + +add-type $code + +#Apply the Change on the system +[Win32.Wallpaper]::SetWallpaper($imgPath) \ No newline at end of file diff --git a/uninstall.bat b/uninstall.bat index 23c8a80..7463003 100644 --- a/uninstall.bat +++ b/uninstall.bat @@ -1,5 +1,6 @@ @echo off if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) +dism || exit SCHTASKS /DELETE /TN "AUTOBLOOM" /f SCHTASKS /DELETE /TN "AUTOBLOOM PREP" /f cls