Skip to content

Commit 9486fc6

Browse files
author
volker
committed
java.net.URL is not allow as @input anymore. #132
1 parent e67d2ea commit 9486fc6

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

src/com/inet/gradle/setup/msi/Msi.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import java.io.File;
1919
import java.io.IOException;
2020
import java.net.MalformedURLException;
21+
import java.net.URI;
22+
import java.net.URISyntaxException;
2123
import java.net.URL;
2224
import java.util.ArrayList;
2325
import java.util.Arrays;
@@ -260,9 +262,21 @@ public SignTool getSignTool() {
260262
*
261263
* @return the template
262264
* @throws MalformedURLException if any error occur
265+
* @throws URISyntaxException if any error occur
263266
*/
264267
@Input
265-
public URL getWxsTemplateURL() throws MalformedURLException {
268+
public URI getWxsTemplateURI() throws MalformedURLException, URISyntaxException {
269+
return getWxsTemplateURL().toURI();
270+
}
271+
272+
/**
273+
* Get a URL to a *.wxs file for the WIX Toolset
274+
*
275+
* @return the template
276+
* @throws MalformedURLException if any error occur
277+
*/
278+
@Internal
279+
URL getWxsTemplateURL() throws MalformedURLException {
266280
if( wxsTemplate != null ) {
267281
return getProject().file( wxsTemplate ).toURI().toURL();
268282
}
@@ -429,9 +443,21 @@ public void setMultiInstanceCount( int instanceCount ) {
429443
*
430444
* @return the URL
431445
* @throws MalformedURLException if any error occur
446+
* @throws URISyntaxException if any error occur
432447
*/
433448
@Input
434-
public URL getMultiInstanceScript() throws MalformedURLException {
449+
public URI getMultiInstanceScript() throws MalformedURLException, URISyntaxException {
450+
return getMultiInstanceScriptURL().toURI();
451+
}
452+
453+
/**
454+
* Get the URL to a vbscript that set the instance name.
455+
*
456+
* @return the URL
457+
* @throws MalformedURLException if any error occur
458+
*/
459+
@Internal
460+
URL getMultiInstanceScriptURL() throws MalformedURLException {
435461
if( multiInstanceScript != null ) {
436462
return getProject().file( multiInstanceScript ).toURI().toURL();
437463
}

src/com/inet/gradle/setup/msi/WxsFileBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ private void addMultiInstanceTransforms() throws IOException {
14521452
// add a vbscript action to set the instance names
14531453
action = getOrCreateChildById( product, "CustomAction", "SetInstanceID" );
14541454
addAttributeIfNotExists( action, "Script", "vbscript" );
1455-
try( Scanner scanner = new Scanner( task.getMultiInstanceScript().openStream(), "UTF8" ) ) {
1455+
try( Scanner scanner = new Scanner( task.getMultiInstanceScriptURL().openStream(), "UTF8" ) ) {
14561456
String vbscript = scanner.useDelimiter( "\\A" ).next(); // read the completely file into a string
14571457
vbscript = vbscript.replace( "\r\n", "\n" ); // \n will be replaced with platform default characters. https://bugs.openjdk.java.net/browse/JDK-8133452
14581458
action.setTextContent( vbscript );

0 commit comments

Comments
 (0)