xref: /aoo42x/main/scp2/source/mkopenwith.btm (revision cdf0e10c)
1@ECHO OFF
2IF '%1'==' GOTO End
3IF NOT EXIST %1\. GOTO Module_Error
4
5SET OUTPUT=%1\OpenWith.SCP
6
7SET FILE=%@FILEOPEN[supported_extensions.txt,read,t]
8
9ECHO // "OpenWith" Windows Registry keys for extensions supported by %1		> %OUTPUT%
10ECHO.																		>> %OUTPUT%
11
12:While_Read_File
13SET LINE=%@FILEREAD[%FILE%]
14IF '%LINE%'=='' GOTO While_Read_File
15IF '%@LEFT[1,%LINE%]'==';' GOTO While_Read_File
16IF '%LINE%'=='**EOF**' GOTO End_Read_File
17
18IF NOT '%@LEFT[1,%LINE%]'=='[' GOTO Register_Extension
19
20SET MODULE=%@UPPER[%@WORD["[]",0,%LINE%]]
21GOTO While_Read_File
22
23:Register_Extension
24IF NOT '%MODULE%'=='%@UPPER[%1]' GOTO While_Read_File
25
26ECHO // .%LINE%													>> %OUTPUT%
27ECHO RegistryItem gid_Regitem_OpenOffice_%LINE%_OpenWith_%1		>> %OUTPUT%
28ECHO     ParentID = PREDEFINED_HKEY_CLASSES_ROOT;				>> %OUTPUT%
29ECHO     Subkey = ".%LINE%\OpenWithProgIDs";					>> %OUTPUT%
30ECHO     ModuleID = gid_Module_Prg_%1_Bin;						>> %OUTPUT%
31ECHO     Name = "opendocument.%1Document.1";					>> %OUTPUT%
32ECHO     Value = "%PRODUCTNAME %PRODUCTVERSION";				>> %OUTPUT%
33ECHO End														>> %OUTPUT%
34ECHO.															>> %OUTPUT%
35
36REM GOTO End_Read_File
37GOTO While_Read_File
38
39:End_Read_File
40SET ERROR=%@FILECLOSE[%FILE%]
41GOTO End
42
43:Help
44ECHO Usage:		%0 Module
45ECHO Example:	%0 Calc
46GOTO End
47
48:Module_Error
49ECHO Module %1 not found !
50GOTO End
51
52:End
53