|
Lines 750-755
Link Here
|
| 750 |
cu.setTouchpointType(MetadataGeneratorHelper.TOUCHPOINT_NATIVE); |
750 |
cu.setTouchpointType(MetadataGeneratorHelper.TOUCHPOINT_NATIVE); |
| 751 |
Map touchpointData = new HashMap(); |
751 |
Map touchpointData = new HashMap(); |
| 752 |
String configurationData = "unzip(source:@artifact, target:${installFolder});"; //$NON-NLS-1$ |
752 |
String configurationData = "unzip(source:@artifact, target:${installFolder});"; //$NON-NLS-1$ |
|
|
753 |
|
| 754 |
IInstallableUnit launcherNameIU = null; |
| 755 |
|
| 756 |
File executableLocation = info.getExecutableLocation(); |
| 757 |
if (executableLocation != null) { |
| 758 |
if (!executableLocation.exists() && Constants.OS_WIN32.equals(os) && !executableLocation.getName().endsWith(".exe")) //$NON-NLS-1$ |
| 759 |
executableLocation = new File(executableLocation.getParentFile(), executableLocation.getName() + ".exe"); //$NON-NLS-1$ |
| 760 |
|
| 761 |
if (executableLocation.exists() && executableLocation.isFile()) |
| 762 |
launcherNameIU = MetadataGeneratorHelper.generateLauncherSetter(executableLocation.getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); |
| 763 |
} |
| 764 |
|
| 753 |
if (Constants.OS_MACOSX.equals(os)) { |
765 |
if (Constants.OS_MACOSX.equals(os)) { |
| 754 |
File[] appFolders = root.listFiles(new FilenameFilter() { |
766 |
File[] appFolders = root.listFiles(new FilenameFilter() { |
| 755 |
public boolean accept(File dir, String name) { |
767 |
public boolean accept(File dir, String name) { |
|
Lines 762-780
Link Here
|
| 762 |
File[] launcherFiles = macOSFolder.listFiles(); |
774 |
File[] launcherFiles = macOSFolder.listFiles(); |
| 763 |
for (int j = 0; j < launcherFiles.length; j++) { |
775 |
for (int j = 0; j < launcherFiles.length; j++) { |
| 764 |
configurationData += " chmod(targetDir:${installFolder}/" + appFolders[i].getName() + "/Contents/MacOS/, targetFile:" + launcherFiles[j].getName() + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
776 |
configurationData += " chmod(targetDir:${installFolder}/" + appFolders[i].getName() + "/Contents/MacOS/, targetFile:" + launcherFiles[j].getName() + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 765 |
if (new Path(launcherFiles[j].getName()).getFileExtension() == null) |
777 |
if (executableLocation == null && launcherFiles[i].isFile() && new Path(launcherFiles[j].getName()).getFileExtension() == null) |
| 766 |
MetadataGeneratorHelper.generateLauncherSetter(launcherFiles[j].getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); |
778 |
launcherNameIU = MetadataGeneratorHelper.generateLauncherSetter(launcherFiles[j].getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); |
| 767 |
} |
779 |
} |
| 768 |
} |
780 |
} |
| 769 |
} |
781 |
} |
| 770 |
} |
782 |
} else if (!Constants.OS_WIN32.equals(os)) { |
| 771 |
if (!Constants.OS_WIN32.equals(os) && !Constants.OS_MACOSX.equals(os)) { |
|
|
| 772 |
File[] launcherFiles = root.listFiles(); |
783 |
File[] launcherFiles = root.listFiles(); |
| 773 |
for (int i = 0; i < launcherFiles.length; i++) { |
784 |
for (int i = 0; launcherFiles != null && i < launcherFiles.length; i++) { |
| 774 |
configurationData += " chmod(targetDir:${installFolder}, targetFile:" + launcherFiles[i].getName() + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ |
785 |
configurationData += " chmod(targetDir:${installFolder}, targetFile:" + launcherFiles[i].getName() + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ |
| 775 |
if (new Path(launcherFiles[i].getName()).getFileExtension() == null) |
786 |
if (executableLocation == null && launcherFiles[i].isFile() && new Path(launcherFiles[i].getName()).getFileExtension() == null) |
| 776 |
MetadataGeneratorHelper.generateLauncherSetter(launcherFiles[i].getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); |
787 |
launcherNameIU = MetadataGeneratorHelper.generateLauncherSetter(launcherFiles[i].getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); |
| 777 |
} |
788 |
} |
|
|
789 |
} else if (launcherNameIU == null) { |
| 790 |
//windows |
| 791 |
File[] launcherFiles = root.listFiles(new FilenameFilter() { |
| 792 |
public boolean accept(File parent, String name) { |
| 793 |
return name.endsWith(".exe"); //$NON-NLS-1$ |
| 794 |
} |
| 795 |
}); |
| 796 |
if (launcherFiles != null && launcherFiles.length > 0) |
| 797 |
launcherNameIU = MetadataGeneratorHelper.generateLauncherSetter(launcherFiles[0].getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); |
| 778 |
} |
798 |
} |
| 779 |
touchpointData.put("install", configurationData); //$NON-NLS-1$ |
799 |
touchpointData.put("install", configurationData); //$NON-NLS-1$ |
| 780 |
String unConfigurationData = "cleanupzip(source:@artifact, target:${installFolder});"; //$NON-NLS-1$ |
800 |
String unConfigurationData = "cleanupzip(source:@artifact, target:${installFolder});"; //$NON-NLS-1$ |
|
Lines 785-793
Link Here
|
| 785 |
//The Product Query will need to include the launcher CU fragments as a workaround to bug 218890 |
805 |
//The Product Query will need to include the launcher CU fragments as a workaround to bug 218890 |
| 786 |
if (result.configurationIUs.containsKey(launcherIdPrefix)) { |
806 |
if (result.configurationIUs.containsKey(launcherIdPrefix)) { |
| 787 |
((Set) result.configurationIUs.get(launcherIdPrefix)).add(unit); |
807 |
((Set) result.configurationIUs.get(launcherIdPrefix)).add(unit); |
|
|
808 |
if (launcherNameIU != null) |
| 809 |
((Set) result.configurationIUs.get(launcherIdPrefix)).add(launcherNameIU); |
| 788 |
} else { |
810 |
} else { |
| 789 |
Set set = new HashSet(); |
811 |
Set set = new HashSet(); |
| 790 |
set.add(unit); |
812 |
set.add(unit); |
|
|
813 |
if (launcherNameIU != null) |
| 814 |
set.add(launcherNameIU); |
| 791 |
result.configurationIUs.put(launcherIdPrefix, set); |
815 |
result.configurationIUs.put(launcherIdPrefix, set); |
| 792 |
} |
816 |
} |
| 793 |
|
817 |
|