w10install/optional/install-purebasic.cmd

79 lines
1.9 KiB
Batchfile
Raw Normal View History

2022-11-13 22:12:39 +01:00
@echo off
call check-for-admin
if %ERRORLEVEL% neq 0 exit /b
2022-11-13 22:12:39 +01:00
2023-08-13 14:42:56 +02:00
set T=%SystemDrive%\TEMP
2022-11-13 22:12:39 +01:00
set CONFIG=config\install-purebasic.txt
set STARTMENU="%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs"
rem licensed version (exe contains key!)
2024-02-21 13:25:46 +01:00
set EXE=..\software\purebasic-setup.exe
2022-11-13 22:12:39 +01:00
rem demo version (publically accessible)
set ZIP=..\software\purebasic.zip
2023-01-20 21:50:27 +01:00
echo ####### %0 #######
2022-11-13 22:12:39 +01:00
echo killing PureBasic processes...
taskkill /F /IM PureBasic.exe 2>nul
taskkill /F /IM pbcompiler.exe 2>nul
rem YES - this works. It is a "AND" construct...
if NOT EXIST %EXE% if NOT EXIST %ZIP% (
echo WARNING: no PureBasic zipfile or exe-installer found!
goto END
)
if EXIST %EXE% (
2023-01-20 21:50:27 +01:00
echo INFO: %EXE% found, installing licensed version ...
2022-11-13 22:12:39 +01:00
echo installing purebasic ...
start /wait %EXE% /LOADINF=%CONFIG% /NORESTART /NOCANCEL ^
/SILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS
2023-01-20 21:50:27 +01:00
2022-11-13 22:12:39 +01:00
goto LINK
2023-01-20 21:50:27 +01:00
2022-11-13 22:12:39 +01:00
)
if EXIST %ZIP% (
2023-01-20 21:50:27 +01:00
echo INFO: %ZIP% found, installing demo version ...
2022-11-13 22:12:39 +01:00
7z e -y -aoa -o%T%\purebasic %ZIP%
move /Y %T%\purebasic\PureBasic*.exe %T%\purebasic\purebasic-setup.exe
echo installing purebasic ...
start /wait %T%\purebasic\purebasic-setup.exe ^
/LOADINF=%CONFIG% /NORESTART /NOCANCEL /SILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS
echo cleanup ...
2023-01-20 21:50:27 +01:00
rd /S /Q %T%\purebasic 2>nul
2022-11-13 22:12:39 +01:00
goto LINK
2023-01-20 21:50:27 +01:00
2022-11-13 22:12:39 +01:00
)
:LINK
2023-01-20 21:50:27 +01:00
echo removing old desktop links ...
del /F /Q /A "%PUBLIC%\Desktop\PureBasic*.lnk" 2>nul
del /F /Q /A "%USERPROFILE%\Desktop\PureBasic*.lnk" 2>nul
2022-11-13 22:12:39 +01:00
2023-01-20 21:50:27 +01:00
echo copying new PureBasic link to public desktop ...
copy /Y %STARTMENU%\"PureBasic\PureBasic (x64).lnk" %PUBLIC%\Desktop\PureBasic.lnk
2022-11-13 22:12:39 +01:00
echo moving PureBasic startmenu shortcut ...
2023-01-20 21:50:27 +01:00
move /Y %STARTMENU%\"PureBasic\PureBasic (x64).lnk" %STARTMENU%\PureBasic.lnk
2022-11-13 22:12:39 +01:00
echo removing PureBasic startmenu folder ...
2023-01-20 21:50:27 +01:00
rd /S /Q %STARTMENU%\PureBasic 2>nul
rem refresh desktop (W10 style)
ie4uinit.exe -show
2022-11-13 22:12:39 +01:00
:END
2023-01-20 21:50:27 +01:00
echo ####### %0 #######
2022-11-13 22:12:39 +01:00
pause