954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Visual Basic code for compiling an exe file.

Hi everyone!

I'm new to visual basic and i have been using it shortly.

I need a code which will help me compile an exe file based on some arguments or with the help of another VB file.

Thank you.

sharunks007
Newbie Poster
7 posts since Dec 2010
Reputation Points: 10
Solved Threads: 1
 

? are you asking how to build your project into an exe? or have a curent vb application build a new executable?

jlego
Posting Pro
529 posts since Mar 2009
Reputation Points: 31
Solved Threads: 41
 

I think he/she is referring on creating an EXE file but compiling it first.

If you create an EXE file of your VB Project, VB automatically compiles it and stops if there are any error on your program.

To check for errors more accurately, hit CTRL + F5 rather than just F5 (for testing purposes after each coding).

If this is what you mean that is.

abelingaw
Posting Whiz in Training
205 posts since Jun 2008
Reputation Points: 66
Solved Threads: 26
 
I need a code which will help me compile an exe file based on some arguments or with the help of another VB file

Rather use the "Package and Deployment" wizard that came with VB^ to compile your app.:)

It will refer back to errors if there are any, or compile if all is fine. Don't try and re-invent the wheel if it already exists.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 
? are you asking how to build your project into an exe? or have a curent vb application build a new executable?

I need to have a current vb app to build a new executable...

sharunks007
Newbie Poster
7 posts since Dec 2010
Reputation Points: 10
Solved Threads: 1
 

I'm not sure what it is exactly that you need to do here? Firstly, you needed to know how to compile an application, now you need an application. I'm confused...

Give us some more information please.:)

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Ok. Let me make things clear......
There are some apps like WinRar and Winzip that can make exe files (on runtime) with options given by the user.
Is it possible to do something similar in Visual Basic or should I download some reference dll?

sharunks007
Newbie Poster
7 posts since Dec 2010
Reputation Points: 10
Solved Threads: 1
 
some apps like WinRar and Winzip that can make exe files

They do not create .exe files, only compress/decompress EXISTING .exe files.

If you want to compile an .exe, you need to get an installer app, of which VB6 has the
"Package and Deployment" wizard.

If you want to compress/decompress files, use winzip or winrar's dll files in your code.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 
They do not create .exe files, only compress/decompress EXISTING .exe files.


Not true. There is a setting to create the archive as an EXE file. When you execute this file the archive is decompressed automatically. Not sure exactly how they do it, though. I assume they have the 'exe' file front end that the archive is appended to as a data segment.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,507 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

I'll have to delft into this a bit more, will see what time permits tomorrow. I have checked my version (fairly new) and I have no option to zip into an exe though.

Will post a solution if I can tomorrow.:)

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Have you considered the possibility of having a previously compiled program that uses a data file, or perhaps the Registry, to get information that would be entered when your programs are installed? Just a thought ...

chuckc
Newbie Poster
15 posts since Nov 2009
Reputation Points: 13
Solved Threads: 0
 

are you saying, in the installation windows (like windows installer), the user can check options upfront, and the executable is built based on those selections?

jlego
Posting Pro
529 posts since Mar 2009
Reputation Points: 31
Solved Threads: 41
 

or are you saying, inside a vb6 program that you have, you want to allow the user to select options, and build another exe based on what they entered in the first application?

jlego
Posting Pro
529 posts since Mar 2009
Reputation Points: 31
Solved Threads: 41
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: