How to modify properties of final compiled .exe file on the windows standalone platform?

I think the issue is that UNITY_VERSION_WIN is a number while it is expecting a string. Try replacing it with "" or "My Product Name"

Alternatively you could completely delete that line from the .rc file.

I found this thread partially helpful but in my result build from the Visual Studio SLN Unity outputs, it breaks my references to streaming assets. This is a Windows exe build.

The directory structure of the output builds is that standard build/bin/x64/Master, which I suspect is problematic because I want my result application to look -just- like a Unity build i.e. the app sits next to its _Data folder in the root of the application, not 4 directories up and around the corner. So, if I put the x64 exe output into the root where it should be, I lose all my speech recognition models in StreamingAssets under the _Data folder.

What do I do about that? How can I make the structure proper?
My builds straight from Unity have no such issue, but then my app properties are generic and come with a Unity copyright stamp and I don’t want that.

Catch 22 so far, search queries on this subject lead nowhere because if you look up “unity visual studio build streamingassets path issues/wrong/structure/etc” you get nothing specific from those search queries and all the various issues people cite are absolute red herrings for my current problem. This is the only thread I’ve learned much of anything from that contains these terms

Silly to me because why bother entering my Company and Product info if it’s not going to be appended to the output build Exe from Unity?

Going over to VSCode where they don’t care if I lose my streamingassets when they make my “fancy” exe with 6 string properties reassigned [heaven forbid] seems like it shouldn’t be the move but here I am.

So first of all, yes, Visual Studio solution builds a little different folder structure. Instead of the usual:

Game_Data
Game.exe
UnityPlayer.dll

You get:

Game_Data
<ARCHITECTURE>\<CONFIG>\Game.exe
<ARCHITECTURE>\<CONFIG>\UnityPlayer.dll

What this allows doing is sharing the same data folder for several different game build configurations: you might want to ship both 32-bit and 64-bit player and duplicating the data folder would double the size of your game. This allows you only have one copy of it. It also makes builds faster because Unity and Visual Studio does not need to copy the data folder into each possible configuration output folder.

You can take all the files from “x64\Release”, move them 2 directories up and get rid of architecture specific folders. You could also just do normal builds from Unity, and replace the resulting .exe after the build with the one that you premade from a built Visual Studio project previously.

That said, I don’t understand how this breaks your streaming assets. Are you calculating the paths yourself or something? Application.streamingAssetsPath should point to the right folder regardless of how the build is made.

I think it sets the game title in the titlebar and also uses that information to compute log paths and Application.persistentDataPath.

It’s hard to say -why- but basically after attempting the build like this and having no visible errors, the built app cannot access the StreamingAssets path, but inside Unity everything works perfectly. I can’t tell what parameters might have been altered or whether Plastic SCM isn’t detecting a difference, but even with rollback attempts, the results are the same now.

If I attach a debugger to the build, it just indicates “model of model provider is null” out of the Vosk/Recognissimo libraries

We had this same sort of error last week on an unrelated path on our Mac Studio running 2022.1.16f1 - before any of this came up, and to solve it we had to upgrade Unity to 2022.1.20f1 and that stopped the inexplicable “no streaming assets found at [the path is valid ?!, it’s right there why is it null]”

So I am not even sure if the issue is strictly related to any attempt to build VS Solutions out of the project. The project worked fine for months, then stopped having Speech Recognition on builds on the Mac suddenly, only solved by upgrading Unity 0.04 versions. Then we thought everything was good, then I tried to customize the App Details on Windows and otherwise found this thread helpful, except then the same error on a totally different platform.

Details are scant on why.

One thing I can tell you is on the PC here after this Solution build attempt, Unity now adds the WinPixEventRuntime.dll to my build folder, which it never did before. I don’t tend to run debug builds.

Not sure if any of those facts are clues but like I said, same TYPE of error but seemingly different cause on Mac vs Windows, on Mac, upgrading solved it. The other workstations were upgraded to match, then after VS build, PC goes down with the same problem and Mac version build is unaffected.

And for the record, all the code I write and the code in the packages I’m using for Speech Recognition all refer to “Application.streamingAssetsPath” or “Application.persistentDataPath” explicitly rather than some hardcoded path.

WinPixEventRuntime.dll is used by development builds, which map to “Release” configuration in Visual Studio. To build non-development builds, use the “Master” configuration.

Good evening, your answers helped me a lot, I just posted a question, could you please look at it?
https://discussions.unity.com/t/898700

Hello, I am using Unity 2021.3.9f1 and Visual Studio 2019
I created the solution and modified the WindowsPlayerVersion.rc by Notepad and just changed the values.

#include <windows.h>
#include "UnityConfiguration.gen.cpp"

VS_VERSION_INFO VERSIONINFO
FILEVERSION UNITY_VERSION_VER,UNITY_VERSION_MAJ,UNITY_VERSION_MIN
PRODUCTVERSION UNITY_VERSION_VER,UNITY_VERSION_MAJ,UNITY_VERSION_MIN
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x0L
FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "FileVersion", "2.10.0.10800"
            VALUE "ProductVersion", "2.1.0"
            VALUE "Unity Version", "2021"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

But when I rebuild the solution in Visual Studio and check the exe file. I’m still getting empty values.

8562899--1145762--upload_2022-11-4_16-40-27.png

Can you show the full WindowsPlayerVersion.rc file after your edits?

It’s in my previous post. All I did was change the value of the FileVersion, ProductVersion, Unity Version

#include <windows.h>
#include "UnityConfiguration.gen.cpp"
VS_VERSION_INFO VERSIONINFO
FILEVERSION UNITY_VERSION_VER,UNITY_VERSION_MAJ,UNITY_VERSION_MIN
PRODUCTVERSION UNITY_VERSION_VER,UNITY_VERSION_MAJ,UNITY_VERSION_MIN
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x0L
FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "FileVersion", "2.10.0.10800"
            VALUE "ProductVersion", "2.1.0"
            VALUE "Unity Version", "2021"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

You might have to change these too:

FILEVERSION UNITY_VERSION_VER,UNITY_VERSION_MAJ,UNITY_VERSION_MIN
PRODUCTVERSION UNITY_VERSION_VER,UNITY_VERSION_MAJ,UNITY_VERSION_MIN
#include <windows.h>
#include "UnityConfiguration.gen.cpp"

VS_VERSION_INFO VERSIONINFO
    FILEVERSION 1, 0, 0, 0
    PRODUCTVERSION 1, 0, 0, 0
    FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x0L
FILESUBTYPE 0x0L

BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
            BEGIN
                VALUE "Comments", "Tenta a tua Sorte!"
                VALUE "CompanyName", "Adsglobal"
                VALUE "FileDescription", "Jogo Simples"
                VALUE "FileVersion", "1.0.0.0"
                VALUE "InternalName", "Tenta a Sorte"
                VALUE "LegalCopyright", "Copyright © Rodrigo Santos 2020"
                VALUE "OriginalName", "Tenta a Sorte"
                VALUE "ProductName", "Tenta a Sorte"
                VALUE "ProductVersion", "1.0.0.0"
            END
    END
    BLOCK "VarFileInfo"
        BEGIN
            VALUE "Translation", 0x0816, 1200
        END
END

No. I did it like this and I am still getting empty results. I even started with a brand new Unity 2021.3.9f1 project.

Turns out it does work.
Before, for some reason, when I build in my folder that is linked to my cloud account, (Box.com), I was unable to see the properties.
I then built it on a local folder, (C:\temp), and it works perfectly.

1 Like

Sorry for delayed response… this fixed the problem. Thanks!

https://github.com/electron/rcedit
I prefer to use this, especially when you already have a auto pubulic work flow

2 Likes

I simple use the resource hacker tool for my exe files, very easy to use and works fine ^^ :slight_smile:
open the exe file → edit → compile script → save as new exe file or replace.
But it would be great when we can edit this in player settings before we compile.

http://angusj.com/resourcehacker/

Hi was going through the steps in this forum but when i tried to build my project through the Sln i got these errors

You should be able to right click on the solution file in the solution explorer and press “Retarget solution”.

Made a package that modifies file properties on build post-process via rcedit.

1 Like

If you are building a exe to distribute your Unity game.
I wrote as asset that’s now up on the unity store to manage the exe metadata so your company, version, and copyright are embedded - rather than Unity’s!