-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathwin-spout-installer.nsi
133 lines (98 loc) · 4.31 KB
/
win-spout-installer.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
; Script generated with the Venis Install Wizard
Unicode True
; Define your application name
!define APPNAME "Spout 2 OBS Plugin"
!define APPVERSION "DebugVersion"
!define APPNAMEANDVERSION "Spout 2 OBS Plugin ${APPVERSION}"
; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
InstallDir "$PROGRAMFILES64\obs-studio"
OutFile "OBS_Spout2_Plugin_Install_v${APPVERSION}.exe"
Var INSTALL_BASE_DIR
Var OBS_INSTALL_DIR
; Use compression
SetCompressor Zlib
; Modern interface settings
!include "MUI.nsh"
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "LICENSE"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; Set languages (first is default language)
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
Section "Spout 2 OBS Plugin" Section1
StrCpy $INSTALL_BASE_DIR "$PROGRAMFILES64\obs-studio"
ReadRegStr $OBS_INSTALL_DIR HKLM "SOFTWARE\OBS Studio" ""
!if "$OBS_INSTALL_DIR" != ""
StrCpy $INSTALL_BASE_DIR "$OBS_INSTALL_DIR"
!endif
StrCpy $InstDir "$INSTALL_BASE_DIR"
IfFileExists "$INSTDIR\*.*" +3
MessageBox MB_OK|MB_ICONSTOP "OBS Directory doesn't exist!"
Abort
; Set Section properties
SetOverwrite on
AllowSkipFiles off
; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\obs-plugins\64bit\"
File "..\..\build_x64\plugins\win-spout\Release\win-spout.dll"
File "..\..\plugins\win-spout\deps\Spout2\BUILD\Binaries\x64\Spout.dll"
File "..\..\plugins\win-spout\deps\Spout2\BUILD\Binaries\x64\SpoutDX.dll"
File "..\..\plugins\win-spout\deps\Spout2\BUILD\Binaries\x64\SpoutLibrary.dll"
SetOutPath "$INSTDIR\data\obs-plugins\win-spout\locale\"
File "data\locale\en-US.ini"
File "data\locale\zh-CN.ini"
CreateDirectory "$SMPROGRAMS\Spout 2 OBS Plugin"
CreateShortCut "$SMPROGRAMS\Spout 2 OBS Plugin\Uninstall Spout2 OBS Plugin.lnk" "$INSTDIR\obs-plugins\uninstall-spout2-plugin.exe"
SectionEnd
Section -FinishSection
WriteRegStr HKLM "Software\${APPNAME}" "InstallDir" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\obs-plugins\uninstall-spout2-plugin.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "OBS Spout2 Plugin"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "HelpLink" "https://github.com/Off-World-Live/obs-spout2-source-plugin"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${APPVERSION}"
WriteUninstaller "$INSTDIR\obs-plugins\uninstall-spout2-plugin.exe"
SectionEnd
; Modern install component descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "Install the Spout 2 OBS Plugin to your installed OBS Studio version"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
UninstallText "This will uninstall Spout2 OBS Studio plugin from your system"
;Uninstall section
Section Uninstall
SectionIn RO
AllowSkipFiles off
;Remove from registry...
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
; Delete self
Delete "$INSTDIR\uninstall-spout2-plugin.exe"
; Delete Shortcuts
Delete "$SMPROGRAMS\Spout 2 OBS Plugin\Uninstall Spout2 OBS Plugin.lnk"
; Clean up Spout 2 OBS Plugin
Delete "$INSTDIR\64bit\win-spout.dll"
Delete "$INSTDIR\64bit\Spout.dll"
Delete "$INSTDIR\64bit\SpoutDX.dll"
Delete "$INSTDIR\64bit\SpoutLibrary.dll"
Delete "$INSTDIR\..\data\obs-plugins\win-spout\locale\en-US.ini"
Delete "$INSTDIR\..\data\obs-plugins\win-spout\locale\zh-CN.ini"
; We still clean up .exp and .lib files even though we don't currently install them
; because we used to install them in older versions
Delete "$INSTDIR\64bit\win-spout.exp"
Delete "$INSTDIR\64bit\win-spout.lib"
Delete "$INSTDIR\64bit\Spout.lib"
Delete "$INSTDIR\64bit\SpoutLibrary.lib"
; Remove remaining directories
RMDir "$SMPROGRAMS\Spout 2 OBS Plugin"
RMDir "$INSTDIR\..\data\obs-plugins\win-spout\locale\"
RMDir "$INSTDIR\..\data\obs-plugins\win-spout\"
SectionEnd
; eof