Updated WIN build scripts

This commit is contained in:
Valentino Orlandi 2022-11-21 00:52:59 +01:00
parent 0ac176b09d
commit 8c3405d0af
Signed by: elB4RTO
GPG Key ID: 1719E976DB2D4E71
3 changed files with 96 additions and 17 deletions

View File

@ -17,7 +17,7 @@ IF NOT EXIST "C:\Program Files\LogDoctor\LogDoctor.exe" GOTO :step1
:loop0
ECHO:
ECHO Warning: a previous installation already exists
ECHO If you choose to continue, the actual content will be overwritten
ECHO If you choose to continue, the actual content will be erased
SET /P agree=Continue? [y/n] :
IF "%agree%"=="y" (
@ -40,12 +40,13 @@ GOTO :loop0
:step1
SET exec_path=C:\Program Files\LogDoctor
IF EXIST "%exec_path%" GOTO :step2
mkdir "%exec_path%"
IF NOT EXIST "%exec_path%" GOTO :step2
rmdir /S /Q "%exec_path%"
IF ERRORLEVEL 1 (
ECHO:
ECHO Error: failed to create directory: '%exec_path%'
ECHO Error: failed to renew the executable directory
cd "%actual_path%"
PAUSE
EXIT /B 1
@ -53,8 +54,7 @@ IF ERRORLEVEL 1 (
:step2
copy /B /V /Y build\LogDoctor.exe "%exec_path%"
xcopy /E /I /V /Y build\LogDoctor "%exec_path%"
IF ERRORLEVEL 1 (
ECHO:
ECHO Error: failed to copy the executable
@ -64,6 +64,41 @@ IF ERRORLEVEL 1 (
)
SET link_path=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\LogDoctor
IF NOT EXIST "%link_path%" GOTO :step3
rmdir /S /Q "%link_path%"
IF ERRORLEVEL 1 (
ECHO:
ECHO Error: failed to remove old menu entry
cd "%actual_path%"
PAUSE
EXIT /B 1
)
:step3
mkdir "%link_path%"
SET link_path=%link_path%\LogDoctor.exe
IF NOT EXIST "%link_path%" GOTO :step4
del "%link_path%"
IF ERRORLEVEL 1 (
ECHO:
ECHO Error: failed to remove symlink
cd "%actual_path%"
PAUSE
EXIT /B 1
)
:step4
mklink "%link_path%" "%exec_path%\LogDoctor.exe"
copy /V /Y installation_stuff\logdoctor.svg "%exec_path%\LogDoctor.svg"
IF ERRORLEVEL 1 (
ECHO:
@ -74,7 +109,7 @@ IF ERRORLEVEL 1 (
)
IF NOT EXIST "%exec_path%\licenses" GOTO :step3
IF NOT EXIST "%exec_path%\licenses" GOTO :step5
rmdir /S /Q "%exec_path%\licenses"
IF ERRORLEVEL 1 (
@ -85,9 +120,9 @@ IF ERRORLEVEL 1 (
EXIT /B 1
)
:step3
:step5
xcopy /E /I /V /Y logdocdata\licenses "%exec_path%\licenses"
xcopy /E /I /V /Y installation_stuff\logdocdata\licenses "%exec_path%\licenses"
IF ERRORLEVEL 1 (
ECHO:
ECHO Error: failed to copy licenses

View File

@ -12,12 +12,13 @@ cd %logdocdir%
SET exec_path=C:\Program Files\LogDoctor
IF EXIST "%exec_path%" GOTO :step1
mkdir "%exec_path%"
IF NOT EXIST "%exec_path%" GOTO :step1
rmdir /S /Q "%exec_path%"
IF ERRORLEVEL 1 (
ECHO:
ECHO Error: failed to create directory: '%exec_path%'
ECHO Error: failed to renew the executable directory
cd "%actual_path%"
PAUSE
EXIT /B 1
@ -25,8 +26,7 @@ IF ERRORLEVEL 1 (
:step1
copy /B /V /Y build\LogDoctor.exe "%exec_path%"
xcopy /E /I /V /Y build\LogDoctor "%exec_path%"
IF ERRORLEVEL 1 (
ECHO:
ECHO Error: failed to copy the executable
@ -36,6 +36,41 @@ IF ERRORLEVEL 1 (
)
SET link_path=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\LogDoctor
IF NOT EXIST "%link_path%" GOTO :step2
rmdir /S /Q "%link_path%"
IF ERRORLEVEL 1 (
ECHO:
ECHO Error: failed to remove old menu entry
cd "%actual_path%"
PAUSE
EXIT /B 1
)
:step2
mkdir "%link_path%"
SET link_path=%link_path%\LogDoctor.exe
IF NOT EXIST "%link_path%" GOTO :step3
del "%link_path%"
IF ERRORLEVEL 1 (
ECHO:
ECHO Error: failed to remove symlink
cd "%actual_path%"
PAUSE
EXIT /B 1
)
:step3
mklink "%link_path%" "%exec_path%\LogDoctor.exe"
copy /V /Y installation_stuff\logdoctor.svg "%exec_path%\LogDoctor.svg"
IF ERRORLEVEL 1 (
ECHO:
@ -45,7 +80,7 @@ IF ERRORLEVEL 1 (
EXIT /B 1
)
IF NOT EXIST "%exec_path%\licenses" GOTO :step2
IF NOT EXIST "%exec_path%\licenses" GOTO :step4
rmdir /S /Q "%exec_path%\licenses"
IF ERRORLEVEL 1 (
@ -56,9 +91,9 @@ IF ERRORLEVEL 1 (
EXIT /B 1
)
:step2
:step4
xcopy /E /I /V /Y logdocdata\licenses "%exec_path%\licenses"
xcopy /E /I /V /Y installation_stuff\logdocdata\licenses "%exec_path%\licenses"
IF ERRORLEVEL 1 (
ECHO:
ECHO Error: failed to copy licenses

View File

@ -277,6 +277,15 @@ IF ERRORLEVEL 1 (
EXIT /B 1
)
:: Deploy the static libraries
IF EXIST LogDoctor rmdir /S /Q LogDoctor
mkdir LogDoctor
move LogDoctor.exe LogDoctor\
SET prefix_path=%prefix_path:/=\%
"%prefix_path%\bin\windeployqt.exe" LogDoctor\
copy /V /Y "%prefix_path%\bin\libstdc++-6.dll" LogDoctor\
copy /V /Y "%prefix_path%\bin\libwinpthread-1.dll" LogDoctor\
copy /V /Y "%prefix_path%\bin\libgcc_s_seh-1.dll" LogDoctor\
:: Compilation finished
ECHO: