Compare commits

..

15 Commits
0.10 ... master

11 changed files with 71 additions and 26 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
Duplicati_installer_v0.1.exe
*.exe
archived_files.7z
InstallUtil.InstallLog
.DS_Store

0
7zSD.sfx Executable file → Normal file
View File

4
config.txt Executable file → Normal file
View File

@ -1,5 +1,5 @@
;!@Install@!UTF-8!
Title="My Dental Backup Installer (t00t)"
BeginPrompt="Run Mats Mad cool setup script?"
Title="My Dental Backup Installer"
BeginPrompt="Run setup script?"
ExecuteFile="setup_duplicati.bat"
;!@InstallEnd@!

4
create_zip.bat Executable file → Normal file
View File

@ -5,7 +5,7 @@ cls
:START
echo.
echo Copyright -- Matthew Shillam -- 2018
echo Copyright -- Matthew Shillam -- 2021
echo.
echo ---------------------------------------------------------------------------
echo %date% %time% - Install started
@ -17,7 +17,7 @@ start /wait 7z.exe a archived_files.7z .\duplicati_install_script\* -r -x!*.git
echo.
echo Archived all files now creating the installer....
echo.
copy /b 7zSD.sfx + config.txt + archived_files.7z Duplicati_installer_v0.1.exe
copy /b 7zSD.sfx + config.txt + archived_files.7z Duplicati_installer_v0.8.exe
echo.
echo All done!

0
duplicati_install_script/bin/WinSCP.com Executable file → Normal file
View File

0
duplicati_install_script/bin/WinSCP.exe Executable file → Normal file
View File

0
duplicati_install_script/bin/duplicati_client.exe Executable file → Normal file
View File

Binary file not shown.

View File

@ -6,7 +6,7 @@ cls
:START
echo.
echo Copyright -- Matthew Shillam -- 2018
echo Copyright -- Matthew Shillam -- 2021
echo.
echo ---------------------------------------------------------------------------
echo %date% %time% - Duplicati Install started
@ -59,12 +59,21 @@ cls
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OSTYPE=32Bit || set OSTYPE=64Bit
if %OSTYPE%==64Bit (
reg query HKEY_CLASSES_ROOT\Installer\Dependencies\,,amd64,14.0,bundle 1>NUL || "%~dp0bin\vc_redist.x64.exe" /norestart
)
if %OSTYPE%==32Bit (
reg query HKEY_CLASSES_ROOT\Installer\Dependencies\,,x86,14.0,bundle 1>NUL || "%~dp0bin\vc_redist.x32.exe" /norestart
)
:DUPLICATIINSTALL
echo .
echo Installing duplicati binary...
echo Ensure that you deselect run at startup to ensure service works proper!
echo Also! Ensure you do not run duplicati after install has completed!!
start /wait msiexec /i %~dp0bin\duplicati-2.0.3.11_canary_2018-09-05-x64.msi
start /wait msiexec /i "%~dp0bin\duplicati-2.0.7.1_beta_2023-05-25-x64.msi"
goto GETPROGRAMPATH
@ -75,27 +84,57 @@ cls
IF "%OS%"=="Windows_NT" SET NUL=
echo.
echo ---------------------------------------------------------------------------
SET "PROGRAMFOLDER=C:\Program Files\Duplicati 2\"
IF EXIST "C:\Program Files (x86)\Duplicati 2\%NUL%" ( SET "PROGRAMFOLDER=C:\Program Files (x86)\Duplicati 2\" )& echo Program path is: "C:\Program Files (x86)\Duplicati 2\"
IF EXIST "C:\Program Files\Duplicati 2\%NUL%" (SET "PROGRAMFOLDER=C:\Program Files\Duplicati 2\")& echo Program path is: "C:\Program Files\Duplicati 2\"
REM IF "%PROGRAMFOLDER%" == "" echo Software was not installed... time to debug!& GOTO EXITNOW
IF EXIST "C:\Program Files\Duplicati 2\%NUL%" ( SET "PROGRAMFOLDER=C:\Program Files\Duplicati 2\")& echo Program path is: "C:\Program Files\Duplicati 2\"
:SERVICECHECK
Set ServiceName=Duplicati
SC QUERY %ServiceName% > NUL
IF ERRORLEVEL 1060 GOTO SETUPSERVICE
echo %ServiceName% service already installed, skipping service install...
echo.
GOTO STARTSERVICE
:SETUPSERVICE
set "execpath=%PROGRAMFOLDER%\Duplicati.WindowsService.exe"
"%execpath%" install --webservice-interface=127.0.0.1 --webservice-port=8200 --portable-mode
echo .
GOTO STARTSERVICE
set "execpath=%PROGRAMFOLDER%\Duplicati.WindowsService.exe"
"%execpath%" install --webservice-interface=127.0.0.1 --webservice-port=8200 --portable-mode
echo .
NET START Duplicati
:STARTSERVICE
SC queryex "%ServiceName%"|Find "STATE"|Find /v "RUNNING">Nul&&(
echo %ServiceName% not running...
echo Starting %ServiceName%...
NET start "%ServiceName%">nul||(
Echo "%ServiceName%" wont start
)
echo "%ServiceName%" started
)||(
echo "%ServiceName%" working
)
:GETCLIENTNAME
echo Enter client name ( In email eg: client-mat-is-ace )? :
set /p CLIENTNAME=
echo.
set CLIENTNAME=%CLIENTNAME: =%
echo ---------------------------------------------------------------------------
echo Ok -- %CLIENTNAME% it is...
echo Ok -- ( %CLIENTNAME% ) it is...
echo ---------------------------------------------------------------------------
echo.
goto GETSCHEDULES
@ -106,11 +145,12 @@ cls
set FILEXRAYS="schedule-xrays-%CLIENTNAME%.json"
set FILEDATABASE="schedule-database-%CLIENTNAME%.json"
set FILEDOCUMENTS="schedule-documents-%CLIENTNAME%.json"
set LOCATION="%~dp0bin"
%~dp0bin\winscp.com /ini=nul /command ^
"open sftp://mrdownloader@mydentalbackup.co.uk:5349/ -hostkey=""ssh-ed25519 256 PTL6imOWXdhJQEuBThd8yfozcuOtOxpKEZs0hOGZh3c="" -privatekey=""%~dp0bin\id_deployer2.ppk""" ^
"cd /home/mydentalbackup.co.uk/files" ^
"lcd %~dp0bin" ^
"%~dp0bin\winscp.com" /ini=nul /command ^
"open sftp://deployer@mydentalbackup.co.uk:2122/ -hostkey=""ssh-ed25519 256 c3Vk9bRNCbt1GtuJLi1sGbixUAza34dTo/4Bcy31XOk="" -privatekey=""%~dp0bin\id_deployer2.ppk""" ^
"cd www/mydentalbackup.co.uk/files" ^
"lcd C:\" ^
"get %FILEDATABASE%" "get %FILEDOCUMENTS%" "get %FILEXRAYS%" ^
"close" ^
"exit"
@ -121,12 +161,13 @@ cls
:ADDSCHEDULES
%~dp0bin\duplicati_client.exe login http://127.0.0.1:8200
%~dp0bin\duplicati_client.exe create backup %~dp0bin\schedule-database-%CLIENTNAME%.json
%~dp0bin\duplicati_client.exe create backup %~dp0bin\schedule-documents-%CLIENTNAME%.json
%~dp0bin\duplicati_client.exe create backup %~dp0bin\schedule-xrays-%CLIENTNAME%.json
"%~dp0bin\duplicati_client.exe" login http://127.0.0.1:8200
"%~dp0bin\duplicati_client.exe" create backup "C:\schedule-database-%CLIENTNAME%.json"
"%~dp0bin\duplicati_client.exe" create backup "C:\schedule-documents-%CLIENTNAME%.json"
"%~dp0bin\duplicati_client.exe" create backup "C:\schedule-xrays-%CLIENTNAME%.json"
goto SORTCHORTCUTS
goto SORTCHORTCUTS
:SORTCHORTCUTS
@ -135,10 +176,14 @@ goto SORTCHORTCUTS
echo.
del "%USERPROFILE%\Desktop\Duplicati 2.lnk"
echo.
echo Adding new shortcut to desktop
xcopy "%~dp0bin\Duplicati 2 start.lnk" %USERPROFILE%\Desktop
echo Deleting Temp files...
del "C:\%FILEDATABASE%"
del "C:\%FILEDOCUMENTS%"
del "C:\%FILEXRAYS%"
:EXITNOW
echo.
echo.
@ -151,6 +196,6 @@ goto SORTCHORTCUTS
echo. & echo %date% %time% - %~nx0 ended & echo.
Cmd /k
Cmd /k
:EXITCLOSE