This is PowerShell
(https://learn.microsoft.com/en-us/powershell/) script for generating and maintaining 2 files: mod.yaml
and mod_info.yaml
, required as part of mod making for the game Oxygen Not Included.
In your c# project create folder Engine
and put inside AssemblyInfo.cs
which should contain at least the version information and the tile:
[assembly: AssemblyTitle("FavoriteBuildings")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
In Directory.props
or .csproj
of your c# project add:
<PropertyGroup>
<LibDir>your_path</LibDir>
</PropertyGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="PowerShell -executionpolicy bypass -File "$(LibDir)update-version-script.ps1" -assemblyInfoPath "$(ProjectDir)Engine\AssemblyInfo.cs" -modInfoPath "$(ProjectDir)mod_info.yaml"" ContinueOnError="false" />
</Target>
As you can see it is using the paths as the arguments, so if you want - you can easily edit it.
Change LibDir
to the path of the directory where you located the update-version-script.ps
Each time the you will build the project, it will generate mod.yaml
and mod_info.yaml
files for you.
The only thing you would need to maintain - is the game build number, which is stored in update-version-script.ps
, at the time of posting it is 619020
supportedContent: ALL
minimumSupportedBuild: 619020 # this number is stored in update-version-script.ps
APIVersion: 2
version: 1.0.0.0 #this will be changed to your project version from AssemblyInfo.cs
staticID: FavoriteBuildings # the name will be taken from your Project Name, stored in AssemblyTitle of the AssemblyInfo.cs