Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create uninstaller #37

Merged
merged 1 commit into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mkdir data || goto err
windres resource.rc -O coff -o resource.res || goto err
gcc -mwindows main.c wallpaper.c parser.c debug.c window.c resource.res -lmingw32 -lSDL2main -lSDL2 -o data\lwp.exe || goto err
xcopy wallpapers data\wallpapers\ /E /Y || goto err
copy uninstall.bat data || goto err
copy defaultWin.cfg data || goto err
copy LICENSE data\LICENSE.txt || goto err
echo.
Expand Down
8 changes: 8 additions & 0 deletions install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ echo Copying files...
robocopy "%~dp0\data" "%path%\lwp" /E /NFL /NDL /NJH /NJS /nc /ns /np
echo Adding lwp to autorun...
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" /v "lwp" /t REG_EXPAND_SZ /d "%path%\lwp\lwp.exe" /f > nul
echo Creating uninstaller...
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\layeredWallPaper" /f > nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\layeredWallPaper" /v "UninstallString" /t REG_SZ /d "cmd /c \"%path%\lwp\uninstall.bat\"" /f > nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\layeredWallPaper" /v "DisplayName" /t REG_SZ /d "Layered WallPaper" /f > nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\layeredWallPaper" /v "DisplayIcon" /t REG_SZ /d "%path%\lwp\lwp.exe" /f > nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\layeredWallPaper" /v "Publisher" /t REG_SZ /d "Jakub Szczerbinski" /f > nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\layeredWallPaper" /v "URLInfoAbout" /t REG_SZ /d "https://github.com/jszczerbinsky/lwp" /f > nul

echo.
echo Lwp has been successfuly installed on Your computer!
start "" "%path%\lwp\lwp.exe"
Expand Down
26 changes: 26 additions & 0 deletions uninstall.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@echo off
title Uninstall Layered WallPaper

echo Are You sure, You want to remove Layered WallPaper from Your computer?
set /p val="(y/n) > "
if not %val%==y (
exit
)

echo Killing all running instances...
taskkill /F /IM lwp.exe
echo.

echo Restarting explorer...
taskkill /im explorer.exe /f
start explorer.exe
echo.

echo Removing Layered WallPaper's registry keys..
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\layeredWallPaper" /f > nul
reg delete "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" /v "lwp" /f > nul
echo.

echo Removing Layered WallPaper's files...
rmdir /S /Q "%~dp0"
exit