// Path: src/main/java/com/dcp/sm/logic/factory/TypeFactory.java
// public enum LOG_LEVEL {
//     DEBUG(0, "DEBUG"),
//     INFO(1, "INFO"),
//     WARN(2, "WARNING"),
//     ERR(3, "ERROR");
//         
//     private int _level;
//     private String _tag;
//     private LOG_LEVEL(int level, String tag)
//     {
//         _level = level;
//         _tag = tag;
//     }
//     @Override
//     public String toString()
//     {
//         return this._tag;
//     }
//         
//     public int value()
//     {
//         return this._level;
//     }
// }
// 
// Path: src/main/java/com/dcp/sm/main/log/Out.java
// public class Out
// {
//     //Log
//     private static List<String> log = new ArrayList<String>();//Global Log
//     public static List<String> getLog() { return log; }
//     private static int displayLevel = 1;//logs to display must be >= than this
//     
//     private static List<String> compileLog = new ArrayList<String>();//Izpack compile Log
//     public static List<String> getCompileLog() { return compileLog; }
//     
//     //Pivot GUI Component Repaint for log update
//     private static Component logger = null;
//     public static Component getLogger() { return logger; }
//     public static void setLogger(Component logger) { Out.logger = logger; }
//     
//     //Clear the stream cache
//     public static void clearCompileLog() {
//         compileLog.clear();
//     }
//     
//     //Add a new empty line
//     public static void newLine() {
//         print(LOG_LEVEL.INFO, "");
//     }
//     
//     /**
//      * Prints a string to the output stream
//      * @param text: log text
//      * @param outStream: output stream
//      */
//     public static void print(String text, PrintStream outStream) {
//         outStream.println(text);
//     }
//     
//     /**
//      * print text with a tag
//      * format: [TAG] TXT
//      * @param TAG: tag name
//      * @param TXT: text to log
//      */
//     public static void print(LOG_LEVEL level, String msg) {
//         print("["+level.toString()+"] "+msg, System.out);
//         log.add(msg);
//         final String log_TXT = msg;
//         
//         if (level.value() >= displayLevel)// display if >= than threshold
//             log(log_TXT);
//     }
//     
//     public static void log(final String msg) {
//         ApplicationContext.queueCallback(new Runnable() {//Enqueue GUI display repaint
//             @Override public void run()
//             {
//                 compileLog.add(msg);
//                 if (getLogger() != null) getLogger().repaint();//Component update
//             }
//         });
//     }
//     
// }


import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import com.dcp.sm.logic.factory.TypeFactory.LOG_LEVEL;
import com.dcp.sm.main.log.Out;
package com.dcp.sm.config.io;





public class BatWriter
{
    private File file;
    public String getTargetFile() throws IOException { return file.getCanonicalPath(); }
    
    
    public BatWriter(String FILE_PATH) throws IOException
    {
        file = new File(FILE_PATH);
        
        if (!file.exists()) file.createNewFile();
    }
    
    //Write setup install batch commands
    //cmd: msiexec /package "path/to/setupFile.msi" /passive /norestart
    public void writeSetup(String pack_name, boolean silent_install) throws IOException {
// Path: src/main/java/com/dcp/sm/logic/factory/TypeFactory.java
// public enum LOG_LEVEL {
//     DEBUG(0, "DEBUG"),
//     INFO(1, "INFO"),
//     WARN(2, "WARNING"),
//     ERR(3, "ERROR");
//         
//     private int _level;
//     private String _tag;
//     private LOG_LEVEL(int level, String tag)
//     {
//         _level = level;
//         _tag = tag;
//     }
//     @Override
//     public String toString()
//     {
//         return this._tag;
//     }
//         
//     public int value()
//     {
//         return this._level;
//     }
// }
// 
// Path: src/main/java/com/dcp/sm/main/log/Out.java
// public class Out
// {
//     //Log
//     private static List<String> log = new ArrayList<String>();//Global Log
//     public static List<String> getLog() { return log; }
//     private static int displayLevel = 1;//logs to display must be >= than this
//     
//     private static List<String> compileLog = new ArrayList<String>();//Izpack compile Log
//     public static List<String> getCompileLog() { return compileLog; }
//     
//     //Pivot GUI Component Repaint for log update
//     private static Component logger = null;
//     public static Component getLogger() { return logger; }
//     public static void setLogger(Component logger) { Out.logger = logger; }
//     
//     //Clear the stream cache
//     public static void clearCompileLog() {
//         compileLog.clear();
//     }
//     
//     //Add a new empty line
//     public static void newLine() {
//         print(LOG_LEVEL.INFO, "");
//     }
//     
//     /**
//      * Prints a string to the output stream
//      * @param text: log text
//      * @param outStream: output stream
//      */
//     public static void print(String text, PrintStream outStream) {
//         outStream.println(text);
//     }
//     
//     /**
//      * print text with a tag
//      * format: [TAG] TXT
//      * @param TAG: tag name
//      * @param TXT: text to log
//      */
//     public static void print(LOG_LEVEL level, String msg) {
//         print("["+level.toString()+"] "+msg, System.out);
//         log.add(msg);
//         final String log_TXT = msg;
//         
//         if (level.value() >= displayLevel)// display if >= than threshold
//             log(log_TXT);
//     }
//     
//     public static void log(final String msg) {
//         ApplicationContext.queueCallback(new Runnable() {//Enqueue GUI display repaint
//             @Override public void run()
//             {
//                 compileLog.add(msg);
//                 if (getLogger() != null) getLogger().repaint();//Component update
//             }
//         });
//     }
//     
// }


// Path: src/main/java/com/dcp/sm/config/io/BatWriter.java
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import com.dcp.sm.logic.factory.TypeFactory.LOG_LEVEL;
import com.dcp.sm.main.log.Out;

package com.dcp.sm.config.io;





public class BatWriter
{
    private File file;
    public String getTargetFile() throws IOException { return file.getCanonicalPath(); }
    
    
    public BatWriter(String FILE_PATH) throws IOException
    {
        file = new File(FILE_PATH);
        
        if (!file.exists()) file.createNewFile();
    }
    
    //Write setup install batch commands
    //cmd: msiexec /package "path/to/setupFile.msi" /passive /norestart
    public void writeSetup(String pack_name, boolean silent_install) throws IOException {
        Out.print(LOG_LEVEL.INFO, "Writing setup command to: " + file.getAbsolutePath());