mp-installer.nsi 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. ; Script generated with the Venis Install Wizard
  2. Unicode true
  3. ; Define your application name
  4. !define APPNAME "OBS Studio"
  5. !ifndef APPVERSION
  6. !define APPVERSION "17.0.2"
  7. !define SHORTVERSION "17.0.2"
  8. !endif
  9. !define APPNAMEANDVERSION "OBS Studio ${SHORTVERSION}"
  10. ; !define FULL
  11. !define REALSENSE_PLUGIN
  12. ; Additional script dependencies
  13. !include WinVer.nsh
  14. !include x64.nsh
  15. ; Main Install settings
  16. Name "${APPNAMEANDVERSION}"
  17. InstallDir "$PROGRAMFILES32\obs-studio"
  18. InstallDirRegKey HKLM "Software\${APPNAME}" ""
  19. !ifdef FULL
  20. OutFile "OBS-Studio-${SHORTVERSION}-Full-Installer.exe"
  21. !else
  22. OutFile "OBS-Studio-${SHORTVERSION}-Small-Installer.exe"
  23. !endif
  24. ; Use compression
  25. SetCompressor /SOLID LZMA
  26. ; Need Admin
  27. RequestExecutionLevel admin
  28. ; Modern interface settings
  29. !include "MUI.nsh"
  30. !define MUI_ABORTWARNING
  31. !define MUI_FINISHPAGE_RUN
  32. !define MUI_FINISHPAGE_RUN_TEXT "Launch OBS Studio ${SHORTVERSION}"
  33. !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchOBS"
  34. ; GPL is not an EULA, no need to agree to it.
  35. !define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
  36. !define MUI_LICENSEPAGE_TEXT_BOTTOM "You are now aware of your rights. Click Next to continue."
  37. !define MUI_PAGE_CUSTOMFUNCTION_LEAVE PreReqCheck
  38. !insertmacro MUI_PAGE_WELCOME
  39. !insertmacro MUI_PAGE_LICENSE "new\core\data\obs-studio\license\gplv2.txt"
  40. !insertmacro MUI_PAGE_DIRECTORY
  41. !ifdef FULL
  42. !insertmacro MUI_PAGE_COMPONENTS
  43. !endif
  44. !insertmacro MUI_PAGE_INSTFILES
  45. !insertmacro MUI_PAGE_FINISH
  46. ;!insertmacro MUI_UNPAGE_CONFIRM
  47. !insertmacro MUI_UNPAGE_COMPONENTS
  48. !insertmacro MUI_UNPAGE_INSTFILES
  49. ; Set languages (first is default language)
  50. !insertmacro MUI_LANGUAGE "English"
  51. !insertmacro MUI_RESERVEFILE_LANGDLL
  52. Function PreReqCheck
  53. ; Abort on XP or lower
  54. ${If} ${AtMostWinXP}
  55. 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."
  56. Quit
  57. ${EndIf}
  58. ; Vista specific checks
  59. ${If} ${IsWinVista}
  60. ; Check Vista SP2
  61. ${If} ${AtMostServicePack} 1
  62. MessageBox MB_YESNO|MB_ICONEXCLAMATION "${APPNAME} requires Service Pack 2 when running on Vista. Would you like to download it?" IDYES sptrue IDNO spfalse
  63. sptrue:
  64. ExecShell "open" "http://windows.microsoft.com/en-US/windows-vista/Learn-how-to-install-Windows-Vista-Service-Pack-2-SP2"
  65. spfalse:
  66. Quit
  67. ${EndIf}
  68. ; Check Vista Platform Update
  69. nsexec::exectostack "$SYSDIR\wbem\wmic.exe qfe where HotFixID='KB971512' get HotFixID /Format:list"
  70. pop $0
  71. pop $0
  72. strcpy $1 $0 17 6
  73. strcmps $1 "HotFixID=KB971512" gotPatch
  74. MessageBox MB_YESNO|MB_ICONEXCLAMATION "${APPNAME} requires the Windows Vista Platform Update. Would you like to download it?" IDYES putrue IDNO pufalse
  75. putrue:
  76. ${If} ${RunningX64}
  77. ; 64 bit
  78. ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=4390"
  79. ${Else}
  80. ; 32 bit
  81. ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=3274"
  82. ${EndIf}
  83. pufalse:
  84. Quit
  85. gotPatch:
  86. ${EndIf}
  87. ; 32 bit Visual Studio 2013 runtime check
  88. ClearErrors
  89. GetDLLVersion "MSVCR120.DLL" $R0 $R1
  90. GetDLLVersion "MSVCP120.DLL" $R0 $R1
  91. IfErrors vs2013Missing vs2013OK1
  92. vs2013Missing:
  93. 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
  94. vs2013true:
  95. ExecShell "open" "https://obsproject.com/visual-studio-2013-runtimes"
  96. vs2013false:
  97. Quit
  98. vs2013OK1:
  99. ClearErrors
  100. ; 64 bit Visual Studio 2013 runtime check
  101. ${if} ${RunningX64}
  102. SetOutPath "$TEMP\OBS"
  103. File check_for_64bit_visual_studio_2013_runtimes.exe
  104. ExecWait "$TEMP\OBS\check_for_64bit_visual_studio_2013_runtimes.exe" $R0
  105. Delete "$TEMP\OBS\check_for_64bit_visual_studio_2013_runtimes.exe"
  106. RMDir "$TEMP\OBS"
  107. IntCmp $R0 126 vs2013Missing vs2013OK2
  108. vs2013OK2:
  109. ClearErrors
  110. ${endif}
  111. ; DirectX Version Check
  112. ClearErrors
  113. GetDLLVersion "D3DCompiler_33.dll" $R0 $R1
  114. IfErrors dxMissing33 dxOK
  115. dxMissing33:
  116. ClearErrors
  117. GetDLLVersion "D3DCompiler_34.dll" $R0 $R1
  118. IfErrors dxMissing34 dxOK
  119. dxMissing34:
  120. ClearErrors
  121. GetDLLVersion "D3DCompiler_35.dll" $R0 $R1
  122. IfErrors dxMissing35 dxOK
  123. dxMissing35:
  124. ClearErrors
  125. GetDLLVersion "D3DCompiler_36.dll" $R0 $R1
  126. IfErrors dxMissing36 dxOK
  127. dxMissing36:
  128. ClearErrors
  129. GetDLLVersion "D3DCompiler_37.dll" $R0 $R1
  130. IfErrors dxMissing37 dxOK
  131. dxMissing37:
  132. ClearErrors
  133. GetDLLVersion "D3DCompiler_38.dll" $R0 $R1
  134. IfErrors dxMissing38 dxOK
  135. dxMissing38:
  136. ClearErrors
  137. GetDLLVersion "D3DCompiler_39.dll" $R0 $R1
  138. IfErrors dxMissing39 dxOK
  139. dxMissing39:
  140. ClearErrors
  141. GetDLLVersion "D3DCompiler_40.dll" $R0 $R1
  142. IfErrors dxMissing40 dxOK
  143. dxMissing40:
  144. ClearErrors
  145. GetDLLVersion "D3DCompiler_41.dll" $R0 $R1
  146. IfErrors dxMissing41 dxOK
  147. dxMissing41:
  148. ClearErrors
  149. GetDLLVersion "D3DCompiler_42.dll" $R0 $R1
  150. IfErrors dxMissing42 dxOK
  151. dxMissing42:
  152. ClearErrors
  153. GetDLLVersion "D3DCompiler_43.dll" $R0 $R1
  154. IfErrors dxMissing43 dxOK
  155. dxMissing43:
  156. ClearErrors
  157. GetDLLVersion "D3DCompiler_47.dll" $R0 $R1
  158. IfErrors dxMissing47 dxOK
  159. dxMissing47:
  160. MessageBox MB_YESNO|MB_ICONEXCLAMATION "Your system is missing DirectX components that ${APPNAME} requires. Would you like to download them?" IDYES dxtrue IDNO dxfalse
  161. dxtrue:
  162. ExecShell "open" "https://obsproject.com/go/dxwebsetup"
  163. dxfalse:
  164. Quit
  165. dxOK:
  166. ClearErrors
  167. ; Check previous instance
  168. OBSInstallerUtils::IsProcessRunning "obs32.exe"
  169. IntCmp $R0 1 0 notRunning1
  170. MessageBox MB_OK|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDOK
  171. Quit
  172. notRunning1:
  173. ${if} ${RunningX64}
  174. OBSInstallerUtils::IsProcessRunning "obs64.exe"
  175. IntCmp $R0 1 0 notRunning2
  176. MessageBox MB_OK|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDOK
  177. Quit
  178. notRunning2:
  179. ${endif}
  180. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-capture\graphics-hook32.dll"
  181. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-capture\graphics-hook64.dll"
  182. OBSInstallerUtils::GetAppNameForInUseFiles
  183. StrCmp $R0 "" gameCaptureNotRunning
  184. 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
  185. Quit
  186. gameCaptureNotRunning:
  187. FunctionEnd
  188. Function filesInUse
  189. 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
  190. FunctionEnd
  191. Function LaunchOBS
  192. ${if} ${RunningX64}
  193. Exec '"$WINDIR\explorer.exe" "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk"'
  194. ${else}
  195. Exec '"$WINDIR\explorer.exe" "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk"'
  196. ${endif}
  197. FunctionEnd
  198. Var outputErrors
  199. Section "OBS Studio" SecCore
  200. ; Set Section properties
  201. SectionIn RO
  202. SetOverwrite on
  203. AllowSkipFiles off
  204. SetShellVarContext all
  205. ; Set Section Files and Shortcuts
  206. SetOutPath "$INSTDIR"
  207. OBSInstallerUtils::KillProcess "obs-plugins\32bit\cef-bootstrap.exe"
  208. OBSInstallerUtils::KillProcess "obs-plugins\64bit\cef-bootstrap.exe"
  209. File /r "new\core\data"
  210. SetOutPath "$INSTDIR\bin"
  211. File /r "new\core\bin\32bit"
  212. SetOutPath "$INSTDIR\obs-plugins"
  213. File /r "new\core\obs-plugins\32bit"
  214. ${if} ${RunningX64}
  215. SetOutPath "$INSTDIR\bin"
  216. File /r "new\core\bin\64bit"
  217. SetOutPath "$INSTDIR\obs-plugins"
  218. File /r "new\core\obs-plugins\64bit"
  219. ${endif}
  220. ClearErrors
  221. IfErrors 0 +2
  222. StrCpy $outputErrors "yes"
  223. WriteUninstaller "$INSTDIR\uninstall.exe"
  224. ; Delete Old "Multiplatform" Shortcuts
  225. Delete "$DESKTOP\OBS Multiplatform.lnk"
  226. Delete "$SMPROGRAMS\OBS Multiplatform\OBS Multiplatform (32bit).lnk"
  227. Delete "$SMPROGRAMS\OBS Multiplatform\Uninstall.lnk"
  228. ${if} ${RunningX64}
  229. Delete "$SMPROGRAMS\OBS Multiplatform\OBS Multiplatform (64bit).lnk"
  230. ${endif}
  231. ${if} ${RunningX64}
  232. SetOutPath "$INSTDIR\bin\64bit"
  233. CreateShortCut "$DESKTOP\OBS Studio.lnk" "$INSTDIR\bin\64bit\obs64.exe"
  234. ${else}
  235. SetOutPath "$INSTDIR\bin\32bit"
  236. CreateShortCut "$DESKTOP\OBS Studio.lnk" "$INSTDIR\bin\32bit\obs32.exe"
  237. ${endif}
  238. SetOutPath "$INSTDIR\bin\32bit"
  239. CreateDirectory "$SMPROGRAMS\OBS Studio"
  240. CreateShortCut "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk" "$INSTDIR\bin\32bit\obs32.exe"
  241. CreateShortCut "$SMPROGRAMS\OBS Studio\Uninstall.lnk" "$INSTDIR\uninstall.exe"
  242. ${if} ${RunningX64}
  243. SetOutPath "$INSTDIR\bin\64bit"
  244. CreateShortCut "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk" "$INSTDIR\bin\64bit\obs64.exe"
  245. ${endif}
  246. SetOutPath "$INSTDIR\bin\32bit"
  247. StrCmp $outputErrors "yes" 0 +2
  248. Call filesInUse
  249. SectionEnd
  250. !ifdef FULL
  251. SectionGroup /e "Plugins" SecPlugins
  252. Section "Browser Source" SecPlugins_Browser
  253. ; Set Section properties
  254. SetOverwrite on
  255. AllowSkipFiles off
  256. SetShellVarContext all
  257. SetOutPath "$INSTDIR\obs-plugins"
  258. OBSInstallerUtils::KillProcess "32bit\cef-bootstrap.exe"
  259. File /r "new\obs-browser\obs-plugins\32bit"
  260. ${if} ${RunningX64}
  261. OBSInstallerUtils::KillProcess "64bit\cef-bootstrap.exe"
  262. File /r "new\obs-browser\obs-plugins\64bit"
  263. ${endif}
  264. SetOutPath "$INSTDIR\bin\32bit"
  265. SectionEnd
  266. !ifdef REALSENSE_PLUGIN
  267. Section /o "Realsense Source" SecPlugins_Realsense
  268. SetOverwrite on
  269. AllowSkipFiles off
  270. SetShellVarContext all
  271. SetOutPath "$INSTDIR\obs-plugins"
  272. File /r "new\realsense\obs-plugins\32bit"
  273. ${if} ${RunningX64}
  274. File /r "new\realsense\obs-plugins\64bit"
  275. ${endif}
  276. SetOutPath "$INSTDIR\data\obs-plugins"
  277. File /r "new\realsense\data\obs-plugins\win-ivcam"
  278. ExecWait '"$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" /UnregServer'
  279. ExecWait '"$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" /RegServer'
  280. ReadRegStr $0 HKLM "Software\Intel\RSSDK\Dispatch" "Core"
  281. ${if} ${Errors}
  282. ReadRegStr $0 HKLM "Software\Intel\RSSDK\v10\Dispatch" "Core"
  283. ${endif}
  284. ${if} ${Errors}
  285. InitPluginsDir
  286. SetOutPath "$PLUGINSDIR\realsense"
  287. File "intel_rs_sdk_runtime_websetup_10.0.26.0396.exe"
  288. ExecWait '"$PLUGINSDIR\realsense\intel_rs_sdk_runtime_websetup_10.0.26.0396.exe" --finstall=personify --fnone=all'
  289. ${endif}
  290. SetOutPath "$INSTDIR\bin\32bit"
  291. SectionEnd
  292. !endif
  293. SectionGroupEnd
  294. !endif
  295. Section -FinishSection
  296. WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
  297. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
  298. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
  299. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "ProductID" "d16d2409-3151-4331-a9b1-dfd8cf3f0d9c"
  300. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\bin\32bit\obs32.exe"
  301. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "OBS Project"
  302. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "HelpLink" "https://obsproject.com"
  303. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${APPVERSION}"
  304. SectionEnd
  305. ; Modern install component descriptions
  306. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  307. !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "Core OBS Studio files"
  308. !ifdef FULL
  309. !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Optional Plugins"
  310. !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins_Browser} "Browser plugin (a source you can add to your scenes that displays web pages)"
  311. !ifdef REALSENSE_PLUGIN
  312. !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins_Realsense} "Plugin for Realsense cameras"
  313. !endif
  314. !endif
  315. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  316. ;Uninstall section
  317. Section "un.obs-studio Program Files" UninstallSection1
  318. SectionIn RO
  319. ;Remove from registry...
  320. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
  321. DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
  322. ; Delete self
  323. Delete "$INSTDIR\uninstall.exe"
  324. ; Delete Shortcuts
  325. Delete "$DESKTOP\OBS Studio.lnk"
  326. Delete "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk"
  327. Delete "$SMPROGRAMS\OBS Studio\Uninstall.lnk"
  328. ${if} ${RunningX64}
  329. Delete "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk"
  330. ${endif}
  331. IfFileExists "$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" UnregisterSegService SkipUnreg
  332. UnregisterSegService:
  333. ExecWait '"$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" /UnregServer'
  334. SkipUnreg:
  335. ; Clean up OBS Studio
  336. RMDir /r "$INSTDIR\bin"
  337. RMDir /r "$INSTDIR\data"
  338. RMDir /r "$INSTDIR\obs-plugins"
  339. RMDir "$INSTDIR"
  340. ; Remove remaining directories
  341. RMDir "$SMPROGRAMS\OBS Studio"
  342. RMDir "$INSTDIR\OBS Studio"
  343. SectionEnd
  344. Section /o "un.User Settings" UninstallSection2
  345. RMDir /R "$APPDATA\obs-studio"
  346. SectionEnd
  347. !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
  348. !insertmacro MUI_DESCRIPTION_TEXT ${UninstallSection1} "Remove the OBS program files."
  349. !insertmacro MUI_DESCRIPTION_TEXT ${UninstallSection2} "Removes all settings, plugins, scenes and sources, profiles, log files and other application data."
  350. !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
  351. ; Version information
  352. VIProductVersion "${APPVERSION}.0"
  353. VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "OBS Studio"
  354. VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "obsproject.com"
  355. VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "(c) 2012-2016"
  356. ; FileDescription is what shows in the UAC elevation prompt when signed
  357. VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "OBS Studio"
  358. VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.0"
  359. ; eof