UI/installer: Miscellaneous installer improvements

- Checks for previous instances by using the FindProcDLL NSIS plugin

- No longer allows ignoring if there is a sharing violation.

- Added version information section to allow friendly description in
  the UAC elevation prompt.

- Kill lingering instances of cef-bootstrap before installing.
This commit is contained in:
Richard Stanway 2016-09-07 23:42:27 +02:00
parent be89ef8712
commit 007d39e296
No known key found for this signature in database
GPG Key ID: AAC1E5265D71B3FD

View File

@ -156,12 +156,18 @@ Function PreReqCheck
ClearErrors
; Check previous instance
; System::Call 'kernel32::OpenMutexW(i 0x100000, b 0, w "OBSMutex") i .R0'
; IntCmp $R0 0 notRunning
; System::Call 'kernel32::CloseHandle(i $R0)'
; MessageBox MB_OK|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDOK
; Quit
notRunning:
FindProcDLL::FindProc "obs32.exe"
IntCmp $R0 1 0 notRunning1
MessageBox MB_OK|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDOK
Quit
notRunning1:
${if} ${RunningX64}
FindProcDLL::FindProc "obs64.exe"
IntCmp $R0 1 0 notRunning2
MessageBox MB_OK|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDOK
Quit
${endif}
notRunning2:
FunctionEnd
@ -175,6 +181,10 @@ Section "OBS Studio" Section1
; Set Section properties
SetOverwrite on
AllowSkipFiles off
FindProcDLL::KillProc "obs-plugins\32bit\cef-bootstrap.exe"
FindProcDLL::KillProc "obs-plugins\64bit\cef-bootstrap.exe"
SetShellVarContext all
@ -283,4 +293,13 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Removes all settings, plugins, scenes and sources, profiles, log files and other application data."
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
; Version information
VIProductVersion "0.${APPVERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "OBS Studio"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "obsproject.com"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "(c) 2012-2016"
; FileDescription is what shows in the UAC elevation prompt when signed
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "OBS Studio"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.0"
; eof