Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 18 additions & 27 deletions extra/nsis/mp-installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ManifestDPIAware true
!define APPNAME "OBS Studio"

!ifndef APPVERSION
!define APPVERSION "28.0.0"
!define SHORTVERSION "28.0.0"
!define APPVERSION "31.0.0"
!define SHORTVERSION "31.0.0"
!endif

!define APPNAMEANDVERSION "${APPNAME} ${SHORTVERSION}"
Expand Down Expand Up @@ -300,16 +300,17 @@ Section "OBS Studio" SecCore

WriteUninstaller "$INSTDIR\uninstall.exe"

SetOutPath "$INSTDIR\bin\64bit"
CreateShortCut "$DESKTOP\OBS Studio.lnk" "$INSTDIR\bin\64bit\obs64.exe"

SetOutPath "$INSTDIR\bin\64bit"
CreateShortCut "$SMPROGRAMS\OBS Studio.lnk" "$INSTDIR\bin\64bit\obs64.exe"

; Delete old Start Menu shortcuts if installing upon an older version
Delete "$SMPROGRAMS\OBS Studio\OBS Studio (64bit).lnk"
Delete "$SMPROGRAMS\OBS Studio\Uninstall.lnk"
RMDir "$SMPROGRAMS\OBS Studio"

SetOutPath "$INSTDIR\bin\64bit"
CreateShortCut "$DESKTOP\OBS Studio.lnk" "$INSTDIR\bin\64bit\obs64.exe"

SetOutPath "$INSTDIR\bin\64bit"
CreateShortCut "$SMPROGRAMS\OBS Studio.lnk" "$INSTDIR\bin\64bit\obs64.exe"
SectionEnd

Section -FinishSection
Expand Down Expand Up @@ -366,7 +367,6 @@ Section -FinishSection
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
Expand All @@ -388,20 +388,18 @@ Section "un.${APPNAME} App Files" UninstallSection1
SetRegView 32
DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan32.json"
DeleteRegValue HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan32.json"
${if} ${RunningX64}
SetRegView 64
DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json"
DeleteRegValue HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json"
${endif}

SetRegView 64
DeleteRegValue HKCU "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json"
DeleteRegValue HKLM "Software\Khronos\Vulkan\ImplicitLayers" "$APPDATA\obs-studio-hook\obs-vulkan64.json"

SetRegView default
SetShellVarContext current
ClearErrors

; Unregister virtual camera dlls
Exec '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module32.dll"'
${if} ${RunningX64}
Exec '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"'
${endif}
Exec '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\data\obs-plugins\win-dshow\obs-virtualcam-module64.dll"'

; Remove from registry...
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
Expand All @@ -412,24 +410,17 @@ Section "un.${APPNAME} App Files" UninstallSection1

; Delete Shortcuts
SetShellVarContext all
Delete "$SMPROGRAMS\OBS Studio.lnk"
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"
Delete "$SMPROGRAMS\OBS Studio.lnk"
${endif}
RMDir /r "$SMPROGRAMS\OBS Studio"
SetShellVarContext current

; Clean up OBS Studio
RMDir /r "$INSTDIR\bin"
RMDir /r "$INSTDIR\data"
RMDir /r "$INSTDIR\obs-plugins"
RMDir /r "$INSTDIR\OBS Studio"
RMDir "$INSTDIR"

; Remove remaining directories
RMDir "$SMPROGRAMS\OBS Studio"
RMDir "$INSTDIR\OBS Studio"
SectionEnd

Section /o "un.Settings, Scenes, etc." UninstallSection2
Expand All @@ -445,7 +436,7 @@ SectionEnd
VIProductVersion "${APPVERSION}.0"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APPNAME}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "OBS Project"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "(C) 2012-2021"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "(C) 2012-2025"
; FileDescription is what shows in the UAC elevation prompt when signed
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APPNAME} Installer"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APPVERSION}"
Expand Down
Loading