< prev index next >

src/jdk.incubator.jpackage/linux/native/libapplauncher/LinuxPlatform.cpp

Print this page

        

@@ -64,25 +64,27 @@
 LinuxPlatform::~LinuxPlatform(void) {
 }
 
 TString LinuxPlatform::GetPackageAppDirectory() {
     return FilePath::IncludeTrailingSeparator(
-            GetPackageRootDirectory()) + _T("app");
+            GetPackageRootDirectory()) + _T("lib/app");
 }
 
 TString LinuxPlatform::GetAppName() {
     TString result = GetModuleFileName();
     result = FilePath::ExtractFileName(result);
     return result;
 }
 
 TString LinuxPlatform::GetPackageLauncherDirectory() {
-    return GetPackageRootDirectory();
+    return FilePath::IncludeTrailingSeparator(
+            GetPackageRootDirectory()) + _T("bin");
 }
 
 TString LinuxPlatform::GetPackageRuntimeBinDirectory() {
-    return FilePath::IncludeTrailingSeparator(GetPackageRootDirectory()) + _T("runtime/bin");
+    return FilePath::IncludeTrailingSeparator(GetPackageRootDirectory())
+            + _T("runtime/bin");
 }
 
 void LinuxPlatform::ShowMessage(TString title, TString description) {
     printf("%s %s\n", PlatformString(title).toPlatformString(),
             PlatformString(description).toPlatformString());

@@ -123,17 +125,21 @@
     }
 
     return result;
 }
 
-void LinuxPlatform::SetCurrentDirectory(TString Value) {
-    chdir(PlatformString(Value).toPlatformString());
-}
-
 TString LinuxPlatform::GetPackageRootDirectory() {
+    TString result;
     TString filename = GetModuleFileName();
-    return FilePath::ExtractFilePath(filename);
+    TString binPath = FilePath::ExtractFilePath(filename);
+
+    size_t slash = binPath.find_last_of(TRAILING_PATHSEPARATOR);
+    if (slash != TString::npos) {
+        result = binPath.substr(0, slash);
+    }
+
+    return result;
 }
 
 TString LinuxPlatform::GetAppDataDirectory() {
     TString result;
     TString home = GetEnv(_T("HOME"));

@@ -859,19 +865,10 @@
 
         /* This will eihter be a TOKEN_EOF, TOKEN_CLOSE_BRACKET, or a
          * TOKEN_EMPTY_CLOSE_BRACKET */
         GetNextToken();
 
-        /* Skip until '>', '/>' or EOF. This should really be an error, */
-        /* but we are loose */
-        //        if(CurTokenType == TOKEN_EMPTY_CLOSE_BRACKET ||
-        //               CurTokenType == TOKEN_CLOSE_BRACKET ||
-        //               CurTokenType  == TOKEN_EOF) {
-        //            println("XML Parsing error: wrong kind of token found");
-        //            return NULL;
-        //        }
-
         if (CurTokenType == TOKEN_EMPTY_CLOSE_BRACKET) {
             GetNextToken();
             /* We are done with the sublevel - fall through to continue */
             /* parsing tags at the same level */
         } else if (CurTokenType == TOKEN_CLOSE_BRACKET) {

@@ -1019,12 +1016,12 @@
     }
 
     return FindXMLChild(root->_next, name);
 }
 
-/* Search for an attribute with the given name and returns the contents. Returns NULL if
- * attribute is not found
+/* Search for an attribute with the given name and returns the contents.
+ * Returns NULL if attribute is not found
  */
 TCHAR* FindXMLAttribute(XMLAttribute* attr, const TCHAR* name) {
     if (attr == NULL) return NULL;
     if (JPACKAGE_STRCMP(attr->_name, name) == 0) return attr->_value;
     return FindXMLAttribute(attr->_next, name);
< prev index next >