Explorar o código

hopefully fixed that J7u17 assholebug

git-svn-id: http://repo.nplusc.de/svn/iZink@46 8b19561d-0d00-6744-8ac1-9afc8f58a8aa
masterX244 %!s(int64=12) %!d(string=hai) anos
pai
achega
ae2e772d36

+ 1 - 0
IZSetup/src/de/nplusc/izc/InstallPak/BundleVerifyGui.form

@@ -13,6 +13,7 @@
   </Properties>
   <SyntheticProperties>
     <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+    <SyntheticProperty name="generateCenter" type="boolean" value="false"/>
   </SyntheticProperties>
   <Events>
     <EventHandler event="componentMoved" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentMoved"/>

+ 3 - 3
IZSetup/src/de/nplusc/izc/InstallPak/BundleVerifyGui.java

@@ -40,12 +40,12 @@ public class BundleVerifyGui extends javax.swing.JFrame
     private String packfileForInstall;
     private void readInBundle()
     {
-        String[] bundledata = izsetupReader.ConvertToSysSpezSetupFile(z.getStringEntry("bundle.izmeta"), false, true, "");
+        String[][] bundledata = izsetupReader.ConvertToSysSpezSetupFile(z.getStringEntry("bundle.izmeta"), false, true, "");
         String baseDir = Tools.processEnvVarsinLine("%temp%\\iZsetup");//sird aktualisiert wenn ein UnCopy-Bundle erkannt wurde
-        for (String line : bundledata)
+        for (String[] line : bundledata)
         {
             System.err.println(line);
-            String[] linedata= line.split("\\|");
+            String[] linedata= line;
             if(linedata[1].equalsIgnoreCase("meta:isZipped")&&linedata[2].equalsIgnoreCase("false"))
             {
                 Tools.DebugHelperPrint("Disk?", true, "iZsetup.enableFinerDebug");

+ 25 - 20
IZSetup/src/de/nplusc/izc/InstallPak/InstallManager.java

@@ -21,10 +21,10 @@ public class InstallManager
     
     
     public static InstallManager Main;
-    private String[] InstallQueue;
+    private String[][] InstallQueue;
     private String[] Groups;
     private String[] enabledGroupIDs;
-    private HashMap<String,ArrayList<String>> groupsplitted = new HashMap<>();
+    private HashMap<String,ArrayList<String[]>> groupsplitted = new HashMap<>();
     static{
         Main=  new InstallManager();
       //  Main.setInstallScript(ModeSel.filePath);
@@ -47,27 +47,26 @@ public class InstallManager
         String groupID="000"; 
         String previousGRPID ="000";
         
-        ArrayList<String> SubGroup = new ArrayList<>();
+        ArrayList<String[]> SubGroup = new ArrayList<>();
         for (String[] line : data)
         {
-            if(!(line.length()<6))
+            if(!(line==null))
             {
-                String[] splittedLine = line.split("\\|");
                 //DBG_START
                 try{
-                Tools.DebugHelperPrint(splittedLine[0]+"|GRP", true, "iZsetup.enableFinerDebug");
-                Tools.DebugHelperPrint(splittedLine[1]+"|KEY", true, "iZsetup.enableFinerDebug");
-                Tools.DebugHelperPrint(splittedLine[2]+"|VAL", true, "iZsetup.enableFinerDebug");
-                Tools.DebugHelperPrint(splittedLine[3]+"|CMNT", true, "iZsetup.enableFinerDebug");
+                Tools.DebugHelperPrint(line[0]+"|GRP", true, "iZsetup.enableFinerDebug");
+                Tools.DebugHelperPrint(line[1]+"|KEY", true, "iZsetup.enableFinerDebug");
+                Tools.DebugHelperPrint(line[2]+"|VAL", true, "iZsetup.enableFinerDebug");
+                //Tools.DebugHelperPrint(splittedLine[3]+"|CMNT", true, "iZsetup.enableFinerDebug");
                 //DBG_STOP
                 }
                 catch(Exception ignored)//wenn 4ter null da kein CMNT feld vorhanden solls nicht errorn
                 {
                     
                 }
-                if(!splittedLine[0].equals("000"))
+                if(!line[0].equals("000"))
                 {
-                    groupID=splittedLine[0];
+                    groupID=line[0];
                     if(!previousGRPID.equals(groupID)&&!previousGRPID.equals("000"))
                     {
                         groupsplitted.put(previousGRPID, SubGroup);//Einlagern der abgeschlossenen gruppe
@@ -87,9 +86,9 @@ public class InstallManager
         {
             lenabledGroupIDs.add(id);
             
-            if(groupsplitted.get(id).get(0).split("\\|")[1].equalsIgnoreCase("grp")||groupsplitted.get(id).get(0).split("\\|")[1].equalsIgnoreCase("group"))
+            if(groupsplitted.get(id).get(0)[1].equalsIgnoreCase("grp")||groupsplitted.get(id).get(0)[1].equalsIgnoreCase("group"))
             {
-                String groupname = groupsplitted.get(id).get(0).split("\\|")[2];//angelt sich erste zeile der Gruppe davon 3. Wert
+                String groupname = groupsplitted.get(id).get(0)[2];//angelt sich erste zeile der Gruppe davon 3. Wert
                                                                                 //wenn nicht mit grp oder group eingeleitetdann immer ausgeführt
                 lGroups.add(id+"|"+groupname);
             }
@@ -126,7 +125,7 @@ public class InstallManager
         }
         enabledGroupIDs = newGrps.toArray(new String[0]);
     }
-    public String[] getInstallQueue()
+    public String[][] getInstallQueue()
     {
         return InstallQueue;
     }
@@ -134,21 +133,27 @@ public class InstallManager
     
     public void createQueue()
     {
-        ArrayList<String> TempQueue = new ArrayList<>();
+        ArrayList<String[]> TempQueue = new ArrayList<>();
         Arrays.sort(enabledGroupIDs);
         //System.err.println("nop");
         for (String id : enabledGroupIDs)
         {
-            ArrayList<String> loadedGroup = groupsplitted.get(id);
-            for (String lines : loadedGroup)
+            ArrayList<String[]> loadedGroup = groupsplitted.get(id);
+            for (String[] lines : loadedGroup)
             {
-                String[] linedata =lines.split("\\|");
+                String[] linedata =lines;
                 if(linedata[1].equalsIgnoreCase("msg")||linedata[1].equalsIgnoreCase("exec")||linedata[1].equalsIgnoreCase("requireExec"))
                 {
-                    TempQueue.add(linedata[2]);
+                    TempQueue.add(Arrays.copyOfRange(lines, 2, lines.length));
                 }
             }
         }
-        InstallQueue = TempQueue.toArray(new String[0]);
+        //InstallQueue = TempQueue.toArray(new String[0]);
+        InstallQueue=new String[TempQueue.size()][];
+        for (int i = 0; i < InstallQueue.length; i++)
+        {
+            InstallQueue[i]=TempQueue.get(i);
+            
+        }
     }
 }

+ 11 - 10
IZSetup/src/de/nplusc/izc/InstallPak/InstallProgressGui.java

@@ -9,6 +9,7 @@ import de.nplusc.izc.tools.UiToolz.BootStrap;
 import de.nplusc.izc.tools.baseTools.Lock;
 import de.nplusc.izc.tools.baseTools.Messagers;
 import de.nplusc.izc.tools.baseTools.Tools;
+import de.nplusc.izc.tools.baseTools.arraytools;
 import java.awt.Point;
 import java.io.File;
 import java.io.IOException;
@@ -160,27 +161,27 @@ public class InstallProgressGui extends javax.swing.JFrame
                 {
                     ex.printStackTrace();
                 }
-                String[] queue = im.getInstallQueue();
+                String[][] queue = im.getInstallQueue();
                 for (int i = 0; i + 1 < queue.length; i++)
                 {
-                    String msg = queue[i];
+                    String msg = queue[i][0];
                     tempLog.append(lblMsg.getText() + "\n");//Trockentest für Cmd-s
                     lblMsg.setText(msg);
                     i++;
-                    String cmd = queue[i];
-                    if(!cmd.equalsIgnoreCase("wait"))
+                    String[] cmd = queue[i];
+                    if(!cmd[0].equalsIgnoreCase("wait"))
                     {
-                        if(!cmd.substring(0,5).equalsIgnoreCase("Copy:"))
+                        if(!cmd[0].substring(0,5).equalsIgnoreCase("Copy:"))
                         {
                         Tools.DebugHelperPrint(msg, true, "iZsetup.enableFinerDebug");
-                        Tools.DebugHelperPrint(cmd, true, "iZsetup.enableFinerDebug");
-                        Tools.runSingleCmd(true,true,false,tempLog,cmd);//scharfgesetzt
-                                            //TODO: muss an J7u17 anpassen
+                        Tools.DebugHelperPrint(arraytools.ArrayKleben(cmd, " "), true, "iZsetup.enableFinerDebug");
+                        Tools.runSingleCmd(true,true,false,true,tempLog,cmd);//scharfgesetzt
+                                            
                         }
                         else
                         {
-                            cmd = cmd.substring(5);
-                            String[] cmdspl = cmd.split(">");
+                            cmd[0] = cmd[0].substring(5);
+                            String[] cmdspl = cmd[0].split(">");
                             //File src = new File(cmdspl[0]);
                             File trg = new File(FileTK.getFilePath(cmdspl[1]));
                             trg.mkdirs();

+ 24 - 24
IZSetup/src/de/nplusc/izc/InstallPak/PackManager.java

@@ -16,7 +16,7 @@ import java.util.HashMap;
  */
 public class PackManager
 {
-    private HashMap<String,ArrayList<String>> groupsplitted = new HashMap<>();
+    private HashMap<String,ArrayList<String[]>> groupsplitted = new HashMap<>();
     private String[] installingPacks,AllPacks,DetectedPacks,queue;
     
     /**
@@ -30,10 +30,10 @@ public class PackManager
         for (int i=0;i<AllPacks.length;i++)
         {
             String id=AllPacks[i];
-            ArrayList<String> group=groupsplitted.get(id);
-            for (String row : group)
+            ArrayList<String[]> group=groupsplitted.get(id);
+            for (String row[] : group)
             {
-                String[] rowSplit = row.split("\\|");
+                String[] rowSplit = row;
                 if(rowSplit[1].equalsIgnoreCase("pack"))
                     ret[i] = id+"|"+rowSplit[2];
             }
@@ -43,16 +43,16 @@ public class PackManager
     
     public void loadPackageData(String path)
     {
-        String[] data = izsetupReader.getSysSpezSetupFile(path,true,true);
+        String[][] data = izsetupReader.getSysSpezSetupFile(path,true,true);
         String groupID="000"; 
         String previousGRPID ="000";
         
-        ArrayList<String> SubGroup = new ArrayList<>();
-        for (String line : data)
+        ArrayList<String[]> SubGroup = new ArrayList<>();
+        for (String[] line : data)
         {
-            if(!(line.length()<6))
+            if(!(line==null))
             {
-                String[] splittedLine = line.split("\\|");
+                String[] splittedLine=line;
                 if(!splittedLine[0].equals("000"))
                 {
                     groupID=splittedLine[0];
@@ -174,11 +174,11 @@ public class PackManager
    
     public String packDependency(String packid)
     {
-        ArrayList<String> selectedPack = groupsplitted.get(packid);
+        ArrayList<String[]> selectedPack = groupsplitted.get(packid);
         //002|req|001|nummer des benötigten packs//kann weitere erfordernwenn
-        for (String line : selectedPack)
+        for (String[] line : selectedPack)
         {
-            String[] linesegs = line.split("\\|");
+            String[] linesegs = line;
             if(linesegs[1].equalsIgnoreCase("req"))
                 return linesegs[2];
         }
@@ -190,10 +190,10 @@ public class PackManager
     //005|Description|Tools für die games aus dem Package
     public String getPackDescription(String packid)
     {
-        ArrayList<String> selectedPack = groupsplitted.get(packid);
-        for (String line : selectedPack)
+        ArrayList<String[]> selectedPack = groupsplitted.get(packid);
+        for (String[] line : selectedPack)
         {
-            String[] linesegs = line.split("\\|");
+            String[] linesegs = line;
             if(linesegs[1].equalsIgnoreCase("Description"))
                 return linesegs[2];
         }
@@ -202,10 +202,10 @@ public class PackManager
     
     public String getPackName(String packid)
     {
-        ArrayList<String> selectedPack = groupsplitted.get(packid);
-        for (String line : selectedPack)
+        ArrayList<String[]> selectedPack = groupsplitted.get(packid);
+        for (String line[] : selectedPack)
         {
-            String[] linesegs = line.split("\\|");
+            String[] linesegs = line;
             if(linesegs[1].equalsIgnoreCase("pack"))
                 return linesegs[2];
         }
@@ -219,10 +219,10 @@ public class PackManager
         for (int i=0;i<AllPacks.length;i++)
         {
             String id=AllPacks[i];
-            ArrayList<String> group=groupsplitted.get(id);
-            for (String row : group)
+            ArrayList<String[]> group=groupsplitted.get(id);
+            for (String[] row : group)
             {
-                String[] rowSplit = row.split("\\|");
+                String[] rowSplit = row;
                 if(rowSplit[1].equalsIgnoreCase("detectInstall"))
                 {
                     String detecString = rowSplit[2];
@@ -255,10 +255,10 @@ public class PackManager
         ArrayList<String> queuetmp = new ArrayList<>();
         for (String id : installingPacks)
         {
-            ArrayList<String> grpldr =groupsplitted.get(id);
-            for (String line : grpldr)
+            ArrayList<String[]> grpldr =groupsplitted.get(id);
+            for (String[] line : grpldr)
             {
-                String[] data = line.split("\\|");
+                String[] data = line;
                 if(data[1].equalsIgnoreCase("packfile"))
                 {
                     queuetmp.add("packfile:"+data[2]);

+ 12 - 2
IZSetup/src/de/nplusc/izc/InstallPak/izsetupReader.java

@@ -9,6 +9,7 @@ import de.nplusc.izc.tools.WinToolz.Commands;
 import de.nplusc.izc.tools.baseTools.Detectors;
 import de.nplusc.izc.tools.baseTools.Messagers;
 import de.nplusc.izc.tools.baseTools.Tools;
+import de.nplusc.izc.tools.baseTools.arraytools;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -454,9 +455,18 @@ public class izsetupReader
             String[] splittedLine1,splittedLine2,splittedLine3;
             for (String val : GC)
             {
-                splittedLine = val.split(";");
+                if(val.length()>6)
+                {
+                splittedLine1 = val.split("\\|");
+                splittedLine2 = splittedLine1[2].split(";");
+                splittedLine3 = arraytools.concatAll(Arrays.copyOf(splittedLine1, 2), splittedLine2);
                 
-                returnValuesTemp.add(splittedLine);
+                returnValuesTemp.add(splittedLine3);
+                }
+                else
+                {
+                    returnValuesTemp.add(null);
+                }
             }
         }
         String[][] ret = new String[returnValuesTemp.size()][];