Skip to content

Commit 732b286

Browse files
authored
Add script variant of windows reg files for rvlink and rvpush (AcademySoftwareFoundation#302)
<!-- Thanks for your contribution! Please read this comment in its entirety. It's quite important. When a contributor merges the pull request, the title and the description will be used to build the merge commit! ### Pull Request TITLE It should be in the following format: [ 12345: Summary of the changes made ] Where 12345 is the corresponding Github Issue OR [ Summary of the changes made ] If it's solving something trivial, like fixing a typo. --> ### Linked issues <!-- Link the Issue(s) this Pull Request is related to. Each PR should link to at least one issue, in the form: Use one line for each Issue. This allows auto-closing the related issue when the fix is merged. Fixes #12345 Fixes #54345 --> N/A ### Summarize your change. Provide a script that sets the required registry entries for rvpush and rvlink where the paths to RV tools are relative to the script. ### Describe the reason for the change. The current .reg files doesn't work because we can't guess the values at build time. Without a proper installer, we can't update the files at install time. The solution I propose is to use a batch script that computes the path to rv and to rvpush. ### Describe what you have tested and on which operating system. Tested on Windows 10 by dropping the new files in the etc folder of a pre-compiled OpenRV. ### Add a list of changes, and note any that might need special attention during the review. Please double check the entries. I *think* I did it right, but it's really error prone. ### If possible, provide screenshots. --------- Signed-off-by: Kerby Geffrard <[email protected]>
1 parent 76ee427 commit 732b286

13 files changed

+237
-8
lines changed

.pre-commit-config.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ repos:
88
rev: 22.8.0
99
hooks:
1010
- id: black
11-
language_version: python3.10

packages/rv/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ IF(RV_TARGET_WINDOWS)
2020
FILE(
2121
GLOB regfiles
2222
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
23-
*.reg
23+
*.reg*
2424
)
2525
FOREACH(
2626
regfile

packages/rv/README.regfiles

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1+
Each provided .reg contains a REPLACE_ME_FOR_RV_HOME placeholder that must be replaced with the location of the application.
2+
Also included is a .bat version of each .reg files. Each .bat file sets the registry entry and automatically updates REPLACE_ME_FOR_RV_HOME with the location of the application.
13

24
The "standard" windows registry files here are:
35

4-
openwith.reg
6+
openwith.reg / openwith.reg.bat
57

68
Launch RV when double-clicking on media files.
79

8-
rvlink.reg
10+
rvlink.reg / rvlink.reg.bat
911

1012
Register RV as the handler for the "rvlink://" custom protocol. Docs on the rvlink protocol here:
1113

1214
https://github.com/AcademySoftwareFoundation/OpenRV/blob/main/docs/rv-manuals/rv-user-manual/rv-user-manual-chapter-c.md
1315

1416

15-
The "rvpush" .reg files are alternates to support different workflows. RVPUSH
17+
The "rvpush" files are alternates to support different workflows. RVPUSH
1618
is an executable we provide that allows you to communicate with a running RV
1719
from the command line. Docs here:
1820

@@ -23,18 +25,18 @@ startup time when loading media by using a running RV if one is available.
2325

2426
In particular:
2527

26-
rvlink_rvpush.reg
28+
rvlink_rvpush.reg / rvlink_rvpush.reg.bat
2729

2830
This one uses RVPUSH to handle URLs, IE the first one will open a new
2931
RV (tagged as the URL handler) and if that RV is still running when
3032
next you click on a URL, that will be handled by the running RV instead
3133
of a new one.
3234

33-
openwith_rvpush_set.reg
35+
openwith_rvpush_set.reg / openwith_rvpush_set.reg.bat
3436

3537
Similar to the above, but for the "double click on a file" workflow.
3638

37-
openwith_rvpush_merge.reg
39+
openwith_rvpush_merge.reg / openwith_rvpush_merge.reg.bat
3840

3941
This uses the "merge" action instead of the "set" action for RVPUSH,
4042
which means that double-clicking on a second file after you have

packages/rv/openwith.reg

42 Bytes
Binary file not shown.

packages/rv/openwith.reg.bat

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@echo off
2+
REM Check for administrative privileges
3+
net session >nul 2>&1
4+
if %errorLevel% == 0 (
5+
echo Success: Administrative privileges confirmed.
6+
) else (
7+
echo Failure: Current permissions to execute this .BAT file are inadequate.
8+
echo Please run this script as an administrator.
9+
pause
10+
exit /b
11+
)
12+
13+
cd %~dp0
14+
pushd ..
15+
16+
REM Define the path to the executable
17+
set "scriptDir=%cd%"
18+
set "rvExePath=%scriptDir%\bin\rv.exe"
19+
20+
REM Check if the executable exists
21+
if not exist "%rvExePath%" (
22+
echo Executable file %rvExePath% does not exist. Exiting script.
23+
popd
24+
pause
25+
exit /b
26+
)
27+
28+
@echo on
29+
REM Create registry keys and values
30+
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\rv.exe" /f
31+
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\rv.exe" /ve /d "%rvExePath%" /f
32+
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\rv.exe" /v "Path" /d "%scriptDir%\bin" /f
33+
34+
reg add "HKCR\Applications\rv.exe\shell\open" /f
35+
reg add "HKCR\Applications\rv.exe\shell\open" /v "FriendlyAppName" /d "RV" /f
36+
37+
reg add "HKCR\Applications\rv.exe\shell\open\command" /f
38+
reg add "HKCR\Applications\rv.exe\shell\open\command" /ve /d "\"%rvExePath%\" \"%%1\"" /f
39+
40+
reg add "HKCR\Applications\rv.exe\SupportedTypes" /f
41+
for %%A in (3gp aces aif aifc aiff ari au avi bmp bw cin cineon cur cut dds dpx exr gif hdr ico iff j2c j2k jp2 jpeg jpg jpt lbm lif lmp mdl mov movieproc mp4 mraysubfile openexr pbm pcd pcx pdf pgm pic png ppm psd qt rgb rgba rgbe rla rpf sgi shd sm snd stdinfb sxr targa tdl tex tga tif tiff tpic tx txr txt wal wav yuv z zfile) do (
42+
reg add "HKCR\Applications\rv.exe\SupportedTypes" /v %%A /d "" /f
43+
)
44+
45+
popd
46+
pause
47+

packages/rv/openwith_rvpush_merge.reg

42 Bytes
Binary file not shown.
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@echo off
2+
REM Check for administrative privileges
3+
net session >nul 2>&1
4+
if %errorLevel% == 0 (
5+
echo Success: Administrative privileges confirmed.
6+
) else (
7+
echo Failure: Current permissions to execute this .BAT file are inadequate.
8+
echo Please run this script as an administrator.
9+
pause
10+
exit /b
11+
)
12+
13+
cd %~dp0
14+
pushd ..
15+
16+
REM Define the path to the executable
17+
set "scriptDir=%cd%"
18+
set "rvpushExePath=%scriptDir%\bin\rvpush.exe"
19+
20+
REM Check if the executable exists
21+
if not exist "%rvpushExePath%" (
22+
echo Executable file %rvpushExePath% does not exist. Exiting script.
23+
popd
24+
pause
25+
exit /b
26+
)
27+
28+
@echo on
29+
REM Create registry keys and values
30+
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\rvpush.exe" /f
31+
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\rvpush.exe" /ve /d "%rvpushExePath%" /f
32+
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\rvpush.exe" /v "Path" /d "%scriptDir%\bin" /f
33+
34+
reg add "HKCR\Applications\rvpush.exe\shell\open" /f
35+
reg add "HKCR\Applications\rvpush.exe\shell\open" /v "FriendlyAppName" /d "RVPUSH" /f
36+
37+
reg add "HKCR\Applications\rvpush.exe\shell\open\command" /f
38+
reg add "HKCR\Applications\rvpush.exe\shell\open\command" /ve /d "\"%rvpushExePath%\" -tag \"openwith\" \"merge\" \"%%1\"" /f
39+
40+
reg add "HKCR\Applications\rvpush.exe\SupportedTypes" /f
41+
for %%A in (3gp aces aif aifc aiff ari au avi bmp bw cin cineon cur cut dds dpx exr gif hdr ico iff j2c j2k jp2 jpeg jpg jpt lbm lif lmp mdl mov movieproc mp4 mraysubfile openexr pbm pcd pcx pdf pgm pic png ppm psd qt rgb rgba rgbe rla rpf sgi shd sm snd stdinfb sxr targa tdl tex tga tif tiff tpic tx txr txt wal wav yuv z zfile) do (
42+
reg add "HKCR\Applications\rvpush.exe\SupportedTypes" /v %%A /d "" /f
43+
)
44+
45+
popd
46+
pause
47+

packages/rv/openwith_rvpush_set.reg

42 Bytes
Binary file not shown.
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@echo off
2+
REM Check for administrative privileges
3+
net session >nul 2>&1
4+
if %errorLevel% == 0 (
5+
echo Success: Administrative privileges confirmed.
6+
) else (
7+
echo Failure: Current permissions to execute this .BAT file are inadequate.
8+
echo Please run this script as an administrator.
9+
pause
10+
exit /b
11+
)
12+
13+
cd %~dp0
14+
pushd ..
15+
16+
REM Define the path to the executable
17+
set "scriptDir=%cd%"
18+
set "rvpushExePath=%scriptDir%\bin\rvpush.exe"
19+
20+
REM Check if the executable exists
21+
if not exist "%rvpushExePath%" (
22+
echo Executable file %rvpushExePath% does not exist. Exiting script.
23+
popd
24+
pause
25+
exit /b
26+
)
27+
28+
@echo on
29+
REM Create registry keys and values
30+
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\rvpush.exe" /f
31+
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\rvpush.exe" /ve /d "%rvpushExePath%" /f
32+
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\rvpush.exe" /v "Path" /d "%scriptDir%\bin" /f
33+
34+
reg add "HKCR\Applications\rvpush.exe\shell\open" /f
35+
reg add "HKCR\Applications\rvpush.exe\shell\open" /v "FriendlyAppName" /d "RVPUSH" /f
36+
37+
reg add "HKCR\Applications\rvpush.exe\shell\open\command" /f
38+
reg add "HKCR\Applications\rvpush.exe\shell\open\command" /ve /d "\"%rvpushExePath%\" -tag \"openwith\" \"set\" \"%%1\"" /f
39+
40+
reg add "HKCR\Applications\rvpush.exe\SupportedTypes" /f
41+
for %%A in (3gp aces aif aifc aiff ari au avi bmp bw cin cineon cur cut dds dpx exr gif hdr ico iff j2c j2k jp2 jpeg jpg jpt lbm lif lmp mdl mov movieproc mp4 mraysubfile openexr pbm pcd pcx pdf pgm pic png ppm psd qt rgb rgba rgbe rla rpf sgi shd sm snd stdinfb sxr targa tdl tex tga tif tiff tpic tx txr txt wal wav yuv z zfile) do (
42+
reg add "HKCR\Applications\rvpush.exe\SupportedTypes" /v %%A /d "" /f
43+
)
44+
45+
popd
46+
pause
47+

packages/rv/rvlink.reg

14 Bytes
Binary file not shown.

packages/rv/rvlink.reg.bat

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@echo off
2+
REM Check for administrative privileges
3+
net session >nul 2>&1
4+
if %errorLevel% == 0 (
5+
echo Success: Administrative privileges confirmed.
6+
) else (
7+
echo Failure: Current permissions to execute this .BAT file are inadequate.
8+
echo Please run this script as an administrator.
9+
pause
10+
exit /b exit /b
11+
)
12+
13+
cd %~dp0
14+
pushd ..
15+
16+
REM Define the path to the executable
17+
set "scriptDir=%cd%"
18+
set "rvExePath=%scriptDir%\bin\rv.exe"
19+
20+
REM Check if the executable exists
21+
if not exist "%rvExePath%" (
22+
echo Executable file %rvExePath% does not exist. Exiting script.
23+
popd
24+
pause
25+
exit /b)
26+
27+
@echo on
28+
REM Create registry keys and values
29+
reg add "HKCR\rvlink" /f
30+
reg add "HKCR\rvlink" /ve /d "URL:RV Protocol" /f
31+
reg add "HKCR\rvlink" /v "URL Protocol" /d "" /f
32+
33+
reg add "HKCR\rvlink\DefaultIcon" /f
34+
reg add "HKCR\rvlink\DefaultIcon" /ve /d "rv.exe,1" /f
35+
36+
reg add "HKCR\rvlink\shell" /f
37+
reg add "HKCR\rvlink\shell\open" /f
38+
39+
reg add "HKCR\rvlink\shell\open\command" /f
40+
reg add "HKCR\rvlink\shell\open\command" /ve /d "\"%rvExePath%\" \"%%1\"" /f
41+
42+
popd
43+
pause
44+

packages/rv/rvlink_rvpush.reg

14 Bytes
Binary file not shown.

packages/rv/rvlink_rvpush.reg.bat

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@echo off
2+
REM Check for administrative privileges
3+
net session >nul 2>&1
4+
if %errorLevel% == 0 (
5+
echo Success: Administrative privileges confirmed.
6+
) else (
7+
echo Failure: Current permissions to execute this .BAT file are inadequate.
8+
echo Please run this script as an administrator.
9+
pause
10+
exit /b
11+
)
12+
13+
cd %~dp0
14+
pushd ..
15+
16+
REM Define the path to the executable
17+
set "scriptDir=%cd%"
18+
set "rvpushExePath=%scriptDir%\bin\rvpush.exe"
19+
20+
REM Check if the executable exists
21+
if not exist "%rvpushExePath%" (
22+
echo Executable file %rvpushExePath% does not exist. Exiting script.
23+
popd
24+
pause
25+
exit /b
26+
)
27+
28+
@echo on
29+
REM Create registry keys and values
30+
reg add "HKCR\rvlink" /f
31+
reg add "HKCR\rvlink" /ve /d "URL:RV Protocol" /f
32+
reg add "HKCR\rvlink" /v "URL Protocol" /d "" /f
33+
34+
35+
reg add "HKCR\rvlink\shell" /f
36+
reg add "HKCR\rvlink\shell\open" /f
37+
38+
reg add "HKCR\rvlink\shell\open\command" /f
39+
reg add "HKCR\rvlink\shell\open\command" /ve /d "\"%rvpushExePath%\" \"-tag\" \"rvlink\" \"url\" \"%%1\"" /f
40+
41+
popd
42+
pause
43+

0 commit comments

Comments
 (0)