Update the pre-build events to prevent file is already open errors

This commit is contained in:
cdozdil
2026-02-10 02:16:09 +03:00
parent f28ae3e053
commit 6b2226521c
+2 -4
View File
@@ -261,8 +261,7 @@ copy "$(SolutionDir)external\directx_agility_sdk\LICENSE.txt" $(SolutionDir)x64\
copy NUL "$(SolutionDir)x64\Release\a\!! EXTRACT ALL FILES TO GAME FOLDER !!" /Y</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>powershell -Command "Start-Sleep -Seconds 2; $date = Get-Date -Format 'yyyyMMdd_HHmmss'; Set-Content -Path '$(ProjectDir)resource_build_date.h' -Value ('#define VER_BUILD_DATE ""' + $date + '"""')
powershell -Command "Start-Sleep -Seconds 2; $commit = git rev-parse --short HEAD; Set-Content -Path '$(ProjectDir)resource_build_commit.h' -Value ('#define VER_BUILD_COMMIT ""' + $commit + '"""')</Command>
<Command>powershell -NoProfile -Command "$date = Get-Date -Format 'yyyyMMdd_HHmmss'; $commit = git rev-parse --short HEAD; Set-Content -Path '$(ProjectDir)resource_build_date.h' -Value ('#define VER_BUILD_DATE \"' + $date + '\"') -Force; Set-Content -Path '$(ProjectDir)resource_build_commit.h' -Value ('#define VER_BUILD_COMMIT \"' + $commit + '\"') -Force;"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDebug|x64'">
@@ -294,8 +293,7 @@ powershell -Command "Start-Sleep -Seconds 2; $commit = git rev-parse --short HEA
<Command>powershell -Command "$timestamp = Get-Date -Format 'yyyyMMdd_HHmmss'; $fileName = '$(OutDir)OptiScaler_' + $timestamp + '.7z'; $backupFileName = '$(OutDir)OptiScaler_' + $timestamp + '_Backup.7z'; &amp; '7z.exe' a -t7z $fileName '$(TargetPath)'; &amp; '7z.exe' a -t7z $backupFileName '$(OutDir)$(TargetName).*'"</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>powershell -Command "Start-Sleep -Seconds 2; $date = Get-Date -Format 'yyyyMMdd_HHmmss'; Set-Content -Path '$(ProjectDir)resource_build_date.h' -Value ('#define VER_BUILD_DATE ""' + $date + '"""')
powershell -Command "Start-Sleep -Seconds 2; $commit = git rev-parse --short HEAD; Set-Content -Path '$(ProjectDir)resource_build_commit.h' -Value ('#define VER_BUILD_COMMIT ""' + $commit + '"""')</Command>
<Command>powershell -NoProfile -Command "$date = Get-Date -Format 'yyyyMMdd_HHmmss'; $commit = git rev-parse --short HEAD; Set-Content -Path '$(ProjectDir)resource_build_date.h' -Value ('#define VER_BUILD_DATE \"' + $date + '\"') -Force; Set-Content -Path '$(ProjectDir)resource_build_commit.h' -Value ('#define VER_BUILD_COMMIT \"' + $commit + '\"') -Force;"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>