Esempio n. 1
0
 public static void WriteTextFile(string file, string data)
 {
     using (StreamWriter sw = new StreamWriter(OutDirMan.MakeOutFileName(file)))
     {
         sw.WriteLine(data);
     }
 }
Esempio n. 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);
         }
     }
 }
Esempio n. 3
0
 private void InitRes()
 {
     if (rw == null)
     {
         resourceFilePath = OutDirMan.MakeOutFileName(resourceFilePath);
         rw = new ResourceWriter(resourceFilePath);
     }
 }
Esempio n. 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);
        }
Esempio n. 5
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);
                }
            }
        }