[RESOLVED] Generating Exe from exe
I want to make a simple program. But I don;t know how.
I want to make an exe generator.
In this; there will be dialog with one edit box and one button (labeled "generate exe"). when user will click on "generate exe" button. An exe will be generated; when user will run the generated exe it will show a message box which will contain the same message as user entered in the edit box before generating exe.
I guess for this I need to generate the code(or cpp file) at run time then I need to compile it at runtime. But I don't know how.
Re: Generating Exe from exe
It would be pretty simple to do with Visual C++ installed on the target machine; otherwise you'll have to have at least some form of compiler available.
Re: Generating Exe from exe
Whole visual c++ in client's pc ??? or just run time and compiler. I guess runtime is already there in every windows pc.
How to compile an MFC (or any win32 that supports GUI) project from a running exe .
I can compile single cpp file like below.
http://msdn.microsoft.com/en-us/libr...39(VS.80).aspx
is cl is available by default in some folder or I have to copy it there in client machine; developer has it but I don't know about client ??
Re: Generating Exe from exe
Quote:
Originally Posted by
rahul.kulshreshtha
Whole visual c++ in client's pc ??? or just run time and compiler. I guess runtime is already there in every windows pc.
How to compile an MFC (or any win32 that supports GUI) project from a running exe .
I can compile single cpp file like below.
http://msdn.microsoft.com/en-us/libr...39(VS.80).aspx
is cl is available by default in some folder or I have to copy it there in client machine; developer has it but I don't know about client ??
Understand that you can't legally copy the cl.exe compiler onto a client machine.
What problem are you trying to solve by creating an application on-the-fly like this?
Re: Generating Exe from exe
Actually I am planning to make an exe (AboutUs.exe) that will show the name of developers. I don't want to store names in some db (like sqlite). I want to hard-code it in exe.
But everytime when a new developer comes I have to edit the code and recompile the exe. So now I am thinking to make some good GUI(may be editbox) where I will paste all the names and when I click on generate exe. It will generate the exe.
Actually this is a practice project; if it get succeed then I am planning to make a clone of webexe project
http://www.webexe.com/
Re: Generating Exe from exe
Instead of *.exe generation, why you don't want to consider to write one simple application (*.exe), which will display MessageBox with different text supplied by command line when application is launched?
Or instead of *.exe generation, generating some *.txt file with the text, from which application will read the data?
The other choice can be that the application will read the text from its String Table resource, which can be modified every time when you whant to change the text. Modification *.exe file resources can be done using BeginUpdateResource, UpdateResource and EndUpdateResource functions. So you will have one executable with default resources, which can be modified every time you want to change the text.
Also here is an example of updating *.exe file resources.
Re: Generating Exe from exe
Yes those are my last choices. My main target is to 'dynamically create an exe at client's PC'. After ignoring all these facilities; if developer needs to do this then? is there any license that is needed to do it. How webexe is possible to do this. Even I have seen some other softwares which can do this.
Another example is a setup builder like innosetup or InstallJammer(my favorite).
They can create an exe on the fly then there should be some way. I guess it should not require any license for it.
Re: Generating Exe from exe
Quote:
Originally Posted by
rahul.kulshreshtha
Another example is a setup builder like innosetup or InstallJammer(my favorite).
They can create an exe on the fly then there should be some way.
Understand that these setup programs don't create executables on the fly on client machines. They simple compressed existing exes into a package and then expand them on the client. In other words, they aren't compiling, linking and creating any binaries on the client.
Re: Generating Exe from exe
Quote:
Originally Posted by
rahul.kulshreshtha
Actually this is a practice project; if it get succeed then I am planning to make a clone of webexe project
http://www.webexe.com/
However, you don't know how products such as this do their job. Once you know that, then you have a starting point.
I am taking a guess here, but more than likely, an app like the one you're trying to emulate analyzes the web pages, and from there creates resource information based on the web pages. Then this app attaches a new set of resources to a general app that knows how to display these resources as web pages.. The general app knows nothing about what the final resources are -- all it knows is that given a set of resources, it knows how to parse the resources into web pages and displays them.
So you have two apps -- one that reads the original web pages and creates resource information and attaches it to the second app. The second app takes the attached resource information and produces web pages.
The other poster already pointed out the functions to update resources -- but that should be the last thing you should be thinking about -- you don't even have a program that reads resource data and displays web pages based on that resource data.
Regards,
Paul McKenzie
Re: Generating Exe from exe
Thanks Arjay and Paul,
This was really a new knowledge for me. Now I understand that they don't create exe on the fly but they compresses those things.
and sure I will read about the updating resources.
Thanks again