diff --git a/Makefile b/Makefile index 8504623..b2e4c64 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ # # + UNAME_S := $(shell uname -s) ifneq ($(findstring _NT-, $(UNAME_S)),) diff --git a/cattie.conf b/cattie.conf index 3fa8996..7262dc9 100644 --- a/cattie.conf +++ b/cattie.conf @@ -1,12 +1,12 @@ +################ +# cattie.conf +# +#TODO: +# Written by numa data # -# Configure file of cattie -# - -########################## -# # -# DEBUG CONFIGURATIONS # -# # -########################## +# Configure file for cattie +# +########## # The name of the log file TRACE_FILE = cattie.log diff --git a/img/confirm.png b/img/confirm.png new file mode 100644 index 0000000..d502783 Binary files /dev/null and b/img/confirm.png differ diff --git a/include/image.h b/include/image.h index a5c4327..2d4b728 100644 --- a/include/image.h +++ b/include/image.h @@ -13,15 +13,17 @@ "/usr/share/cattie/img/forward.png", "/usr/share/cattie/img/laser.png", "/usr/share/cattie/img/rotate2.png", - "/usr/share/cattie/img/gear.png" + "/usr/share/cattie/img/gear.png", + "/usr/share/cattie/img/confirm.png" }; #else char *ppszInstalledImagePath[] = { - "C:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\cat2.png", - "C:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\forward.png", - "C:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\laser.png", - "C:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\rotate2.png", - "C:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\gear.png" + "D:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\cat2.png", + "D:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\forward.png", + "D:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\laser.png", + "D:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\rotate2.png", + "D:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\gear.png" + "D:\\Renato\\Documents\\CSDL2\\Cattie_GXRF\\img\\confirm.png" }; #endif diff --git a/scripts/install_linux.sh b/scripts/install_linux.sh index d5816c5..ab25011 100644 --- a/scripts/install_linux.sh +++ b/scripts/install_linux.sh @@ -50,6 +50,8 @@ cp -rv ./img/cat2.png /usr/share/cattie/img cp -rv ./img/forward.png /usr/share/cattie/img cp -rv ./img/laser.png /usr/share/cattie/img cp -rv ./img/rotate2.png /usr/share/cattie/img +cp -rv ./img/gear.png /usr/share/cattie/img +cp -rv ./img/confirm.png /usr/share/cattie/img # Installing the documentation cp -rvf ./man/cattie.1 /usr/share/man/man1 diff --git a/scripts/install_win32.bat b/scripts/install_win32.bat index bd12855..5b4f1b9 100644 --- a/scripts/install_win32.bat +++ b/scripts/install_win32.bat @@ -1,12 +1,17 @@ @echo off -REM install_windows.bat: Batch script to install cattie +REM =========================================================== +REM install_windows.bat REM -REM Written by Gustavo Bacagine +REM Written by Gustavo Bacagine in October 2023 +REM Maintained by Renato Fermi since March 2024 REM -REM Date: 21/10/2023 +REM Batch installation script to Cattie +REM +REM ============================================================ + +REM Use PowerShell to get the My Documents folder path +for /f "usebackq tokens=*" %%a in (`powershell -Command "[Environment]::GetFolderPath('MyDocuments')"`) do set "baseDir=%%a\cattie" -REM Set the base directory path -set "baseDir=C:\Arquivos de Programas\cattie" set "imgDir=%baseDir%\img" set "docDir=%baseDir%\doc" set "baseInstallPath=..\" @@ -20,43 +25,44 @@ if %errorLevel% NEQ 0 ( echo. echo ##################### -echo # Installing cattie # +echo # Installing Cattie # echo ##################### REM Creating the app directory -mkdir "%baseDir%" +mkdir "%baseDir%" >nul 2>&1 REM Creating the img directory of cattie -mkdir "%imgDir%" +mkdir "%imgDir%" >nul 2>&1 REM Creating the documentation directory -mkdir "%docDir%" +mkdir "%docDir%" >nul 2>&1 REM Install the binary of the software and your autocomplete script -copy "%baseInstallPath%cattie.exe" "%baseDir%" +copy "%baseInstallPath%cattie.exe" "%baseDir%" >nul 2>&1 REM Installing the configuration file of the software -@REM REM copy "cattie.conf" "%baseDir%" +@REM copy "cattie.conf" "%baseDir%" >nul 2>&1 REM Create shortcut -@REM copy "cattie.lnk" "%APPDATA%\Microsoft\Windows\Start Menu\Programs" set "shortcutTarget=%baseDir%\cattie.exe" set "shortcutName=%APPDATA%\Microsoft\Windows\Start Menu\Programs\cattie.lnk" -powershell -Command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut('%shortcutName%'); $s.TargetPath = '%shortcutTarget%'; $s.Save()" +powershell -Command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut('%shortcutName%'); $s.TargetPath = '%shortcutTarget%'; $s.Save()" >nul 2>&1 REM Copy the images -copy "%baseInstallPath%img\cat2.png" "%imgDir%" -copy "%baseInstallPath%img\forward.png" "%imgDir%" -copy "%baseInstallPath%img\laser.png" "%imgDir%" -copy "%baseInstallPath%img\rotate2.png" "%imgDir%" +copy "%baseInstallPath%img\cat2.png" "%imgDir%" >nul 2>&1 +copy "%baseInstallPath%img\forward.png" "%imgDir%" >nul 2>&1 +copy "%baseInstallPath%img\laser.png" "%imgDir%" >nul 2>&1 +copy "%baseInstallPath%img\rotate2.png" "%imgDir%" >nul 2>&1 +copy "%baseInstallPath%img\gear.png" "%imgDir%" >nul 2>&1 +copy "%baseInstallPath%img\confirm.png" "%imgDir%" >nul 2>&1 -icacls "%baseDir%" /grant:r "%USERNAME%:(OI)(CI)F" +icacls "%baseDir%" /grant:r "%USERNAME%:(OI)(CI)F" >nul 2>&1 REM Installing the documentation -@REM copy "man\cattie.1" "%docDir%" -@REM copy "LICENSE.gz" "%docDir%" -@REM copy "AUTHORS.gz" "%docDir%" -@REM copy "NEWS.gz" "%docDir%" -@REM copy "README.gz" "%docDir%" +@REM copy "man\cattie.1" "%docDir%" >nul 2>&1 +@REM copy "LICENSE.gz" "%docDir%" >nul 2>&1 +@REM copy "AUTHORS.gz" "%docDir%" >nul 2>&1 +@REM copy "NEWS.gz" "%docDir%" >nul 2>&1 +@REM copy "README.gz" "%docDir%" >nul 2>&1 -echo cattie was installed successfully! +echo Cattie was installed successfully! diff --git a/scripts/uninstall_linux.sh b/scripts/uninstall_linux.sh index 40baef6..8fd4767 100644 --- a/scripts/uninstall_linux.sh +++ b/scripts/uninstall_linux.sh @@ -1,10 +1,14 @@ #!/bin/bash # -# uninstall_linux.sh: Script to uninstall cattie +# =========================================================== +# +# uninstall_linux.sh # # Written by Gustavo Bacagine # -# Date: 21/10/2023 +# Script to uninstall cattie +# +# =========================================================== # Checking if user is root if [[ $EUID -ne 0 ]]; then @@ -13,7 +17,7 @@ if [[ $EUID -ne 0 ]]; then printf "\033[1;31mE:\033[m This script must be run as root\n" fi - print "E: This script must be run as root\n" + print "ERR: This script must be run as root\n" exit 1 fi diff --git a/scripts/uninstall_win32.bat b/scripts/uninstall_win32.bat new file mode 100644 index 0000000..1fed31b --- /dev/null +++ b/scripts/uninstall_win32.bat @@ -0,0 +1,46 @@ +@echo off +REM =========================================================== +REM uninstall_windows.bat +REM +REM Written by Renato Fermi in March 2024 +REM +REM Script to uninstall Cattie +REM +REM =========================================================== + +REM Use PowerShell to get the My Documents folder path +for /f "usebackq tokens=*" %%a in (`powershell -Command "[Environment]::GetFolderPath('MyDocuments')"`) do set "baseDir=%%a\cattie" + +set "shortcutName=%APPDATA%\Microsoft\Windows\Start Menu\Programs\cattie.lnk" + +REM Checking if user is running as administrator +NET SESSION >nul 2>&1 +if %errorLevel% NEQ 0 ( + echo This script must be run as Administrator + exit /b 1 +) + +echo. +echo ####################### +echo # Uninstalling cattie # +echo ####################### + +REM Remove the app directory and all its contents +if exist "%baseDir%" ( + rmdir /s /q "%baseDir%" + echo Removed cattie directory from My Documents. +) else ( + echo Cattie directory not found. +) + +REM Remove the shortcut +if exist "%shortcutName%" ( + del /f /q "%shortcutName%" + echo Removed cattie shortcut. +) else ( + echo Cattie shortcut not found. +) + +echo. +echo Cattie was uninstalled successfully! +pause diff --git a/src/util.c b/src/util.c index 994edbc..f8c8a50 100644 --- a/src/util.c +++ b/src/util.c @@ -139,7 +139,7 @@ int iParseCfgLine(char *pszLineContents) case DEBUG_LEVEL : pDestVar = gstCmdLine.szDebugLevel; break; case WINDOW_RESOLUTION: case WINDOW_HEIGHT : - case WINDOW_WIDTH : break; + case WINDOW_WIDTH : break; default : return 0; }