Skip to content

Commit

Permalink
Prepare install/uninstall scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter authored and Peter committed Jun 25, 2019
1 parent a2e6c3f commit daffb38
Show file tree
Hide file tree
Showing 6 changed files with 332 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ OpenOffice Extension, die ein "Vorlagen laden"-Makro enth
Absatz-, Zeichen- und Seitenvorlagen laden, ohne die Dokumentvorlage mit dem Dokument zu verbinden.

## CREDITS
Icons made by [Freepik](https://www.freepik.com) from [Flaticon](https://www.flaticon.com) is licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/).
Icons made by [Freepik](https://www.freepik.com) from [Flaticon](https://www.flaticon.com) are licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/).

Binary file modified oxt/OOLoadStyles.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion oxt/icons/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
## CREDITS
Icons made by [Freepik](https://www.freepik.com) from [Flaticon](https://www.flaticon.com) is licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/).
Icons made by [Freepik](https://www.freepik.com) from [Flaticon](https://www.flaticon.com) are licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/).
112 changes: 112 additions & 0 deletions tools/Install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
@echo off
REM
REM summary: Installation script for the OOLoadStyles software package.
REM
REM author: Peter Triesberger
REM see: https://github.com/peter88213/OOLoadStyles
REM license: The MIT License (https://opensource.org/licenses/mit-license.php)
REM copyright: (c) 2019, Peter Triesberger
REM
REM note: This script is to be executed manually.
REM
REM precondition: OOLoadStyles is installed.
REM precondition: OpenOffice.org 3.x or Apache OpenOffice 4.x is installed.
REM postcondition: Previously auto-installed items of OOLoadStyles are removed.
REM postcondition: The templates remain, if user wants so.
REM
REM since: 2019-06-25

set _release=0.4.3

set _OpenOffice4_w64=c:\Program Files (x86)\OpenOffice 4
set _OpenOffice4_w32=c:\Program Files\OpenOffice 4
set _OpenOffice3_w64=c:\Program Files (x86)\OpenOffice.org 3
set _OpenOffice3_w32=c:\Program Files\OpenOffice.org 3
set _LibreOffice6_w64=c:\Program Files (x86)\LibreOffice 6
set _LibreOffice6_w32=c:\Program Files\LibreOffice 6

set _OpenOffice4_Userprofile=AppData\Roaming\OpenOffice\4\user
set _OpenOffice3_Userprofile=AppData\Roaming\OpenOffice.org\3\user
set _LibreOffice6_Userprofile=AppData\Roaming\LibreOffice\4\user

echo -----------------------------------------------------------------
echo OOLoadStyles (OpenOffice style loader) v%_release%
echo Installing software package ...
echo -----------------------------------------------------------------
rem Detect Combination of Windows and Office
if exist "%_OpenOffice4_w64%\program\swriter.exe" goto OpenOffice4-Win64
if exist "%_OpenOffice4_w32%\program\swriter.exe" goto OpenOffice4-Win32
if exist "%_OpenOffice3_w64%\program\swriter.exe" goto OpenOffice3-Win64
if exist "%_OpenOffice3_w32%\program\swriter.exe" goto OpenOffice3-Win32
rem if exist "%_LibreOffice6_w64%\program\swriter.exe" goto LibreOffice6-Win64
rem if exist "%_LibreOffice6_w32%\program\swriter.exe" goto LibreOffice6-Win32
echo ERROR: No supported version of OpenOffice/LibreOffice found!
echo Installation aborted.
goto end

:OpenOffice4-Win64
set _writer=%_OpenOffice4_w64%
set _user=%USERPROFILE%\%_OpenOffice4_Userprofile%
set _ext=OOLoadStyles-A-%_release%.oxt
echo OpenOffice 4.x - Windows (64 bit)
goto settings_done

:OpenOffice4-Win32
set _writer=%_OpenOffice4_w32%
set _user=%USERPROFILE%\%_OpenOffice4_Userprofile%
set _ext=OOLoadStyles-A-%_release%.oxt
echo OpenOffice 4.x - Windows (32 bit)
goto settings_done

:OpenOffice3-Win64
set _writer=%_OpenOffice3_w64%
set _user=%USERPROFILE%\%_OpenOffice3_Userprofile%
set _ext=OOLoadStyles-%_release%.oxt
echo OpenOffice 3.x - Windows (64 bit)
goto settings_done

:OpenOffice3-Win32
set _writer=%_OpenOffice3_w32%
set _user=%USERPROFILE%\%_OpenOffice3_Userprofile%
set _ext=OOLoadStyles-%_release%.oxt
echo OpenOffice 3.x - Windows (32 bit)
goto settings_done

:LibreOffice6-Win64
set _writer=%_LibreOffice6_w64%
set _user=%USERPROFILE%\%_LibreOffice6_Userprofile%
set _ext="OOLoadStyles-L-"%_release%.oxt
echo LibreOffice 6.x - Windows (64 bit)
goto settings_done

:LibreOffice6-Win32
set _writer=%_LibreOffice6_w32%
set _user=%USERPROFILE%\%_LibreOffice6_Userprofile%
set _ext="OOLoadStyles-L-"%_release%.oxt
echo LibreOffice 6.x - Windows (32 bit)
goto settings_done

:settings_done

echo Installing OpenOffice extension %_ext% ...

"%_writer%\program\unopkg" add -f program\%_ext%

echo Copying template to %_user%\template ...

if not exist "%_user%\template" mkdir "%_user%\template"
copy /-y program\Default.ott "%_user%\template"
copy /-y program\StandardPages.ott "%_user%\template"
copy /-y program\Printout.ott "%_user%\template"


echo -----------------------------------------------------------------
echo #
echo # Installation of OOLoadStyles v%_release% finished.
echo #
echo -----------------------------------------------------------------
pause



:end
115 changes: 115 additions & 0 deletions tools/Uninstall.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
@echo off
REM
REM summary: Removes the OOLoadStyles software package.
REM
REM author: Peter Triesberger
REM see: https://github.com/peter88213/OOLoadStyles
REM license: The MIT License (https://opensource.org/licenses/mit-license.php)
REM copyright: (c) 2019, Peter Triesberger
REM
REM note: This script is to be executed manually.
REM
REM precondition: OOLoadStyles is installed.
REM precondition: OpenOffice.org 3.x or Apache OpenOffice 4.x is installed.
REM postcondition: Previously auto-installed items of OOLoadStyles are removed.
REM postcondition: The templates remain, if user wants so.
REM
REM since: 2019-06-25

set _release=0.4.3

set _OpenOffice4_w64=c:\Program Files (x86)\OpenOffice 4
set _OpenOffice4_w32=c:\Program Files\OpenOffice 4
set _OpenOffice3_w64=c:\Program Files (x86)\OpenOffice.org 3
set _OpenOffice3_w32=c:\Program Files\OpenOffice.org 3
set _LibreOffice6_w64=c:\Program Files (x86)\LibreOffice 6
set _LibreOffice6_w32=c:\Program Files\LibreOffice 6

set _OpenOffice4_Userprofile=AppData\Roaming\OpenOffice\4\user
set _OpenOffice3_Userprofile=AppData\Roaming\OpenOffice.org\3\user
set _LibreOffice6_Userprofile=AppData\Roaming\LibreOffice\4\user

echo -----------------------------------------------------------------
echo # OOLoadStyles (OpenOffice style loader) v%_release%
echo Removing software package ...
echo -----------------------------------------------------------------
rem Detect Combination of Windows and Office
if exist "%_OpenOffice4_w64%\program\swriter.exe" goto OpenOffice4-Win64
if exist "%_OpenOffice4_w32%\program\swriter.exe" goto OpenOffice4-Win32
if exist "%_OpenOffice3_w64%\program\swriter.exe" goto OpenOffice3-Win64
if exist "%_OpenOffice3_w32%\program\swriter.exe" goto OpenOffice3-Win32
rem if exist "%_LibreOffice6_w64%\program\swriter.exe" goto LibreOffice6-Win64
rem if exist "%_LibreOffice6_w32%\program\swriter.exe" goto LibreOffice6-Win32
echo ERROR: No supported version of OpenOffice/LibreOffice found!
echo De-Installation aborted.
goto end

:OpenOffice4-Win64
set _writer=%_OpenOffice4_w64%
set _user=%USERPROFILE%\%_OpenOffice4_Userprofile%
set _ext=OOLoadStyles-A-%_release%.oxt
echo OpenOffice 4.x - Windows (64 bit)
goto settings_done

:OpenOffice4-Win32
set _writer=%_OpenOffice4_w32%
set _user=%USERPROFILE%\%_OpenOffice4_Userprofile%
set _ext=OOLoadStyles-A-%_release%.oxt
echo OpenOffice 4.x - Windows (32 bit)
goto settings_done

:OpenOffice3-Win64
set _writer=%_OpenOffice3_w64%
set _user=%USERPROFILE%\%_OpenOffice3_Userprofile%
set _ext=OOLoadStyles-%_release%.oxt
echo OpenOffice 3.x - Windows (64 bit)
goto settings_done

:OpenOffice3-Win32
set _writer=%_OpenOffice3_w32%
set _user=%USERPROFILE%\%_OpenOffice3_Userprofile%
set _ext=OOLoadStyles-%_release%.oxt
echo OpenOffice 3.x - Windows (32 bit)
goto settings_done

:LibreOffice6-Win64
set _writer=%_LibreOffice6_w64%
set _user=%USERPROFILE%\%_LibreOffice6_Userprofile%
set _ext="OOLoadStyles-L-"%_release%.oxt
echo LibreOffice 6.x - Windows (64 bit)
goto settings_done

:LibreOffice6-Win32
set _writer=%_LibreOffice6_w32%
set _user=%USERPROFILE%\%_LibreOffice6_Userprofile%
set _ext="OOLoadStyles-L-"%_release%.oxt
echo LibreOffice 6.x - Windows (32 bit)
goto settings_done

:settings_done

echo Removing OpenOffice extension %_ext% ...

"%_writer%\program\unopkg" remove -f %_ext%

echo Deleting template in %_user%\template (on confirmation only) ...

set _file="%_user%\template\Default.ott"
if exist %_file% del /p %_file%

set _file="%_user%\template\StandardPages.ott"
if exist %_file% del /p %_file%

set _file="%_user%\template\Printout.ott"
if exist %_file% del /p %_file%

echo -----------------------------------------------------------------
echo #
echo # OOLoadStyles v%_release% is removed from your PC.
echo #
echo -----------------------------------------------------------------
pause



:end
103 changes: 103 additions & 0 deletions tools/cs.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
rem @echo off
REM cs.bat
REM summary: Collects everything for a OOLoadStyles release
REM and puts it into localized setup directories to be zipped.
REM author: Peter Triesberger
REM see: https://github.com/peter88213/OOLoadStyles
REM license: The MIT License (https://opensource.org/licenses/mit-license.php)
REM copyright: (c) 2019, Peter Triesberger
REM since: 2019-06-25

set _release=0.4.3

set _project=OOLoadStyles

set _root=..

rem ********************************************************
rem English/international release
rem ********************************************************

rem --------------------------------------------------------
rem Set up directory structure
rem --------------------------------------------------------

set _source=%_root%\
set _target=%_root%\build\OOLoadStyles_v%_release%

mkdir %_target%
del /s /q %_target%

mkdir %_target%\program
del /s /q %_target%\program


rem --------------------------------------------------------
rem Generate english README file with release info
rem --------------------------------------------------------

echo # OOLoadStyles (OpenOffice style loader) v%_release%>%_target%\README.txt
echo For further information see https://github.com/peter88213/OOLoadStyles/wiki/>>%_target%\README.txt

rem --------------------------------------------------------
rem Copy language dependent release items
rem --------------------------------------------------------

set _file=%_root%\tools\Install.bat
set _dest=%_target%\
call :copyFile

set _file=%_root%\tools\Uninstall.bat
set _dest=%_target%\
call :copyFile

set _file=%_root%\oxt\OOLoadStyles-%_release%.oxt
set _dest=%_target%\program\
call :copyFile

set _file=%_root%\oxt\OOLoadStyles-A-%_release%.oxt
set _dest=%_target%\program\
call :copyFile

set _file=%_root%\oxt\OOLoadStyles-L-%_release%.oxt
set _dest=%_target%\program\
call :copyFile

set _file=%_source%\ott\Default.ott
set _dest=%_target%\program\
call :copyFile

set _file=%_source%\ott\StandardPages.ott
set _dest=%_target%\program\
call :copyFile

set _file=%_source%\ott\Printout.ott
set _dest=%_target%\program\
call :copyFile

set _file=%_root%\LICENSE
set _dest=%_target%\
call :copyFile

exit /b


:copyFile

rem --------------------------------------------------------
rem Copy a file
rem --------------------------------------------------------

if not exist %_file% goto error
copy /y %_file% %_dest%
exit /b


:error

rmdir /s /q %_target%
echo ERROR: %_file% does not exist!
pause
exit

:end

0 comments on commit daffb38

Please sign in to comment.