diff options
Diffstat (limited to 'scp2/source/mkopenwith.btm')
-rwxr-xr-x | scp2/source/mkopenwith.btm | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/scp2/source/mkopenwith.btm b/scp2/source/mkopenwith.btm new file mode 100755 index 000000000000..0c09f3b5e151 --- /dev/null +++ b/scp2/source/mkopenwith.btm @@ -0,0 +1,52 @@ +@ECHO OFF +IF '%1'==' GOTO End +IF NOT EXIST %1\. GOTO Module_Error + +SET OUTPUT=%1\OpenWith.SCP + +SET FILE=%@FILEOPEN[supported_extensions.txt,read,t] + +ECHO // "OpenWith" Windows Registry keys for extensions supported by %1 > %OUTPUT% +ECHO. >> %OUTPUT% + +:While_Read_File +SET LINE=%@FILEREAD[%FILE%] +IF '%LINE%'=='' GOTO While_Read_File +IF '%@LEFT[1,%LINE%]'==';' GOTO While_Read_File +IF '%LINE%'=='**EOF**' GOTO End_Read_File + +IF NOT '%@LEFT[1,%LINE%]'=='[' GOTO Register_Extension + +SET MODULE=%@UPPER[%@WORD["[]",0,%LINE%]] +GOTO While_Read_File + +:Register_Extension +IF NOT '%MODULE%'=='%@UPPER[%1]' GOTO While_Read_File + +ECHO // .%LINE% >> %OUTPUT% +ECHO RegistryItem gid_Regitem_OpenOffice_%LINE%_OpenWith_%1 >> %OUTPUT% +ECHO ParentID = PREDEFINED_HKEY_CLASSES_ROOT; >> %OUTPUT% +ECHO Subkey = ".%LINE%\OpenWithProgIDs"; >> %OUTPUT% +ECHO ModuleID = gid_Module_Prg_%1_Bin; >> %OUTPUT% +ECHO Name = "opendocument.%1Document.1"; >> %OUTPUT% +ECHO Value = "%PRODUCTNAME %PRODUCTVERSION"; >> %OUTPUT% +ECHO End >> %OUTPUT% +ECHO. >> %OUTPUT% + +REM GOTO End_Read_File +GOTO While_Read_File + +:End_Read_File +SET ERROR=%@FILECLOSE[%FILE%] +GOTO End + +:Help +ECHO Usage: %0 Module +ECHO Example: %0 Calc +GOTO End + +:Module_Error +ECHO Module %1 not found ! +GOTO End + +:End |