How do I set the version of my Electron .NET app at build time via the command line?
I understand that I can set the buildVersion using the electron.manifest.json file, but I would like to be able to override this value from the command line so that my CI/CD pipeline can set the version.
I have tried using the /electron-params argument. For example:
electronize build /target win /electron-params "--c.buildVersion=23.0.3.0"
No matter what I do, or whatever property I set for the electron-params, I always get my app version as 1.0.0. I've tried checking the Electron .NET GitHub, as well as the electron-builder documentation, but it is unclear what I am suppose to use to get the version set in the command line.
Edit: I should note, the command above sets the FileVersion of the application. But the exe installer that is built is still named {ProductName} 1.0.0.exe. I would like to also be able to set that.
I have placed a PR for this. This should set the version arguments for both the
dotnet publish
andelectron-builder
. You will be able to set the version via the/Version
argument when callingelectronize
.