From d0a7029131ee1b9ed2ea1d3ca1d0545cff13d2e4 Mon Sep 17 00:00:00 2001 From: SupSuper Date: Sat, 12 Oct 2019 22:55:15 +0100 Subject: MSVC: Fix missing internal_revision.h on clean builds Can't compare with a file that doesn't exist --- devtools/create_project/scripts/revision.vbs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'devtools') diff --git a/devtools/create_project/scripts/revision.vbs b/devtools/create_project/scripts/revision.vbs index 47eff423b2..7f0655dae1 100644 --- a/devtools/create_project/scripts/revision.vbs +++ b/devtools/create_project/scripts/revision.vbs @@ -489,12 +489,16 @@ Sub CompareFileAndReplace(src_filename, dst_filename) Set file = FSO.OpenTextFile(src_filename, 1, 0, 0) src_data = file.ReadAll file.Close - Set file = FSO.OpenTextFile(dst_filename, 1, 0, 0) - dst_data = file.ReadAll - file.Close - If StrComp(src_data, dst_data, vbBinaryCompare) <> 0 Then - ' Files are different, overwrite the destination + If Not FSO.FileExists(dst_filename) Then FSO.CopyFile src_filename, dst_filename, True + Else + Set file = FSO.OpenTextFile(dst_filename, 1, 0, 0) + dst_data = file.ReadAll + file.Close + If StrComp(src_data, dst_data, vbBinaryCompare) <> 0 Then + ' Files are different, overwrite the destination + FSO.CopyFile src_filename, dst_filename, True + End If End If ' Remove temporary source FSO.DeleteFile src_filename -- cgit v1.2.3