@@ -219,9 +219,17 @@ private void registerSchemeDefinition( ProtocolHandler handler ) {
219219
220220 Element registrySubKey = addRegistryKey ( registryEntries , "HKCR" , id ( scheme + "_protocol_handler_shell" ), scheme + "\\ shell\\ open\\ command" );
221221
222- handler .setStartArguments ( handler .getStartArguments () + " \" %1\" " );
222+ // multiplied the actual command
223+ // handler.setStartArguments( handler.getStartArguments() + " \"%1\"" );
223224 CommandLine cmd = new CommandLine ( handler , javaDir );
224- addRegistryValue ( registrySubKey , null , "string" , cmd .full );
225+
226+ // add the file parameter if not in the command already
227+ String fullCommand = cmd .full ;
228+ if ( !fullCommand .contains ( "%1" ) ) {
229+ fullCommand += " \" %1\" " ;
230+ }
231+
232+ addRegistryValue ( registrySubKey , null , "string" , fullCommand );
225233 }
226234 }
227235
@@ -941,7 +949,14 @@ private void registerFileExtension( DesktopStarter starter, CommandLine cmd ) th
941949 }
942950 String [] segments = segments ( targetFile );
943951 addAttributeIfNotExists ( verb , "TargetFile" , id ( segments , segments .length ) );
944- addAttributeIfNotExists ( verb , "Argument" , cmd .arguments + "\" %1\" " );
952+
953+ // add the file parameter if not in the command already
954+ String arguments = cmd .arguments ;
955+ if ( !arguments .contains ( "%1" ) ) {
956+ arguments += " \" %1\" " ;
957+ }
958+
959+ addAttributeIfNotExists ( verb , "Argument" , arguments );
945960 }
946961 }
947962 }
0 commit comments