2016-03-21 16:23:41 -07:00
; Script generated with the Venis Install Wizard
2017-02-24 09:07:38 -08:00
Unicode true
2017-02-20 04:59:42 -08:00
2016-03-21 16:23:41 -07:00
; Define your application name
!define APPNAME "OBS Studio"
2017-02-20 04:59:42 -08:00
!ifndef APPVERSION
!define APPVERSION "17.0.2"
!define SHORTVERSION "17.0.2"
!endif
!define APPNAMEANDVERSION "OBS Studio ${SHORTVERSION}"
2016-11-19 11:02:22 -08:00
; !define FULL
2017-02-20 04:59:42 -08:00
!define REALSENSE_PLUGIN
2016-03-21 16:23:41 -07:00
; Additional script dependencies
!include WinVer.nsh
!include x64.nsh
; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES32\obs-studio"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
2016-11-19 11:02:22 -08:00
!ifdef FULL
2017-02-20 04:59:42 -08:00
OutFile "OBS-Studio-${SHORTVERSION}-Full-Installer.exe"
2016-03-21 16:23:41 -07:00
!else
2017-02-20 04:59:42 -08:00
OutFile "OBS-Studio-${SHORTVERSION}-Small-Installer.exe"
2016-03-21 16:23:41 -07:00
!endif
; Use compression
SetCompressor /SOLID LZMA
; Need Admin
RequestExecutionLevel admin
; Modern interface settings
!include "MUI.nsh"
!define MUI_ABORTWARNING
2017-02-24 09:07:38 -08:00
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Launch OBS Studio ${SHORTVERSION}"
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchOBS"
2016-03-21 16:23:41 -07:00
2019-01-01 15:24:45 -08:00
; GPL is not an EULA, no need to agree to it.
!define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
!define MUI_LICENSEPAGE_TEXT_BOTTOM "You are now aware of your rights. Click Next to continue."
2016-03-21 16:23:41 -07:00
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE PreReqCheck
!insertmacro MUI_PAGE_WELCOME
2017-02-20 04:59:42 -08:00
!insertmacro MUI_PAGE_LICENSE "new\core\data\obs-studio\license\gplv2.txt"
2016-03-21 16:23:41 -07:00
!insertmacro MUI_PAGE_DIRECTORY
2016-11-19 11:02:22 -08:00
!ifdef FULL
!insertmacro MUI_PAGE_COMPONENTS
!endif
2016-03-21 16:23:41 -07:00
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
;!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
; Set languages (first is default language)
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
Function PreReqCheck
; Abort on XP or lower
${If} ${AtMostWinXP}
MessageBox MB_OK|MB_ICONSTOP "Due to extensive use of DirectX 10 features, ${APPNAME} requires Windows Vista SP2 or higher and cannot be installed on this version of Windows."
Quit
${EndIf}
; Vista specific checks
${If} ${IsWinVista}
; Check Vista SP2
${If} ${AtMostServicePack} 1
MessageBox MB_YESNO|MB_ICONEXCLAMATION "${APPNAME} requires Service Pack 2 when running on Vista. Would you like to download it?" IDYES sptrue IDNO spfalse
sptrue:
ExecShell "open" "http://windows.microsoft.com/en-US/windows-vista/Learn-how-to-install-Windows-Vista-Service-Pack-2-SP2"
spfalse:
Quit
${EndIf}
; Check Vista Platform Update
nsexec::exectostack "$SYSDIR\wbem\wmic.exe qfe where HotFixID='KB971512' get HotFixID /Format:list"
pop $0
pop $0
strcpy $1 $0 17 6
strcmps $1 "HotFixID=KB971512" gotPatch
MessageBox MB_YESNO|MB_ICONEXCLAMATION "${APPNAME} requires the Windows Vista Platform Update. Would you like to download it?" IDYES putrue IDNO pufalse
putrue:
${If} ${RunningX64}
; 64 bit
ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=4390"
${Else}
; 32 bit
ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=3274"
${EndIf}
pufalse:
Quit
gotPatch:
${EndIf}
2017-07-05 04:31:39 -07:00
; 32 bit Visual Studio 2013 runtime check
2016-03-21 16:23:41 -07:00
ClearErrors
GetDLLVersion "MSVCR120.DLL" $R0 $R1
2017-07-05 04:31:39 -07:00
GetDLLVersion "MSVCP120.DLL" $R0 $R1
IfErrors vs2013Missing vs2013OK1
2016-03-21 16:23:41 -07:00
vs2013Missing:
2016-04-13 16:01:02 -07:00
MessageBox MB_YESNO|MB_ICONEXCLAMATION "Your system is missing runtime components that ${APPNAME} requires. Please make sure to install both vcredist_x64 and vcredist_x86. Would you like to download them?" IDYES vs2013true IDNO vs2013false
2016-03-21 16:23:41 -07:00
vs2013true:
2017-05-28 15:34:19 -07:00
ExecShell "open" "https://obsproject.com/visual-studio-2013-runtimes"
2016-03-21 16:23:41 -07:00
vs2013false:
Quit
2017-07-05 04:31:39 -07:00
vs2013OK1:
2016-03-21 16:23:41 -07:00
ClearErrors
2017-07-05 04:31:39 -07:00
; 64 bit Visual Studio 2013 runtime check
${if} ${RunningX64}
SetOutPath "$TEMP\OBS"
File check_for_64bit_visual_studio_2013_runtimes.exe
ExecWait "$TEMP\OBS\check_for_64bit_visual_studio_2013_runtimes.exe" $R0
Delete "$TEMP\OBS\check_for_64bit_visual_studio_2013_runtimes.exe"
RMDir "$TEMP\OBS"
IntCmp $R0 126 vs2013Missing vs2013OK2
vs2013OK2:
ClearErrors
${endif}
2016-03-21 16:23:41 -07:00
; DirectX Version Check
ClearErrors
GetDLLVersion "D3DCompiler_33.dll" $R0 $R1
IfErrors dxMissing33 dxOK
dxMissing33:
ClearErrors
GetDLLVersion "D3DCompiler_34.dll" $R0 $R1
IfErrors dxMissing34 dxOK
dxMissing34:
ClearErrors
GetDLLVersion "D3DCompiler_35.dll" $R0 $R1
IfErrors dxMissing35 dxOK
dxMissing35:
ClearErrors
GetDLLVersion "D3DCompiler_36.dll" $R0 $R1
IfErrors dxMissing36 dxOK
dxMissing36:
ClearErrors
GetDLLVersion "D3DCompiler_37.dll" $R0 $R1
IfErrors dxMissing37 dxOK
dxMissing37:
ClearErrors
GetDLLVersion "D3DCompiler_38.dll" $R0 $R1
IfErrors dxMissing38 dxOK
dxMissing38:
ClearErrors
GetDLLVersion "D3DCompiler_39.dll" $R0 $R1
IfErrors dxMissing39 dxOK
dxMissing39:
ClearErrors
GetDLLVersion "D3DCompiler_40.dll" $R0 $R1
IfErrors dxMissing40 dxOK
dxMissing40:
ClearErrors
GetDLLVersion "D3DCompiler_41.dll" $R0 $R1
IfErrors dxMissing41 dxOK
dxMissing41:
ClearErrors
GetDLLVersion "D3DCompiler_42.dll" $R0 $R1
IfErrors dxMissing42 dxOK
dxMissing42:
ClearErrors
GetDLLVersion "D3DCompiler_43.dll" $R0 $R1
IfErrors dxMissing43 dxOK
dxMissing43:
ClearErrors
GetDLLVersion "D3DCompiler_47.dll" $R0 $R1
IfErrors dxMissing47 dxOK
dxMissing47:
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:
ExecShell "open" "https://obsproject.com/go/dxwebsetup"
dxfalse:
Quit
dxOK:
ClearErrors
; Check previous instance
2017-02-20 05:01:29 -08:00
OBSInstallerUtils::IsProcessRunning "obs32.exe"
2016-09-07 14:42:27 -07:00
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:
2017-02-20 05:01:29 -08:00
2016-09-07 14:42:27 -07:00
${if} ${RunningX64}
2017-02-20 05:01:29 -08:00
OBSInstallerUtils::IsProcessRunning "obs64.exe"
2016-09-07 14:42:27 -07:00
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
2017-02-20 05:01:29 -08:00
notRunning2:
2016-09-07 14:42:27 -07:00
${endif}
2016-03-21 16:23:41 -07:00
2017-02-20 05:01:29 -08:00
OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-capture\graphics-hook32.dll"
OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-capture\graphics-hook64.dll"
OBSInstallerUtils::GetAppNameForInUseFiles
StrCmp $R0 "" gameCaptureNotRunning
MessageBox MB_OK|MB_ICONEXCLAMATION "Game Capture is still in use by the following applications:$\r$\n$\r$\n$R0$\r$\nPlease close these applications before installing a new version of OBS." /SD IDOK
Quit
gameCaptureNotRunning:
2016-03-21 16:23:41 -07:00
FunctionEnd
Function filesInUse
MessageBox MB_OK|MB_ICONEXCLAMATION "Some files were not able to be installed. If this is the first time you are installing OBS, please disable any anti-virus or other security software and try again. If you are re-installing or updating OBS, close any applications that may be have been hooked, or reboot and try again." /SD IDOK
FunctionEnd
2017-02-24 09:07:38 -08:00
Function LaunchOBS
${if} ${RunningX64}
Exec '"$WINDIR\explorer.exe" "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk"'
${else}
Exec '"$WINDIR\explorer.exe" "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk"'
${endif}
FunctionEnd
2016-03-21 16:23:41 -07:00
Var outputErrors
2016-11-19 11:02:22 -08:00
Section "OBS Studio" SecCore
2016-03-21 16:23:41 -07:00
; Set Section properties
2016-11-19 11:02:22 -08:00
SectionIn RO
2016-03-21 16:23:41 -07:00
SetOverwrite on
2016-09-07 14:42:27 -07:00
AllowSkipFiles off
2016-03-21 16:23:41 -07:00
SetShellVarContext all
; Set Section Files and Shortcuts
SetOutPath "$INSTDIR"
2017-02-20 04:59:42 -08:00
OBSInstallerUtils::KillProcess "obs-plugins\32bit\cef-bootstrap.exe"
OBSInstallerUtils::KillProcess "obs-plugins\64bit\cef-bootstrap.exe"
File /r "new\core\data"
2016-03-21 16:23:41 -07:00
SetOutPath "$INSTDIR\bin"
2017-02-20 04:59:42 -08:00
File /r "new\core\bin\32bit"
2016-03-21 16:23:41 -07:00
SetOutPath "$INSTDIR\obs-plugins"
2017-02-20 04:59:42 -08:00
File /r "new\core\obs-plugins\32bit"
2016-03-21 16:23:41 -07:00
${if} ${RunningX64}
SetOutPath "$INSTDIR\bin"
2017-02-20 04:59:42 -08:00
File /r "new\core\bin\64bit"
2016-03-21 16:23:41 -07:00
SetOutPath "$INSTDIR\obs-plugins"
2017-02-20 04:59:42 -08:00
File /r "new\core\obs-plugins\64bit"
2016-03-21 16:23:41 -07:00
${endif}
ClearErrors
IfErrors 0 +2
StrCpy $outputErrors "yes"
WriteUninstaller "$INSTDIR\uninstall.exe"
; Delete Old "Multiplatform" Shortcuts
Delete "$DESKTOP\OBS Multiplatform.lnk"
Delete "$SMPROGRAMS\OBS Multiplatform\OBS Multiplatform (32bit).lnk"
Delete "$SMPROGRAMS\OBS Multiplatform\Uninstall.lnk"
${if} ${RunningX64}
Delete "$SMPROGRAMS\OBS Multiplatform\OBS Multiplatform (64bit).lnk"
${endif}
2016-12-21 18:43:52 -08:00
${if} ${RunningX64}
2017-02-20 04:59:42 -08:00
SetOutPath "$INSTDIR\bin\64bit"
2016-12-21 18:43:52 -08:00
CreateShortCut "$DESKTOP\OBS Studio.lnk" "$INSTDIR\bin\64bit\obs64.exe"
${else}
2017-02-20 04:59:42 -08:00
SetOutPath "$INSTDIR\bin\32bit"
2016-12-21 18:43:52 -08:00
CreateShortCut "$DESKTOP\OBS Studio.lnk" "$INSTDIR\bin\32bit\obs32.exe"
${endif}
2017-02-20 04:59:42 -08:00
SetOutPath "$INSTDIR\bin\32bit"
2016-03-21 16:23:41 -07:00
CreateDirectory "$SMPROGRAMS\OBS Studio"
CreateShortCut "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk" "$INSTDIR\bin\32bit\obs32.exe"
CreateShortCut "$SMPROGRAMS\OBS Studio\Uninstall.lnk" "$INSTDIR\uninstall.exe"
${if} ${RunningX64}
SetOutPath "$INSTDIR\bin\64bit"
CreateShortCut "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk" "$INSTDIR\bin\64bit\obs64.exe"
${endif}
SetOutPath "$INSTDIR\bin\32bit"
StrCmp $outputErrors "yes" 0 +2
Call filesInUse
SectionEnd
2016-11-19 11:02:22 -08:00
!ifdef FULL
SectionGroup /e "Plugins" SecPlugins
2017-05-28 13:20:52 -07:00
Section "Browser Source" SecPlugins_Browser
2016-11-19 11:02:22 -08:00
; Set Section properties
SetOverwrite on
AllowSkipFiles off
SetShellVarContext all
SetOutPath "$INSTDIR\obs-plugins"
2017-02-20 05:01:29 -08:00
OBSInstallerUtils::KillProcess "32bit\cef-bootstrap.exe"
2017-02-20 04:59:42 -08:00
File /r "new\obs-browser\obs-plugins\32bit"
2016-11-19 11:02:22 -08:00
${if} ${RunningX64}
2017-02-20 05:01:29 -08:00
OBSInstallerUtils::KillProcess "64bit\cef-bootstrap.exe"
2017-02-20 04:59:42 -08:00
File /r "new\obs-browser\obs-plugins\64bit"
2016-11-19 11:02:22 -08:00
${endif}
SetOutPath "$INSTDIR\bin\32bit"
SectionEnd
!ifdef REALSENSE_PLUGIN
2017-05-28 13:20:52 -07:00
Section /o "Realsense Source" SecPlugins_Realsense
2016-11-19 11:02:22 -08:00
SetOverwrite on
AllowSkipFiles off
SetShellVarContext all
SetOutPath "$INSTDIR\obs-plugins"
2017-05-28 15:27:43 -07:00
File /r "new\realsense\obs-plugins\32bit"
2016-11-19 11:02:22 -08:00
${if} ${RunningX64}
2017-05-28 15:27:43 -07:00
File /r "new\realsense\obs-plugins\64bit"
2016-11-19 11:02:22 -08:00
${endif}
SetOutPath "$INSTDIR\data\obs-plugins"
2017-02-20 04:59:42 -08:00
File /r "new\realsense\data\obs-plugins\win-ivcam"
2016-11-19 11:02:22 -08:00
ExecWait '"$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" /UnregServer'
ExecWait '"$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" /RegServer'
ReadRegStr $0 HKLM "Software\Intel\RSSDK\Dispatch" "Core"
${if} ${Errors}
ReadRegStr $0 HKLM "Software\Intel\RSSDK\v10\Dispatch" "Core"
${endif}
${if} ${Errors}
InitPluginsDir
SetOutPath "$PLUGINSDIR\realsense"
File "intel_rs_sdk_runtime_websetup_10.0.26.0396.exe"
ExecWait '"$PLUGINSDIR\realsense\intel_rs_sdk_runtime_websetup_10.0.26.0396.exe" --finstall=personify --fnone=all'
2016-12-21 18:43:30 -08:00
${endif}
2016-11-19 11:02:22 -08:00
SetOutPath "$INSTDIR\bin\32bit"
SectionEnd
!endif
SectionGroupEnd
!endif
2016-03-21 16:23:41 -07:00
Section -FinishSection
WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "ProductID" "d16d2409-3151-4331-a9b1-dfd8cf3f0d9c"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\bin\32bit\obs32.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "OBS Project"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "HelpLink" "https://obsproject.com"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${APPVERSION}"
SectionEnd
; Modern install component descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
2016-11-19 11:02:22 -08:00
!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "Core OBS Studio files"
!ifdef FULL
!insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Optional Plugins"
!insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins_Browser} "Browser plugin (a source you can add to your scenes that displays web pages)"
!ifdef REALSENSE_PLUGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins_Realsense} "Plugin for Realsense cameras"
!endif
!endif
2016-03-21 16:23:41 -07:00
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;Uninstall section
2016-11-19 11:02:22 -08:00
Section "un.obs-studio Program Files" UninstallSection1
2016-03-21 16:23:41 -07:00
SectionIn RO
;Remove from registry...
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
; Delete self
Delete "$INSTDIR\uninstall.exe"
; Delete Shortcuts
Delete "$DESKTOP\OBS Studio.lnk"
Delete "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk"
Delete "$SMPROGRAMS\OBS Studio\Uninstall.lnk"
${if} ${RunningX64}
Delete "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk"
${endif}
2016-11-19 11:02:22 -08:00
IfFileExists "$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" UnregisterSegService SkipUnreg
UnregisterSegService:
ExecWait '"$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" /UnregServer'
SkipUnreg:
2016-03-21 16:23:41 -07:00
; Clean up OBS Studio
RMDir /r "$INSTDIR\bin"
RMDir /r "$INSTDIR\data"
RMDir /r "$INSTDIR\obs-plugins"
RMDir "$INSTDIR"
; Remove remaining directories
RMDir "$SMPROGRAMS\OBS Studio"
RMDir "$INSTDIR\OBS Studio"
SectionEnd
2016-11-19 11:02:22 -08:00
Section /o "un.User Settings" UninstallSection2
2016-03-21 16:23:41 -07:00
RMDir /R "$APPDATA\obs-studio"
SectionEnd
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
2016-11-19 11:02:22 -08:00
!insertmacro MUI_DESCRIPTION_TEXT ${UninstallSection1} "Remove the OBS program files."
!insertmacro MUI_DESCRIPTION_TEXT ${UninstallSection2} "Removes all settings, plugins, scenes and sources, profiles, log files and other application data."
2016-03-21 16:23:41 -07:00
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
2016-09-07 14:42:27 -07:00
; Version information
2017-02-20 04:59:42 -08:00
VIProductVersion "${APPVERSION}.0"
2016-09-07 14:42:27 -07:00
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"
2016-03-21 16:23:41 -07:00
; eof