Skip to content

Commit

Permalink
modify install path. use installer.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorayuki committed Mar 14, 2021
1 parent 4e0d323 commit 47f6203
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
uses: actions/[email protected]
with:
name: obs-multi-rtmp
path: dist
path: installer
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (WIN32)
endif ()

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${OBS_BIN_DIR}" CACHE PATH "" FORCE)
set(CMAKE_INSTALL_PREFIX "$ENV{ProgramData}/obs-studio" CACHE PATH "" FORCE)
endif ()

execute_process(COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/pexports.exe"
Expand Down Expand Up @@ -104,10 +104,10 @@ target_link_libraries(obs-multi-rtmp PRIVATE

if (WIN32)
install(TARGETS obs-multi-rtmp RUNTIME
DESTINATION "obs-plugins/${PLAT}"
DESTINATION "plugins/obs-multi-rtmp/bin/${PLAT}"
)
install(DIRECTORY locale
DESTINATION "data/obs-plugins/obs-multi-rtmp"
DESTINATION "plugins/obs-multi-rtmp/data"
)
elseif (APPLE)
set_target_properties(obs-multi-rtmp PROPERTIES
Expand Down
5 changes: 3 additions & 2 deletions githubci/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ cmake %QTDIR64% -G "Visual Studio 16 2019" -A x64 -B build_x64 -S . -DCMAKE_INST
cmake --build build_x64 --config Release
cmake --install build_x64 --config Release

if not exist dist\nul exit /b
cmake -E make_directory installer
pushd dist
cmake -E tar cf ..\release.zip --format=zip .
"C:\Program Files (x86)\NSIS\makensis" ..\installer_script\installer.nsi
copy obs-multi-rtmp-setup.exe ..\installer
popd
35 changes: 35 additions & 0 deletions installer_script/installer.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
OutFile "obs-multi-rtmp-setup.exe"

Unicode true
RequestExecutionLevel user

SetDatablockOptimize on
SetCompress auto
SetCompressor /FINAL /SOLID lzma

Name "obs-multi-rtmp"
Caption "Multiple RTMP Output Plugin for OBS Studio"
Icon "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"

Function .onInit
ReadEnvStr $0 "ALLUSERSPROFILE"
StrCpy $INSTDIR "$0\obs-studio\plugins\obs-multi-rtmp"
FunctionEnd

Page directory
Page instfiles

Section
SetOutPath "$INSTDIR\bin\32bit"
File "plugins\obs-multi-rtmp\bin\32bit\obs-multi-rtmp.dll"

SetOutPath "$INSTDIR\bin\64bit"
File "plugins\obs-multi-rtmp\bin\64bit\obs-multi-rtmp.dll"

SetOutPath "$INSTDIR\data\locale"
File "plugins\obs-multi-rtmp\data\locale\*.ini"
SectionEnd

Section "Uninstaller"
RMDir /r /REBOOTOK "$INSTDIR\plugins\obs-multi-rtmp"
SectionEnd

0 comments on commit 47f6203

Please sign in to comment.