Date of EXE-Build is not correct

Hello,

I have a small problem / bug(?). When I build my Unity-App the Date of the EXE-File is about 3 months older than the current date (and its constant). The folder with the data has the correct date. Also webPlayer-Builds have the correct date.

Has anybody experienced something simliar??

regards knoggly

This is not a bug. The exe file simply doesn't change. This is because everything in your game is in the data folder, and the exe file is just the player. So the game is recreated when you build even though the exe file is still the same.

Put this C# code in Assets folder or any subfolder. It’ll update exe’s last modification date.


using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;

public class CopyDataFilesPostprocessor
{
    [PostProcessBuild]
    public static void OnPostprocessBuild (BuildTarget target, string pathToBuiltProject)
    {
        File.SetLastWriteTime(pathToBuiltProject, System.DateTime.Now);
    }
}