mp-installer.nsi 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. ;
  2. ; NSIS Installer Script for OBS Studio, https://obsproject.com/
  3. ;
  4. ; This installer script is designed only for the release process
  5. ; of OBS Studio. It requires a lot of files to be in exactly the
  6. ; right places. If you're making a fork, it's strongly suggested
  7. ; that you make your own installer.
  8. ;
  9. ; If you choose to use this script anyway, be absolutely sure you
  10. ; have replaced every OBS specific check, whether process names,
  11. ; application names, files, registry entries, etc.
  12. ;
  13. ; To auto-install required Visual C++ components, download from
  14. ; https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0
  15. ; and copy to this directory (UI/installer/)
  16. ;
  17. ; This script also requires OBSInstallerUtils for additional
  18. ; functions. You can find it at
  19. ; https://github.com/notr1ch/OBSInstallerUtils
  20. Unicode true
  21. ManifestDPIAware true
  22. ; Define your application name
  23. !define APPNAME "OBS Studio"
  24. !ifndef APPVERSION
  25. !define APPVERSION "25.0.8"
  26. !define SHORTVERSION "25.0.8"
  27. !endif
  28. !define APPNAMEANDVERSION "${APPNAME} ${SHORTVERSION}"
  29. ; Additional script dependencies
  30. !include WinVer.nsh
  31. !include x64.nsh
  32. ; Main Install settings
  33. Name "${APPNAMEANDVERSION}"
  34. !ifdef INSTALL64
  35. InstallDir "$PROGRAMFILES64\obs-studio"
  36. !else
  37. InstallDir "$PROGRAMFILES32\obs-studio"
  38. !endif
  39. InstallDirRegKey HKLM "Software\${APPNAME}" ""
  40. !ifdef INSTALL64
  41. OutFile "OBS-Studio-${SHORTVERSION}-Full-Installer-x64.exe"
  42. !else
  43. OutFile "OBS-Studio-${SHORTVERSION}-Full-Installer-x86.exe"
  44. !endif
  45. ; Use compression
  46. SetCompressor /SOLID LZMA
  47. ; Need Admin
  48. RequestExecutionLevel admin
  49. ; Modern interface settings
  50. !include "MUI.nsh"
  51. !define MUI_ICON "..\..\cmake\winrc\obs-studio.ico"
  52. !define MUI_HEADERIMAGE_BITMAP "OBSHeader.bmp"
  53. !define MUI_WELCOMEFINISHPAGE_BITMAP "OBSBanner.bmp"
  54. !define MUI_ABORTWARNING
  55. !define MUI_FINISHPAGE_TITLE "Completed Setup"
  56. !define MUI_FINISHPAGE_RUN
  57. !define MUI_FINISHPAGE_RUN_TEXT "Launch ${APPNAMEANDVERSION}"
  58. !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchOBS"
  59. !define MUI_FINISHPAGE_SHOWREADME "https://github.com/obsproject/obs-studio/releases/${APPVERSION}"
  60. !define MUI_FINISHPAGE_SHOWREADME_TEXT "View Release Notes"
  61. !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
  62. !define MUI_FINISHPAGE_LINK "New to OBS? Check out our 4-step Quickstart Guide."
  63. !define MUI_FINISHPAGE_LINK_LOCATION "https://obsproject.com/wiki/OBS-Studio-Quickstart"
  64. !define MUI_FINISHPAGE_LINK_COLOR 000080
  65. !define MUI_WELCOMEPAGE_TEXT "This setup will guide you through installing OBS Studio.\n\nIt is recommended that you close all other applications before starting, including OBS Studio. This will make it possible to update relevant files without having to reboot your computer.\n\nClick Next to continue."
  66. !define MUI_PAGE_CUSTOMFUNCTION_LEAVE PreReqCheck
  67. !define MUI_HEADERIMAGE
  68. !define MUI_PAGE_HEADER_TEXT "License Information"
  69. !define MUI_PAGE_HEADER_SUBTEXT "Please review the license terms before installing OBS Studio."
  70. !define MUI_LICENSEPAGE_TEXT_TOP "Press Page Down or scroll to see the rest of the license."
  71. !define MUI_LICENSEPAGE_TEXT_BOTTOM " "
  72. !define MUI_LICENSEPAGE_BUTTON "&Next >"
  73. !insertmacro MUI_PAGE_WELCOME
  74. !insertmacro MUI_PAGE_LICENSE "new\core\data\obs-studio\license\gplv2.txt"
  75. !insertmacro MUI_PAGE_DIRECTORY
  76. !insertmacro MUI_PAGE_INSTFILES
  77. !insertmacro MUI_PAGE_FINISH
  78. !define MUI_COMPONENTSPAGE_TEXT_TOP "Check the components you want to uninstall. Keeping Settings unchecked is recommended."
  79. !define MUI_COMPONENTSPAGE_TEXT_COMPLIST "Select components:"
  80. ;!insertmacro MUI_UNPAGE_CONFIRM
  81. !insertmacro MUI_UNPAGE_COMPONENTS
  82. !insertmacro MUI_UNPAGE_INSTFILES
  83. ; Set languages (first is default language)
  84. !insertmacro MUI_LANGUAGE "English"
  85. !insertmacro MUI_RESERVEFILE_LANGDLL
  86. Function PreReqCheck
  87. !ifdef INSTALL64
  88. ${if} ${RunningX64}
  89. ${Else}
  90. IfSilent +1 +3
  91. SetErrorLevel 3
  92. Quit
  93. MessageBox MB_OK|MB_ICONSTOP "This version of ${APPNAME} is not compatible with your system. Please use the 32bit (x86) installer."
  94. ${EndIf}
  95. ; Abort on XP or lower
  96. !endif
  97. ${If} ${AtMostWinVista}
  98. IfSilent +1 +3
  99. SetErrorLevel 3
  100. Quit
  101. 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."
  102. Quit
  103. ${EndIf}
  104. ; DirectX Version Check
  105. ClearErrors
  106. GetDLLVersion "D3DCompiler_33.dll" $R0 $R1
  107. IfErrors dxMissing33 dxOK
  108. dxMissing33:
  109. ClearErrors
  110. GetDLLVersion "D3DCompiler_34.dll" $R0 $R1
  111. IfErrors dxMissing34 dxOK
  112. dxMissing34:
  113. ClearErrors
  114. GetDLLVersion "D3DCompiler_35.dll" $R0 $R1
  115. IfErrors dxMissing35 dxOK
  116. dxMissing35:
  117. ClearErrors
  118. GetDLLVersion "D3DCompiler_36.dll" $R0 $R1
  119. IfErrors dxMissing36 dxOK
  120. dxMissing36:
  121. ClearErrors
  122. GetDLLVersion "D3DCompiler_37.dll" $R0 $R1
  123. IfErrors dxMissing37 dxOK
  124. dxMissing37:
  125. ClearErrors
  126. GetDLLVersion "D3DCompiler_38.dll" $R0 $R1
  127. IfErrors dxMissing38 dxOK
  128. dxMissing38:
  129. ClearErrors
  130. GetDLLVersion "D3DCompiler_39.dll" $R0 $R1
  131. IfErrors dxMissing39 dxOK
  132. dxMissing39:
  133. ClearErrors
  134. GetDLLVersion "D3DCompiler_40.dll" $R0 $R1
  135. IfErrors dxMissing40 dxOK
  136. dxMissing40:
  137. ClearErrors
  138. GetDLLVersion "D3DCompiler_41.dll" $R0 $R1
  139. IfErrors dxMissing41 dxOK
  140. dxMissing41:
  141. ClearErrors
  142. GetDLLVersion "D3DCompiler_42.dll" $R0 $R1
  143. IfErrors dxMissing42 dxOK
  144. dxMissing42:
  145. ClearErrors
  146. GetDLLVersion "D3DCompiler_43.dll" $R0 $R1
  147. IfErrors dxMissing43 dxOK
  148. dxMissing43:
  149. ClearErrors
  150. GetDLLVersion "D3DCompiler_47.dll" $R0 $R1
  151. IfErrors dxMissing47 dxOK
  152. dxMissing47:
  153. ClearErrors
  154. GetDLLVersion "D3DCompiler_49.dll" $R0 $R1
  155. IfErrors dxMissing49 dxOK
  156. dxMissing49:
  157. IfSilent +1 +3
  158. SetErrorLevel 4
  159. Quit
  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. check32BitRunning:
  169. OBSInstallerUtils::IsProcessRunning "obs32.exe"
  170. IntCmp $R0 1 0 notRunning1
  171. IfSilent +1 +3
  172. SetErrorLevel 5
  173. Quit
  174. MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDCANCEL IDRETRY check32BitRunning
  175. Quit
  176. notRunning1:
  177. ${if} ${RunningX64}
  178. check64BitRunning:
  179. OBSInstallerUtils::IsProcessRunning "obs64.exe"
  180. IntCmp $R0 1 0 notRunning2
  181. IfSilent +1 +3
  182. SetErrorLevel 5
  183. Quit
  184. MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDCANCEL IDRETRY check64BitRunning
  185. Quit
  186. notRunning2:
  187. ${endif}
  188. FunctionEnd
  189. Var dllFilesInUse
  190. Function checkDLLs
  191. OBSInstallerUtils::ResetInUseFileChecks
  192. !ifdef INSTALL64
  193. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\bin\64bit\avutil-56.dll"
  194. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\bin\64bit\swscale-5.dll"
  195. !else
  196. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\bin\32bit\avutil-56.dll"
  197. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\bin\32bit\swscale-5.dll"
  198. !endif
  199. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-capture\graphics-hook32.dll"
  200. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-capture\graphics-hook64.dll"
  201. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll"
  202. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"
  203. OBSInstallerUtils::AddInUseFileCheck "$APPDATA\obs-studio-hook\graphics-hook32.dll"
  204. OBSInstallerUtils::AddInUseFileCheck "$APPDATA\obs-studio-hook\graphics-hook64.dll"
  205. OBSInstallerUtils::GetAppNameForInUseFiles
  206. StrCpy $dllFilesInUse "$R0"
  207. FunctionEnd
  208. Function checkFilesInUse
  209. retryFileChecks:
  210. Call checkDLLs
  211. StrCmp $dllFilesInUse "" dllsNotInUse
  212. IfSilent +1 +3
  213. SetErrorLevel 6
  214. Quit
  215. 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
  216. Quit
  217. dllsNotInUse:
  218. FunctionEnd
  219. Function LaunchOBS
  220. !ifdef INSTALL64
  221. Exec '"$WINDIR\explorer.exe" "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk"'
  222. !else
  223. Exec '"$WINDIR\explorer.exe" "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk"'
  224. !endif
  225. FunctionEnd
  226. Section "OBS Studio" SecCore
  227. SetShellVarContext all
  228. Call checkFilesInUse
  229. ; Set Section properties
  230. SectionIn RO
  231. SetOverwrite on
  232. AllowSkipFiles off
  233. ; Set Section Files and Shortcuts
  234. SetOutPath "$INSTDIR"
  235. OBSInstallerUtils::KillProcess "obs-plugins\32bit\cef-bootstrap.exe"
  236. OBSInstallerUtils::KillProcess "obs-plugins\64bit\cef-bootstrap.exe"
  237. File /r "new\core\data"
  238. !ifdef INSTALL64
  239. SetOutPath "$INSTDIR\bin"
  240. File /r "new\core\bin\64bit"
  241. SetOutPath "$INSTDIR\obs-plugins"
  242. File /r "new\core\obs-plugins\64bit"
  243. !else
  244. SetOutPath "$INSTDIR\bin"
  245. File /r "new\core\bin\32bit"
  246. SetOutPath "$INSTDIR\obs-plugins"
  247. File /r "new\core\obs-plugins\32bit"
  248. !endif
  249. !ifdef INSTALL64
  250. ; 64 bit Visual Studio 2019 runtime check
  251. ClearErrors
  252. SetOutPath "$PLUGINSDIR"
  253. File check_for_64bit_visual_studio_2019_runtimes.exe
  254. ExecWait "$PLUGINSDIR\check_for_64bit_visual_studio_2019_runtimes.exe" $R0
  255. Delete "$PLUGINSDIR\check_for_64bit_visual_studio_2019_runtimes.exe"
  256. IntCmp $R0 126 vs2019Missing_64 vs2019OK_64
  257. vs2019Missing_64:
  258. File VC_redist.x64.exe
  259. ExecWait '"$PLUGINSDIR\VC_redist.x64.exe" /quiet /norestart'
  260. Delete "$PLUGINSDIR\VC_redist.x64.exe"
  261. vs2019OK_64:
  262. ClearErrors
  263. !else
  264. ; 32 bit Visual Studio 2019 runtime check
  265. ClearErrors
  266. SetOutPath "$PLUGINSDIR"
  267. GetDLLVersion "vcruntime140.DLL" $R0 $R1
  268. GetDLLVersion "msvcp140.DLL" $R0 $R1
  269. GetDLLVersion "msvcp140_1.DLL" $R0 $R1
  270. IfErrors vs2019Missing_32 vs2019OK_32
  271. vs2019Missing_32:
  272. File VC_redist.x86.exe
  273. ExecWait '"$PLUGINSDIR\VC_redist.x86.exe" /quiet /norestart'
  274. Delete "$PLUGINSDIR\VC_redist.x86.exe"
  275. vs2019OK_32:
  276. ClearErrors
  277. !endif
  278. # ----------------------------
  279. SetShellVarContext all
  280. SetOutPath "$INSTDIR"
  281. File /r "new\obs-browser\data"
  282. SetOutPath "$INSTDIR\obs-plugins"
  283. OBSInstallerUtils::KillProcess "32bit\cef-bootstrap.exe"
  284. OBSInstallerUtils::KillProcess "32bit\obs-browser-page.exe"
  285. ${if} ${RunningX64}
  286. OBSInstallerUtils::KillProcess "64bit\cef-bootstrap.exe"
  287. OBSInstallerUtils::KillProcess "64bit\obs-browser-page.exe"
  288. ${endif}
  289. !ifdef INSTALL64
  290. File /r "new\obs-browser\obs-plugins\64bit"
  291. SetOutPath "$INSTDIR\bin\64bit"
  292. !else
  293. File /r "new\obs-browser\obs-plugins\32bit"
  294. SetOutPath "$INSTDIR\bin\32bit"
  295. !endif
  296. # ----------------------------
  297. # Copy game capture files to ProgramData
  298. SetOutPath "$APPDATA\obs-studio-hook"
  299. File "new\core\data\obs-plugins\win-capture\graphics-hook32.dll"
  300. File "new\core\data\obs-plugins\win-capture\graphics-hook64.dll"
  301. File "new\core\data\obs-plugins\win-capture\obs-vulkan32.json"
  302. File "new\core\data\obs-plugins\win-capture\obs-vulkan64.json"
  303. OBSInstallerUtils::AddAllApplicationPackages "$APPDATA\obs-studio-hook"
  304. WriteUninstaller "$INSTDIR\uninstall.exe"
  305. !ifdef INSTALL64
  306. SetOutPath "$INSTDIR\bin\64bit"
  307. CreateShortCut "$DESKTOP\OBS Studio.lnk" "$INSTDIR\bin\64bit\obs64.exe"
  308. !else
  309. SetOutPath "$INSTDIR\bin\32bit"
  310. CreateShortCut "$DESKTOP\OBS Studio.lnk" "$INSTDIR\bin\32bit\obs32.exe"
  311. !endif
  312. CreateDirectory "$SMPROGRAMS\OBS Studio"
  313. !ifdef INSTALL64
  314. SetOutPath "$INSTDIR\bin\64bit"
  315. CreateShortCut "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk" "$INSTDIR\bin\64bit\obs64.exe"
  316. !else
  317. SetOutPath "$INSTDIR\bin\32bit"
  318. CreateDirectory "$SMPROGRAMS\OBS Studio"
  319. CreateShortCut "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk" "$INSTDIR\bin\32bit\obs32.exe"
  320. !endif
  321. CreateShortCut "$SMPROGRAMS\OBS Studio\Uninstall.lnk" "$INSTDIR\uninstall.exe"
  322. SectionEnd
  323. Section -FinishSection
  324. SetShellVarContext all
  325. # ---------------------------------------
  326. # 64bit vulkan hook registry stuff
  327. ${if} ${RunningX64}
  328. SetRegView 64
  329. WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
  330. ClearErrors
  331. DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json"
  332. ClearErrors
  333. WriteRegDWORD HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json" 0
  334. ${endif}
  335. # ---------------------------------------
  336. # 32bit vulkan hook registry stuff
  337. SetRegView 32
  338. WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
  339. ClearErrors
  340. DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan32.json"
  341. ClearErrors
  342. WriteRegDWORD HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan32.json" 0
  343. # ---------------------------------------
  344. # Register virtual camera dlls
  345. Exec '"$SYSDIR\regsvr32.exe" /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll"'
  346. ${if} ${RunningX64}
  347. Exec '"$SYSDIR\regsvr32.exe" /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"'
  348. ${endif}
  349. # ---------------------------------------
  350. ClearErrors
  351. SetRegView default
  352. WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
  353. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
  354. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
  355. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "ProductID" "d16d2409-3151-4331-a9b1-dfd8cf3f0d9c"
  356. !ifdef INSTALL64
  357. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\bin\64bit\obs64.exe"
  358. !else
  359. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\bin\32bit\obs32.exe"
  360. !endif
  361. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "OBS Project"
  362. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "HelpLink" "https://obsproject.com"
  363. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${APPVERSION}"
  364. SectionEnd
  365. ; Modern install component descriptions
  366. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  367. !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "Core OBS Studio files"
  368. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  369. ;Uninstall section
  370. Section "un.${APPNAME} App Files" UninstallSection1
  371. SectionIn RO
  372. ; Remove hook files and vulkan registry
  373. SetShellVarContext all
  374. RMDir /r "$APPDATA\obs-studio-hook"
  375. SetRegView 32
  376. DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan32.json"
  377. DeleteRegValue HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan32.json"
  378. ${if} ${RunningX64}
  379. SetRegView 64
  380. DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json"
  381. DeleteRegValue HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json"
  382. ${endif}
  383. SetRegView default
  384. SetShellVarContext current
  385. ClearErrors
  386. ; Unregister virtual camera dlls
  387. Exec '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll"'
  388. ${if} ${RunningX64}
  389. Exec '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"'
  390. ${endif}
  391. ; Remove from registry...
  392. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
  393. DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
  394. ; Delete self
  395. Delete "$INSTDIR\uninstall.exe"
  396. ; Delete Shortcuts
  397. SetShellVarContext all
  398. Delete "$DESKTOP\OBS Studio.lnk"
  399. Delete "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk"
  400. Delete "$SMPROGRAMS\OBS Studio\Uninstall.lnk"
  401. ${if} ${RunningX64}
  402. Delete "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk"
  403. ${endif}
  404. SetShellVarContext current
  405. IfFileExists "$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" UnregisterSegService SkipUnreg
  406. UnregisterSegService:
  407. ExecWait '"$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" /UnregServer'
  408. SkipUnreg:
  409. ; Clean up OBS Studio
  410. RMDir /r "$INSTDIR\bin"
  411. RMDir /r "$INSTDIR\data"
  412. RMDir /r "$INSTDIR\obs-plugins"
  413. RMDir "$INSTDIR"
  414. ; Remove remaining directories
  415. RMDir "$SMPROGRAMS\OBS Studio"
  416. RMDir "$INSTDIR\OBS Studio"
  417. SectionEnd
  418. Section /o "un.Settings, Scenes, etc." UninstallSection2
  419. RMDir /r "$APPDATA\obs-studio"
  420. SectionEnd
  421. !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
  422. !insertmacro MUI_DESCRIPTION_TEXT ${UninstallSection1} "Remove the OBS program files."
  423. !insertmacro MUI_DESCRIPTION_TEXT ${UninstallSection2} "Removes all settings, scenes, sources, profiles, log files, and other application data.$\r$\n$\r$\nTHIS CANNOT BE UNDONE."
  424. !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
  425. ; Version information
  426. VIProductVersion "${APPVERSION}.0"
  427. VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APPNAME}"
  428. VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "OBS Project"
  429. VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "(C) 2012-2021"
  430. ; FileDescription is what shows in the UAC elevation prompt when signed
  431. VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APPNAME} Installer"
  432. VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APPVERSION}"
  433. ; eof