diff --git a/SecondStageUpdater/Program.cs b/SecondStageUpdater/Program.cs index 010bc1fb9..7bff839df 100644 --- a/SecondStageUpdater/Program.cs +++ b/SecondStageUpdater/Program.cs @@ -143,9 +143,17 @@ private static void Main(string[] args) try { FileInfo copiedFile = SafePath.GetFile(baseDirectory.FullName, relativeFileName); + bool isReadOnly = copiedFile.IsReadOnly; Write($"Updating {relativeFileName}"); + + if (isReadOnly) + copiedFile.IsReadOnly = false; + fileInfo.CopyTo(copiedFile.FullName, true); + + if (isReadOnly) + copiedFile.IsReadOnly = true; } catch (Exception ex) {