0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

UI/installer: Add exit codes for silent installer

Code 3 = Unsupported OS (64bit on 32bit or below Windows 7)
Code 4 = Missing a dependency (VS 2019 or DirectX redistributables)
Code 5 = OBS is already running
Code 6 = OBS files are in use by another app (eg virtual camera)
This commit is contained in:
Richard Stanway 2021-03-30 19:29:57 +02:00 committed by Jim
parent 4f9940d1c0
commit d6fd723f2c

View File

@ -93,12 +93,18 @@ Function PreReqCheck
!ifdef INSTALL64 !ifdef INSTALL64
${if} ${RunningX64} ${if} ${RunningX64}
${Else} ${Else}
IfSilent +1 +3
SetErrorLevel 3
Quit
MessageBox MB_OK|MB_ICONSTOP "This version of OBS Studio is not compatible with your system. Please use the 32bit (x86) installer." MessageBox MB_OK|MB_ICONSTOP "This version of OBS Studio is not compatible with your system. Please use the 32bit (x86) installer."
${EndIf} ${EndIf}
; Abort on XP or lower ; Abort on XP or lower
!endif !endif
${If} ${AtMostWinVista} ${If} ${AtMostWinVista}
IfSilent +1 +3
SetErrorLevel 3
Quit
MessageBox MB_OK|MB_ICONSTOP "Due to extensive use of DirectX 10 features, ${APPNAME} requires Windows 7 or higher and cannot be installed on this version of Windows." MessageBox MB_OK|MB_ICONSTOP "Due to extensive use of DirectX 10 features, ${APPNAME} requires Windows 7 or higher and cannot be installed on this version of Windows."
Quit Quit
${EndIf} ${EndIf}
@ -112,6 +118,9 @@ Function PreReqCheck
Delete "$PLUGINSDIR\check_for_64bit_visual_studio_2019_runtimes.exe" Delete "$PLUGINSDIR\check_for_64bit_visual_studio_2019_runtimes.exe"
IntCmp $R0 126 vs2019Missing_64 vs2019OK_64 IntCmp $R0 126 vs2019Missing_64 vs2019OK_64
vs2019Missing_64: vs2019Missing_64:
IfSilent +1 +3
SetErrorLevel 4
Quit
MessageBox MB_YESNO|MB_ICONEXCLAMATION "Your system is missing runtime components that ${APPNAME} requires. Would you like to download them?" IDYES vs2019true_64 IDNO vs2019false_64 MessageBox MB_YESNO|MB_ICONEXCLAMATION "Your system is missing runtime components that ${APPNAME} requires. Would you like to download them?" IDYES vs2019true_64 IDNO vs2019false_64
vs2019true_64: vs2019true_64:
ExecShell "open" "https://obsproject.com/visual-studio-2019-runtimes-64-bit" ExecShell "open" "https://obsproject.com/visual-studio-2019-runtimes-64-bit"
@ -127,6 +136,9 @@ Function PreReqCheck
GetDLLVersion "msvcp140_1.DLL" $R0 $R1 GetDLLVersion "msvcp140_1.DLL" $R0 $R1
IfErrors vs2019Missing_32 vs2019OK_32 IfErrors vs2019Missing_32 vs2019OK_32
vs2019Missing_32: vs2019Missing_32:
IfSilent +1 +3
SetErrorLevel 4
Quit
MessageBox MB_YESNO|MB_ICONEXCLAMATION "Your system is missing runtime components that ${APPNAME} requires. Would you like to download them?" IDYES vs2019true_32 IDNO vs2019false_32 MessageBox MB_YESNO|MB_ICONEXCLAMATION "Your system is missing runtime components that ${APPNAME} requires. Would you like to download them?" IDYES vs2019true_32 IDNO vs2019false_32
vs2019true_32: vs2019true_32:
ExecShell "open" "https://obsproject.com/visual-studio-2019-runtimes-32-bit" ExecShell "open" "https://obsproject.com/visual-studio-2019-runtimes-32-bit"
@ -189,6 +201,9 @@ Function PreReqCheck
GetDLLVersion "D3DCompiler_49.dll" $R0 $R1 GetDLLVersion "D3DCompiler_49.dll" $R0 $R1
IfErrors dxMissing49 dxOK IfErrors dxMissing49 dxOK
dxMissing49: dxMissing49:
IfSilent +1 +3
SetErrorLevel 4
Quit
MessageBox MB_YESNO|MB_ICONEXCLAMATION "Your system is missing DirectX components that ${APPNAME} requires. Would you like to download them?" IDYES dxtrue IDNO dxfalse MessageBox MB_YESNO|MB_ICONEXCLAMATION "Your system is missing DirectX components that ${APPNAME} requires. Would you like to download them?" IDYES dxtrue IDNO dxfalse
dxtrue: dxtrue:
ExecShell "open" "https://obsproject.com/go/dxwebsetup" ExecShell "open" "https://obsproject.com/go/dxwebsetup"
@ -201,6 +216,9 @@ Function PreReqCheck
check32BitRunning: check32BitRunning:
OBSInstallerUtils::IsProcessRunning "obs32.exe" OBSInstallerUtils::IsProcessRunning "obs32.exe"
IntCmp $R0 1 0 notRunning1 IntCmp $R0 1 0 notRunning1
IfSilent +1 +3
SetErrorLevel 5
Quit
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDCANCEL IDRETRY check32BitRunning MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDCANCEL IDRETRY check32BitRunning
Quit Quit
notRunning1: notRunning1:
@ -209,6 +227,9 @@ Function PreReqCheck
check64BitRunning: check64BitRunning:
OBSInstallerUtils::IsProcessRunning "obs64.exe" OBSInstallerUtils::IsProcessRunning "obs64.exe"
IntCmp $R0 1 0 notRunning2 IntCmp $R0 1 0 notRunning2
IfSilent +1 +3
SetErrorLevel 5
Quit
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDCANCEL IDRETRY check64BitRunning MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDCANCEL IDRETRY check64BitRunning
Quit Quit
notRunning2: notRunning2:
@ -240,6 +261,9 @@ Function checkFilesInUse
retryFileChecks: retryFileChecks:
Call checkDLLs Call checkDLLs
StrCmp $dllFilesInUse "" dllsNotInUse StrCmp $dllFilesInUse "" dllsNotInUse
IfSilent +1 +3
SetErrorLevel 6
Quit
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "OBS files are being used by the following applications:$\r$\n$\r$\n$dllFilesInUse$\r$\nPlease close these applications to continue setup." /SD IDCANCEL IDRETRY retryFileChecks MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "OBS files are being used by the following applications:$\r$\n$\r$\n$dllFilesInUse$\r$\nPlease close these applications to continue setup." /SD IDCANCEL IDRETRY retryFileChecks
Quit Quit