Skip to content

Commit

Permalink
Few changes on headers and Images
Browse files Browse the repository at this point in the history
  • Loading branch information
repiazza committed Mar 22, 2024
1 parent 605cb09 commit acc608b
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 42 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#
#


UNAME_S := $(shell uname -s)

ifneq ($(findstring _NT-, $(UNAME_S)),)
Expand Down
16 changes: 8 additions & 8 deletions cattie.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
################
# cattie.conf
#
#TODO:
# Written by <bacagino> numa data
#
# Configure file of cattie
#

##########################
# #
# DEBUG CONFIGURATIONS #
# #
##########################
# Configure file for cattie
#
##########

# The name of the log file
TRACE_FILE = cattie.log
Expand Down
Binary file added img/confirm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 8 additions & 6 deletions include/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions scripts/install_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
54 changes: 30 additions & 24 deletions scripts/install_win32.bat
Original file line number Diff line number Diff line change
@@ -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 <gustavo.bacagine@protonmail.com>
REM Written by Gustavo Bacagine <gustavo.bacagine@protonmail.com> in October 2023
REM Maintained by Renato Fermi <repiazza@gmail.com> 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=..\"
Expand All @@ -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!
10 changes: 7 additions & 3 deletions scripts/uninstall_linux.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#!/bin/bash
#
# uninstall_linux.sh: Script to uninstall cattie
# ===========================================================
#
# uninstall_linux.sh
#
# Written by Gustavo Bacagine <gustavo.bacagine@protonmail.com>
#
# Date: 21/10/2023
# Script to uninstall cattie
#
# ===========================================================

# Checking if user is root
if [[ $EUID -ne 0 ]]; then
Expand All @@ -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
Expand Down
46 changes: 46 additions & 0 deletions scripts/uninstall_win32.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@echo off
REM ===========================================================
REM uninstall_windows.bat
REM
REM Written by Renato Fermi <repiazza@gmail.com> 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
2 changes: 1 addition & 1 deletion src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit acc608b

Please sign in to comment.