Resource icon

Prepare portable OBS (Win) with VC and D3D .dll dependencies

This guide should help you with creating portable OBS installation that has all necessary dependencies (which should prevent errors like msvcp140_1.dll not found or D3D compiler not found). I often need to run OBS on various computers, sometimes unupdated, sometimes on guest accounts which prevent installing the dependencies, and the zipped version downloaded off OBS website won't work.

You need to do following steps on a PC that already has everything needed for OBS to work.

1. create \OBS_Portable_VC_D3D (or any name you like) directory.

2. extract contents of OBS-Studio-2x.x-Full-x64.zip file into this directory.

3. extract 2 scripts I attached in a zip file https://obsproject.com/forum/thread...d-dll-dependencies-deleted.140139/post-514374 (or create them and paste the contents attached later in this post)
OBS_auto_copy_dependencies.bat
OBS_run.bat


This is how the directory structure should look like now:
\OBS_Portable_VC_D3D
----- \bin
----- \data
----- \obs-plugins
----- \OBS_auto_copy_dependencies.bat
----- \OBS_run.bat


4. Run OBS_auto_copy_dependencies.bat script. It will create dxfiles and vcfiles directories and copy necessary files from your system. It will also create portable_mode.txt file, which tells OBS that it should save all configs inside this directory.

5. After the script is done, you can delete OBS_auto_copy_dependencies.bat.

To run OBS, use OBS_run.bat. It sets PATH variable on runtime which tells OBS to look for necessary files in vcfiles and dxfiles directory. You can create a shortcut to OBS_run.bat file if you wish (right click on OBS_run.bat), and put it on desktop or another place. You can even change the icon of the shortcut to OBS icon (right click on shortcut and open properties, then use bin\64bit\obs64.exe file for icon).

Now you can copy or zip entire OBS_Portable_VC_D3D directory and use it on other computers.

Note: it should be possible to just copy all .dll files into \bin\64bit directory and remove the scripts and vcfiles / dxfiles directories, but then it would be a bit more difficult to update the OBS.

OBS_auto_copy_dependencies.bat contents:
Code:
@echo off
echo This script wil attempt to copy OBS VC and D3D dependencies. It is meant to be ran on a PC which has already been used with OBS and has all necessary files.
echo These files allowed version 26.1 of OBS Studio to work in portable mode on Windows 10 and Windows 7 PCs. Other versions of OBS and Windows may give different results.
echo This script should be ran inside of extracted OBS directory.
pause
cd /D "%~dp0"
mkdir vcfiles
mkdir dxfiles
@echo on
cd vcfiles
copy %windir%\system32\concrt140.dll
copy %windir%\system32\msvcp140.dll
copy %windir%\system32\msvcp140_1.dll
copy %windir%\system32\msvcp140_2.dll
copy %windir%\system32\msvcp140_atomic_wait.dll
copy %windir%\system32\msvcp140_codecvt_ids.dll
copy %windir%\system32\ucrtbase.dll
copy %windir%\system32\vcamp140.dll
copy %windir%\system32\vccorlib140.dll
copy %windir%\system32\vcomp140.dll
copy %windir%\system32\vcruntime140.dll
copy %windir%\system32\vcruntime140_1.dll
cd ..
cd dxfiles
copy %windir%\system32\D3DCompiler_33.dll
copy %windir%\system32\D3DCompiler_34.dll
copy %windir%\system32\D3DCompiler_35.dll
copy %windir%\system32\D3DCompiler_36.dll
copy %windir%\system32\D3DCompiler_37.dll
copy %windir%\system32\D3DCompiler_38.dll
copy %windir%\system32\D3DCompiler_39.dll
copy %windir%\system32\D3DCompiler_40.dll
copy %windir%\system32\D3DCompiler_41.dll
copy %windir%\system32\D3DCompiler_42.dll
copy %windir%\system32\D3DCompiler_43.dll
copy %windir%\system32\D3DCompiler_47.dll
copy %windir%\system32\d3dx10.dll
copy %windir%\system32\d3dx10_33.dll
copy %windir%\system32\d3dx10_34.dll
copy %windir%\system32\d3dx10_35.dll
copy %windir%\system32\d3dx10_36.dll
copy %windir%\system32\d3dx10_37.dll
copy %windir%\system32\d3dx10_38.dll
copy %windir%\system32\d3dx10_39.dll
copy %windir%\system32\d3dx10_40.dll
copy %windir%\system32\d3dx10_41.dll
copy %windir%\system32\d3dx10_42.dll
copy %windir%\system32\d3dx10_43.dll
copy %windir%\system32\d3dx11_42.dll
copy %windir%\system32\d3dx11_43.dll
@echo off
cd ..
echo File copying is done. If any files were not available, you should see some errors (but probably not all files are necessary).
nul > portable_mode.txt
echo Created portable_mode.txt
echo Done. You can remove OBS_auto_copy_dependencies.bat and README_FIRST.txt files.
pause

OBS_run.bat contents:
Code:
cd /D "%~dp0"

SET PATH=%cd%\vcfiles;%cd%\dxfiles
cd bin
cd 64bit
start obs64.exe

I was able to use this version on Windows 10 PC, Windows 7 laptop that wasn't updated for 4 years and almost on Vista SP2 (tries to run, but asks for a better graphics card; maybe it would work with a better one).

I used similar procedure to create portable installation of OBS + obs-gstreamer: https://obsproject.com/forum/threads/obs-gstreamer.88517/post-514306
Author
adalbert
Views
4,628
First release
Last update
Rating
0.00 star(s) 0 ratings
Top