K
K
kokapuk2021-09-18 15:39:22
C++ / C#
kokapuk, 2021-09-18 15:39:22

How to create an .exe file?

Hello, let's say I have a window application that, when a button is pressed, will create another such exe, a window application, but at the same time, for example, with a different text on the button. How to implement this? The reason for the question was the exe generator in winrar, which generates a self-extracting archive with certain files.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2021-09-18
@kokapuk

WinRar works differently. It takes a static SFX-Stub (actually the main static .exe that comes with the archiver, which can read the config at the end of its own file and unpack the archive following the config) to which the configuration file is "glued" (literally appended to the end of the file), which contains necessary headers, paths, etc., and a rar archive is "glued" to it.
C# has a feature to compile source code on the fly .
It is not entirely clear what and why you need it.

H
HemulGM, 2021-09-18
@HemulGM

WinRAR uses the exe template. The same executable. Adds to it the resources and information that you filled in the "Wizard".
To solve your "problem", one program is enough, which accepts launch arguments. The name of the button is taken from the arguments. Ready. So, either describe the task in more detail, or study it yourself. The question sounds rather silly in the context of programming.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question