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