From 9f2b1a88bf01416a4afa1500fdc4d77f6da09f25 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 5 Feb 2013 16:38:07 +0000 Subject: [PATCH] Fixed problem of wstalrall format and genmac files were not copied into the fmtall and genmacall folders --- PROMS/fmtxml/Form1.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PROMS/fmtxml/Form1.cs b/PROMS/fmtxml/Form1.cs index adeb49cd..418c402a 100644 --- a/PROMS/fmtxml/Form1.cs +++ b/PROMS/fmtxml/Form1.cs @@ -597,9 +597,11 @@ namespace fmtxml { FileInfo fi1 = new FileInfo(Application.StartupPath + "\\" + fileName); FileInfo fi2 = new FileInfo(@"..\..\" + fileName); - if (fi2.Exists && fi1.Exists && fi2.LastAccessTimeUtc > fi1.LastAccessTimeUtc) + if (fi2.Exists && (!fi1.Exists ||(fi1.Exists && fi2.LastAccessTimeUtc > fi1.LastAccessTimeUtc))) { + if (fi1.Exists && fi1.IsReadOnly) fi1.IsReadOnly = false; fi2.CopyTo(fi1.FullName, true); + fi1 = new FileInfo(Application.StartupPath + "\\" + fileName); } if (fi1.Exists) { @@ -612,10 +614,11 @@ namespace fmtxml { FileInfo fi1 = new FileInfo(Application.StartupPath + "\\" + fileName); FileInfo fi2 = new FileInfo(@"..\..\" + fileName); - if (fi2.Exists && fi1.Exists && fi2.LastAccessTimeUtc > fi1.LastAccessTimeUtc) + if (fi2.Exists && (!fi1.Exists || (fi1.Exists && fi2.LastAccessTimeUtc > fi1.LastAccessTimeUtc))) { if (fi1.Exists && fi1.IsReadOnly) fi1.IsReadOnly = false; fi2.CopyTo(fi1.FullName, true); + fi1 = new FileInfo(Application.StartupPath + "\\" + fileName); } if (fi1.Exists) {