Skip to content

Commit acac831

Browse files
committed
User service id for preferences pane
1 parent c833aaf commit acac831

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/com/inet/gradle/setup/dmg/Dmg.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,14 @@ public void setBackgroundColor( Color backgroundColor ) {
407407
*/
408408
public String getApplicationIdentifier( SetupBuilder setup ) {
409409
if ( applicationIdentifier == null || applicationIdentifier.isEmpty() ) {
410-
return setup.getAppIdentifier();
410+
if ( setup.getMainClass() == null || setup.getMainClass().isEmpty() ) {
411+
return setup.getAppIdentifier();
412+
}
413+
return setup.getMainClass();
411414
}
412415
return applicationIdentifier;
413416
}
414417

415-
416418
/**
417419
* Sets an application identifier for the DMG builder.
418420
* It is being used as ID in the Info.plist

src/com/inet/gradle/setup/dmg/OSXPrefPaneCreator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void create( Service service ) throws Exception {
8888

8989
// Patch Info.plist
9090
File prefPanePLIST = new File( prefPaneLocation, "Contents/Info.plist" );
91-
String prefPaneIdentifier = getSetupBuilder().getMainClass() != null ? getSetupBuilder().getMainClass() : getSetupBuilder().getAppIdentifier();
91+
String prefPaneIdentifier = task.getApplicationIdentifier( getSetupBuilder() );
9292
setPlistProperty( prefPanePLIST, ":CFBundleIdentifier", prefPaneIdentifier + ".prefPane" );
9393
setPlistProperty( prefPanePLIST, ":CFBundleName", displayName + " Preference Pane" );
9494
setPlistProperty( prefPanePLIST, ":CFBundleExecutable", internalName );
@@ -104,7 +104,7 @@ void create( Service service ) throws Exception {
104104

105105
File servicePLIST = new File( prefPaneLocation, "Contents/Resources/service.plist" );
106106
setPlistProperty( servicePLIST, ":Name", displayName );
107-
setPlistProperty( servicePLIST, ":Label", service.getMainClass() != null ? service.getMainClass() : getSetupBuilder().getAppIdentifier() );
107+
setPlistProperty( servicePLIST, ":Label", service.getId() );
108108

109109
// Program will be set during installation.
110110
setPlistProperty( servicePLIST, ":Description", service.getDescription() );

0 commit comments

Comments
 (0)