Exemple #1
0
 public static void WriteTextFile(string file, string data)
 {
     using (StreamWriter sw = new StreamWriter(OutDirMan.MakeOutFileName(file)))
     {
         sw.WriteLine(data);
     }
 }
Exemple #2
0
 private static void ProcessExeIcon(string file)
 {
     if (genData.UserIconFile)
     {
         if (genData.BatchMode)
         {
             try
             {
                 string ico = OutDirMan.MakeOutFileName(Path.GetFileName(genData.IconFile));
                 if (!File.Exists(ico))
                 {
                     File.Copy(genData.IconFile, ico);
                 }
             }
             catch {}
         }
     }
     else             // extract icon
     {
         try
         {
             genData.IconFile = OutDirMan.MakeOutFileName("App.ico");
             starter.IconExtractor.SaveExeIcon(file, genData.IconFile);
         }
         catch (Exception ex)
         {
             genData.IconFile = null;
             PrintWarning("1002 Icon " + ex.Message, ex);
         }
     }
 }
Exemple #3
0
 private void InitRes()
 {
     if (rw == null)
     {
         resourceFilePath = OutDirMan.MakeOutFileName(resourceFilePath);
         rw = new ResourceWriter(resourceFilePath);
     }
 }
Exemple #4
0
        public static string MakeZipFileName(string file, bool useOutDir)
        {
            string temp = Path.GetFileNameWithoutExtension(file) + "z"
                          + Path.GetExtension(file);

            if (useOutDir)
            {
                temp = OutDirMan.MakeOutFileName(temp);
            }
            else
            {
                temp = Path.Combine(Path.GetDirectoryName(file), temp);
            }
            return(temp);
        }
Exemple #5
0
        private static void Proceed(ArrayList files)
        {
            if (files.Count <= 0)
            {
                throw new Exception("E1009 No files");
            }
            long start = DateTime.Now.Ticks;

            OutDirMan.Make();
            InitResMan();
            Logger.Log("Processing      : " + files.Count + " file(s)\r\n");
            ProcessFiles(files);
            rm.Save();
            genData.MakeReadOnly();
            if (InputParser.exeFileSet)
            {
                MakeStarterApp();
            }
            start = DateTime.Now.Ticks - start;
            Logger.Log("\r\nDone [" + ElapsedTime(start) + "]");
        }
Exemple #6
0
        private static void HandleZipDll()
        {
            if (genData.ZipDllName == null)
            {
                return;
            }
            string outZip = OutDirMan.MakeOutFileName(genData.ZipDllName);
            bool   exists = File.Exists(outZip);

            if ((!genData.PackZipDll) || genData.BatchMode)
            {
                if (!exists)
                {
                    File.Copy(genData.ZipDllName, outZip, false);
                }
            }
            else
            {
                if (exists)
                {
                    File.Delete(outZip);
                }
            }
        }