Skip to content

Commit

Permalink
Use bat instead of shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
sorayuki committed Feb 19, 2025
1 parent 1cc4678 commit cb99d4a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
10 changes: 0 additions & 10 deletions .github/scripts/Package-Windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ function Package {

Remove-Item @RemoveArgs

Log-Group "Create shortcut..."
if ($True) {
$WshShell = New-Object -ComObject WScript.Shell
$ShortcutPath = "${ProjectRoot}/release/${Configuration}/Copy-Into-Here-To-Install.lnk"
$Shortcut = $WshShell.CreateShortcut($ShortcutPath)
$Shortcut.TargetPath = "%ALLUSERSPROFILE%\obs-studio\plugins"
$Shortcut.Save()
}
Log-Group

Log-Group "Archiving ${ProductName}..."
$CompressArgs = @{
Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*")
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_nam

if (WIN32)
install(FILES archive-readme.txt DESTINATION . RENAME Readme.txt)
install(FILES archive-copybat.txt DESTINATION . RENAME Copy-Into-Here-To-Install.bat)
endif ()
25 changes: 25 additions & 0 deletions archive-copybat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@echo off

set obs_prg_path=%ALLUSERSPROFILE%\obs-studio

rem make sure directory exists
cd /d "%obs_prg_path%"
if errorlevel 1 goto end
cd plugins
if errorlevel 1 md plugins

if "%1" == "" goto open_explorer
goto copy_dir

:open_explorer
explorer "%obs_prg_path%\plugins"
goto end

:copy_dir
rem make sure the argument is a folder
cd /d "%~1"
if errorlevel 1 goto end
xcopy /Y /S /I "%~1" "%obs_prg_path%\plugins\%~n1"
goto end

:end

0 comments on commit cb99d4a

Please sign in to comment.