opentelemetry-collector-releases
opentelemetry-collector-releases copied to clipboard
How to produce exe or msi executable file from OCB custom builder
I have successfully generated a no extension from OCB in Windows. However, I am not able to change it to exe or msi file from it.
I can use ocb.exe with my custom builder-config.ymal to compile as binary. However, I cant see a way of converting it
Hello @DesAWSume! I'm Dosu, here to help you with bugs, questions, and contributing. While you wait for a human maintainer, feel free to ask me anything!
To produce an exe or msi executable file from the OpenTelemetry Collector Builder (OCB) on Windows, you can follow these steps:
-
Use Goreleaser: The OpenTelemetry Collector repository uses
goreleaserto assist in converting binaries to Windows executable formats. Ensure that your.goreleaser.yamlfile includes configurations for Windows builds and MSI packaging. -
Define MSI Configuration: In the
.goreleaser.yamlfile, specify the MSI configuration under themsisection. This includes the MSI ID, name template, WXS file, and any extra files to be included in the MSI package. -
Build Configuration: Ensure that the build configuration for Windows is defined under the
buildssection, specifying the target OS and architecture for the binary. -
Run Goreleaser: Execute
goreleaserto package the binaries into MSI files. This tool will handle the conversion to Windows executable formats, including MSI packages.
These steps should help you convert your OCB-generated binary into exe or msi files using the configurations in the .goreleaser.yaml file [1].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
Firstly, I don't think this is the correct repository for this issue. I think you should open this issue in opentelemetry-collector-contrib where the builder component exists, since this appears to be an issue about the builder and not this particular releases repo.
However, I am not able to change it to exe
In my experience a rename does the trick here, can you provide more details why that didn't work?
or msi file from it.
msi file does not come from OCB. In this repo, they get MSIs via an pro feature of goreleaser which is a separate tool.
@braydonk Thanks for answering this, and appreciated the response.
I have also tried renamed the file into .exe and .msi, Unlike Linux distribution, the output file can run as service whereas windows is just a binary
Renamed to .exe
After clicking it, it does like a ocb.exe
Renamed it to .msi, and it will tell you not a executable that windows can run
Renamed it to .msi, and it will tell you not a executable that windows can run
Yes, to be clear you cannot get an msi from ocb. Renaming it to .exe works because the file produced is a Windows Executable. Adding the extension is a formality so Windows knows, but under the hood it is still always a Windows executable file. It is not an msi file, and changing the file name to .msi does not change that. To get an msi you will need to build one yourself, or use the pro features of goreleaser that this repo also uses.
I passed the config flag to the renamed binary and run this in an elevated Powershell session, it doesn't seem to hold the session but closed itself. However, if i run it in PS ISE will keep the session going.
If we use the renamed .exe, what is the best way of running as a backend process in some sort of quiet mode and make sure it runs as the server start or restart
I can think of a task scheduler, any other better way for windows?
This issue has been closed as inactive because it has been stale for 120 days with no activity.