|
31 | 31 | import java.util.Set; |
32 | 32 | import java.util.UUID; |
33 | 33 | import java.util.regex.Pattern; |
| 34 | +import java.util.stream.Collectors; |
34 | 35 |
|
35 | 36 | import javax.swing.JEditorPane; |
36 | 37 | import javax.swing.text.DefaultStyledDocument; |
@@ -667,10 +668,13 @@ private void addServices() throws IOException { |
667 | 668 | addRegistryValue( regkey, "JavaHome", "string", "[INSTALLDIR]" + setup.getBundleJreTarget() ); |
668 | 669 | addRegistryValue( regkey, "Jvm", "string", "[INSTALLDIR]" + jvmDll ); |
669 | 670 | } |
| 671 | + addMultiStringRegistryValue( regkey, "Options", service.getJavaVMArguments() ); |
| 672 | + |
670 | 673 | regkey = addRegistryKey( component, "HKLM", id + "_RegStart", baseKey + name + "\\Parameters\\Start" ); |
671 | 674 | addRegistryValue( regkey, "Class", "string", service.getMainClass() ); |
672 | 675 | addRegistryValue( regkey, "Mode", "string", "jvm" ); |
673 | 676 | addRegistryValue( regkey, "WorkingPath", "string", "[INSTALLDIR]" + subdir ); |
| 677 | + addMultiStringRegistryValue( regkey, "Params", Arrays.asList( service.getStartArguments().split( " " ) ).stream().filter( e -> e.length() > 0 ).collect( Collectors.toList() ) ); |
674 | 678 | regkey = addRegistryKey( component, "HKLM", id + "_RegLog", baseKey + name + "\\Parameters\\Log" ); |
675 | 679 | addRegistryValue( regkey, "Path", "string", "[INSTALLDIR]" + subdir ); |
676 | 680 | addRegistryValue( regkey, "Prefix", "string", "service" ); |
@@ -1133,6 +1137,26 @@ private Element addRegistryValue( Element regkey, String name, String type, Stri |
1133 | 1137 | return regValue; |
1134 | 1138 | } |
1135 | 1139 |
|
| 1140 | + /** |
| 1141 | + * Add a registry value. |
| 1142 | + * |
| 1143 | + * @param regkey the parent registry key |
| 1144 | + * @param name the entry name, null use the default value of a key |
| 1145 | + * @param values the list of values |
| 1146 | + * @return the value node |
| 1147 | + */ |
| 1148 | + private Element addMultiStringRegistryValue( Element regkey, String name, List<String> values ) { |
| 1149 | + |
| 1150 | + if ( values.isEmpty() ) return null; |
| 1151 | + Element regValue = getOrCreateChildByKeyValue( regkey, "RegistryValue", "Name", name ); |
| 1152 | + addAttributeIfNotExists( regValue, "Type", "multiString" ); |
| 1153 | + |
| 1154 | + for( String value : values ) { |
| 1155 | + getOrCreateChild( regValue, "MultiStringValue", value, true ); |
| 1156 | + } |
| 1157 | + |
| 1158 | + return regValue; |
| 1159 | + } |
1136 | 1160 | /** |
1137 | 1161 | * Split a path in segments. |
1138 | 1162 | * |
|
0 commit comments