mp-installer.nsi 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  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 "28.0.0"
  26. !define SHORTVERSION "28.0.0"
  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 "${APPNAME} is not compatible with your operating system's architecture."
  94. ${EndIf}
  95. ; Abort on 8.1 or lower
  96. !endif
  97. ${If} ${AtLeastWin10}
  98. ${Else}
  99. IfSilent +1 +3
  100. SetErrorLevel 3
  101. Quit
  102. MessageBox MB_OK|MB_ICONSTOP "${APPNAME} requires Windows 10 or higher and cannot be installed on this version of Windows."
  103. Quit
  104. ${EndIf}
  105. ; DirectX Version Check
  106. ClearErrors
  107. GetDLLVersion "D3DCompiler_33.dll" $R0 $R1
  108. IfErrors dxMissing33 dxOK
  109. dxMissing33:
  110. ClearErrors
  111. GetDLLVersion "D3DCompiler_34.dll" $R0 $R1
  112. IfErrors dxMissing34 dxOK
  113. dxMissing34:
  114. ClearErrors
  115. GetDLLVersion "D3DCompiler_35.dll" $R0 $R1
  116. IfErrors dxMissing35 dxOK
  117. dxMissing35:
  118. ClearErrors
  119. GetDLLVersion "D3DCompiler_36.dll" $R0 $R1
  120. IfErrors dxMissing36 dxOK
  121. dxMissing36:
  122. ClearErrors
  123. GetDLLVersion "D3DCompiler_37.dll" $R0 $R1
  124. IfErrors dxMissing37 dxOK
  125. dxMissing37:
  126. ClearErrors
  127. GetDLLVersion "D3DCompiler_38.dll" $R0 $R1
  128. IfErrors dxMissing38 dxOK
  129. dxMissing38:
  130. ClearErrors
  131. GetDLLVersion "D3DCompiler_39.dll" $R0 $R1
  132. IfErrors dxMissing39 dxOK
  133. dxMissing39:
  134. ClearErrors
  135. GetDLLVersion "D3DCompiler_40.dll" $R0 $R1
  136. IfErrors dxMissing40 dxOK
  137. dxMissing40:
  138. ClearErrors
  139. GetDLLVersion "D3DCompiler_41.dll" $R0 $R1
  140. IfErrors dxMissing41 dxOK
  141. dxMissing41:
  142. ClearErrors
  143. GetDLLVersion "D3DCompiler_42.dll" $R0 $R1
  144. IfErrors dxMissing42 dxOK
  145. dxMissing42:
  146. ClearErrors
  147. GetDLLVersion "D3DCompiler_43.dll" $R0 $R1
  148. IfErrors dxMissing43 dxOK
  149. dxMissing43:
  150. ClearErrors
  151. GetDLLVersion "D3DCompiler_47.dll" $R0 $R1
  152. IfErrors dxMissing47 dxOK
  153. dxMissing47:
  154. ClearErrors
  155. GetDLLVersion "D3DCompiler_49.dll" $R0 $R1
  156. IfErrors dxMissing49 dxOK
  157. dxMissing49:
  158. IfSilent +1 +3
  159. SetErrorLevel 4
  160. Quit
  161. MessageBox MB_YESNO|MB_ICONEXCLAMATION "Your system is missing DirectX components that ${APPNAME} requires. Would you like to download them?" IDYES dxtrue IDNO dxfalse
  162. dxtrue:
  163. ExecShell "open" "https://obsproject.com/go/dxwebsetup"
  164. dxfalse:
  165. Quit
  166. dxOK:
  167. ClearErrors
  168. ; Check previous instance
  169. check32BitRunning:
  170. OBSInstallerUtils::IsProcessRunning "obs32.exe"
  171. IntCmp $R0 1 0 notRunning1
  172. IfSilent +1 +3
  173. SetErrorLevel 5
  174. Quit
  175. MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDCANCEL IDRETRY check32BitRunning
  176. Quit
  177. notRunning1:
  178. ${if} ${RunningX64}
  179. check64BitRunning:
  180. OBSInstallerUtils::IsProcessRunning "obs64.exe"
  181. IntCmp $R0 1 0 notRunning2
  182. IfSilent +1 +3
  183. SetErrorLevel 5
  184. Quit
  185. MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${APPNAME} is already running. Please close it first before installing a new version." /SD IDCANCEL IDRETRY check64BitRunning
  186. Quit
  187. notRunning2:
  188. ${endif}
  189. FunctionEnd
  190. Var dllFilesInUse
  191. Function checkDLLs
  192. OBSInstallerUtils::ResetInUseFileChecks
  193. !ifdef INSTALL64
  194. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\bin\64bit\avutil-57.dll"
  195. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\bin\64bit\swscale-6.dll"
  196. !else
  197. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\bin\32bit\avutil-57.dll"
  198. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\bin\32bit\swscale-6.dll"
  199. !endif
  200. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-capture\graphics-hook32.dll"
  201. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-capture\graphics-hook64.dll"
  202. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll"
  203. OBSInstallerUtils::AddInUseFileCheck "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"
  204. OBSInstallerUtils::AddInUseFileCheck "$APPDATA\obs-studio-hook\graphics-hook32.dll"
  205. OBSInstallerUtils::AddInUseFileCheck "$APPDATA\obs-studio-hook\graphics-hook64.dll"
  206. OBSInstallerUtils::GetAppNameForInUseFiles
  207. StrCpy $dllFilesInUse "$R0"
  208. FunctionEnd
  209. Function checkFilesInUse
  210. retryFileChecks:
  211. Call checkDLLs
  212. StrCmp $dllFilesInUse "" dllsNotInUse
  213. IfSilent +1 +3
  214. SetErrorLevel 6
  215. Quit
  216. 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
  217. Quit
  218. dllsNotInUse:
  219. FunctionEnd
  220. Function LaunchOBS
  221. !ifdef INSTALL64
  222. Exec '"$WINDIR\explorer.exe" "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk"'
  223. !else
  224. Exec '"$WINDIR\explorer.exe" "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk"'
  225. !endif
  226. FunctionEnd
  227. Section "OBS Studio" SecCore
  228. SetShellVarContext all
  229. Call checkFilesInUse
  230. ; Set Section properties
  231. SectionIn RO
  232. SetOverwrite on
  233. AllowSkipFiles off
  234. ; Set Section Files and Shortcuts
  235. SetOutPath "$INSTDIR"
  236. File /r "new\core\data"
  237. !ifdef INSTALL64
  238. SetOutPath "$INSTDIR\bin"
  239. File /r "new\core\bin\64bit"
  240. SetOutPath "$INSTDIR\obs-plugins"
  241. File /r "new\core\obs-plugins\64bit"
  242. !else
  243. SetOutPath "$INSTDIR\bin"
  244. File /r "new\core\bin\32bit"
  245. SetOutPath "$INSTDIR\obs-plugins"
  246. File /r "new\core\obs-plugins\32bit"
  247. !endif
  248. !ifdef INSTALL64
  249. ; 64 bit Visual Studio 2019 runtime check
  250. ClearErrors
  251. SetOutPath "$PLUGINSDIR"
  252. File check_for_64bit_visual_studio_2019_runtimes.exe
  253. ExecWait "$PLUGINSDIR\check_for_64bit_visual_studio_2019_runtimes.exe" $R0
  254. Delete "$PLUGINSDIR\check_for_64bit_visual_studio_2019_runtimes.exe"
  255. IntCmp $R0 126 vs2019Missing_64 vs2019OK_64
  256. vs2019Missing_64:
  257. File VC_redist.x64.exe
  258. ExecWait '"$PLUGINSDIR\VC_redist.x64.exe" /quiet /norestart'
  259. Delete "$PLUGINSDIR\VC_redist.x64.exe"
  260. vs2019OK_64:
  261. ClearErrors
  262. !else
  263. ; 32 bit Visual Studio 2019 runtime check
  264. ClearErrors
  265. SetOutPath "$PLUGINSDIR"
  266. GetDLLVersion "vcruntime140.DLL" $R0 $R1
  267. GetDLLVersion "msvcp140.DLL" $R0 $R1
  268. GetDLLVersion "msvcp140_1.DLL" $R0 $R1
  269. IfErrors vs2019Missing_32 vs2019OK_32
  270. vs2019Missing_32:
  271. File VC_redist.x86.exe
  272. ExecWait '"$PLUGINSDIR\VC_redist.x86.exe" /quiet /norestart'
  273. Delete "$PLUGINSDIR\VC_redist.x86.exe"
  274. vs2019OK_32:
  275. ClearErrors
  276. !endif
  277. # ----------------------------
  278. SetShellVarContext all
  279. SetOutPath "$INSTDIR"
  280. File /r "new\obs-browser\data"
  281. SetOutPath "$INSTDIR\obs-plugins"
  282. OBSInstallerUtils::KillProcess "32bit\obs-browser-page.exe"
  283. ${if} ${RunningX64}
  284. OBSInstallerUtils::KillProcess "64bit\obs-browser-page.exe"
  285. ${endif}
  286. !ifdef INSTALL64
  287. File /r "new\obs-browser\obs-plugins\64bit"
  288. SetOutPath "$INSTDIR\bin\64bit"
  289. !else
  290. File /r "new\obs-browser\obs-plugins\32bit"
  291. SetOutPath "$INSTDIR\bin\32bit"
  292. !endif
  293. # ----------------------------
  294. # Copy game capture files to ProgramData
  295. SetOutPath "$APPDATA\obs-studio-hook"
  296. File "new\core\data\obs-plugins\win-capture\graphics-hook32.dll"
  297. File "new\core\data\obs-plugins\win-capture\graphics-hook64.dll"
  298. File "new\core\data\obs-plugins\win-capture\obs-vulkan32.json"
  299. File "new\core\data\obs-plugins\win-capture\obs-vulkan64.json"
  300. OBSInstallerUtils::AddAllApplicationPackages "$APPDATA\obs-studio-hook"
  301. WriteUninstaller "$INSTDIR\uninstall.exe"
  302. !ifdef INSTALL64
  303. SetOutPath "$INSTDIR\bin\64bit"
  304. CreateShortCut "$DESKTOP\OBS Studio.lnk" "$INSTDIR\bin\64bit\obs64.exe"
  305. !else
  306. SetOutPath "$INSTDIR\bin\32bit"
  307. CreateShortCut "$DESKTOP\OBS Studio.lnk" "$INSTDIR\bin\32bit\obs32.exe"
  308. !endif
  309. CreateDirectory "$SMPROGRAMS\OBS Studio"
  310. !ifdef INSTALL64
  311. SetOutPath "$INSTDIR\bin\64bit"
  312. CreateShortCut "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk" "$INSTDIR\bin\64bit\obs64.exe"
  313. !else
  314. SetOutPath "$INSTDIR\bin\32bit"
  315. CreateDirectory "$SMPROGRAMS\OBS Studio"
  316. CreateShortCut "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk" "$INSTDIR\bin\32bit\obs32.exe"
  317. !endif
  318. CreateShortCut "$SMPROGRAMS\OBS Studio\Uninstall.lnk" "$INSTDIR\uninstall.exe"
  319. SectionEnd
  320. Section -FinishSection
  321. SetShellVarContext all
  322. # ---------------------------------------
  323. # 64bit vulkan hook registry stuff
  324. ${if} ${RunningX64}
  325. SetRegView 64
  326. WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
  327. ClearErrors
  328. DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json"
  329. ClearErrors
  330. WriteRegDWORD HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json" 0
  331. ${endif}
  332. # ---------------------------------------
  333. # 32bit vulkan hook registry stuff
  334. SetRegView 32
  335. WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
  336. ClearErrors
  337. DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan32.json"
  338. ClearErrors
  339. WriteRegDWORD HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan32.json" 0
  340. # ---------------------------------------
  341. # Register virtual camera dlls
  342. Exec '"$SYSDIR\regsvr32.exe" /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll"'
  343. ${if} ${RunningX64}
  344. Exec '"$SYSDIR\regsvr32.exe" /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"'
  345. ${endif}
  346. # ---------------------------------------
  347. ClearErrors
  348. SetRegView default
  349. WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
  350. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
  351. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
  352. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "ProductID" "d16d2409-3151-4331-a9b1-dfd8cf3f0d9c"
  353. !ifdef INSTALL64
  354. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\bin\64bit\obs64.exe"
  355. !else
  356. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\bin\32bit\obs32.exe"
  357. !endif
  358. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "OBS Project"
  359. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "HelpLink" "https://obsproject.com"
  360. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${APPVERSION}"
  361. SectionEnd
  362. ; Modern install component descriptions
  363. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  364. !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "Core OBS Studio files"
  365. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  366. ;Uninstall section
  367. Section "un.${APPNAME} App Files" UninstallSection1
  368. SectionIn RO
  369. ; Remove hook files and vulkan registry
  370. SetShellVarContext all
  371. RMDir /r "$APPDATA\obs-studio-hook"
  372. SetRegView 32
  373. DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan32.json"
  374. DeleteRegValue HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan32.json"
  375. ${if} ${RunningX64}
  376. SetRegView 64
  377. DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json"
  378. DeleteRegValue HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json"
  379. ${endif}
  380. SetRegView default
  381. SetShellVarContext current
  382. ClearErrors
  383. ; Unregister virtual camera dlls
  384. Exec '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll"'
  385. ${if} ${RunningX64}
  386. Exec '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"'
  387. ${endif}
  388. ; Remove from registry...
  389. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
  390. DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
  391. ; Delete self
  392. Delete "$INSTDIR\uninstall.exe"
  393. ; Delete Shortcuts
  394. SetShellVarContext all
  395. Delete "$DESKTOP\OBS Studio.lnk"
  396. Delete "$SMPROGRAMS\OBS Studio\OBS Studio (32bit).lnk"
  397. Delete "$SMPROGRAMS\OBS Studio\Uninstall.lnk"
  398. ${if} ${RunningX64}
  399. Delete "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk"
  400. ${endif}
  401. SetShellVarContext current
  402. IfFileExists "$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" UnregisterSegService SkipUnreg
  403. UnregisterSegService:
  404. ExecWait '"$INSTDIR\data\obs-plugins\win-ivcam\seg_service.exe" /UnregServer'
  405. SkipUnreg:
  406. ; Clean up OBS Studio
  407. RMDir /r "$INSTDIR\bin"
  408. RMDir /r "$INSTDIR\data"
  409. RMDir /r "$INSTDIR\obs-plugins"
  410. RMDir "$INSTDIR"
  411. ; Remove remaining directories
  412. RMDir "$SMPROGRAMS\OBS Studio"
  413. RMDir "$INSTDIR\OBS Studio"
  414. SectionEnd
  415. Section /o "un.Settings, Scenes, etc." UninstallSection2
  416. RMDir /r "$APPDATA\obs-studio"
  417. SectionEnd
  418. !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
  419. !insertmacro MUI_DESCRIPTION_TEXT ${UninstallSection1} "Remove the OBS program files."
  420. !insertmacro MUI_DESCRIPTION_TEXT ${UninstallSection2} "Removes all settings, scenes, sources, profiles, log files, and other application data.$\r$\n$\r$\nTHIS CANNOT BE UNDONE."
  421. !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
  422. ; Version information
  423. VIProductVersion "${APPVERSION}.0"
  424. VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APPNAME}"
  425. VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "OBS Project"
  426. VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "(C) 2012-2021"
  427. ; FileDescription is what shows in the UAC elevation prompt when signed
  428. VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APPNAME} Installer"
  429. VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APPVERSION}"
  430. ; eof