|
-
Jul 19th, 2004, 06:15 AM
#1
Thread Starter
New Member
How to creat exe file from my application on runtime
Hello everybody. I have a problem about how to creat exe file from my application on runtime. That is:
I have a program A, I want A can dynamic creat a program B on runtime. B have been custom by some parameter that user input to A.
How can I do this? Who can teach me? Thanks!!!
-
Jul 21st, 2004, 08:05 PM
#2
Thread Starter
New Member
-
Jul 21st, 2004, 11:37 PM
#3
Frenzied Member
you don't mean simply copy an exe from locatin x to the end user's hard-drive, do you? or do you mean actually spit out a newly compiled app? the latter wouldn't be possible since the programs you create in vb are not compilers. They're just desktop applications.
-
Jul 22nd, 2004, 01:18 AM
#4
Fanatic Member
this?
VB Code:
option strict on
imports system
imports system.io
imports system.diagnostics
imports system.windows.forms
public class example
inherits form
withevents b1 as new button()
withevents b2 as new button()
dim f as string="example"
sub new()
' button
b1.text="compile"
b1.setbounds(10,10,75,23)
b2.text="run"
b2.setbounds(10,38,75,23)
addhandler b1.click, addressof b1_click
addhandler b2.click, addressof b2_click
me.controls.addrange(new control(){b1,b2})
end sub
sub b1_click(sender as object,e as eventargs)
process.start("vbc",f & ".vb /r:system.dll,system.windows.forms.dll")
console.writeline("compiling...")
end sub
sub b2_click(sender as object,e as eventargs)
process.start(f)
console.writeline("running..")
end sub
shared sub main()
application.run(new example())
end sub
end class
-
Jul 22nd, 2004, 08:50 AM
#5
Originally posted by Andy
you don't mean simply copy an exe from locatin x to the end user's hard-drive, do you? or do you mean actually spit out a newly compiled app? the latter wouldn't be possible since the programs you create in vb are not compilers. They're just desktop applications.
Actually, .NET comes with classes that access the compiler that let you compile to IL.
Ive never worked with it before though, but I know its doable. And probably not that difficult.
-
Jul 22nd, 2004, 09:04 AM
#6
Frenzied Member
really? i would have never known that. thats interesting. what are some situations where you might need to compile as an end user?
-
Jul 22nd, 2004, 09:07 AM
#7
Maybe you want to write your own IDE and add compiling features to it. Or you want to add scritping type features to your app, but instead of creating your own language and uncompiled at that, you could let the user write full blown VB.NET or C# and your app can compile it at run time.
Just use your imagination.
-
Jul 22nd, 2004, 09:17 AM
#8
Frenzied Member
for lack of better words: nifty! lol
-
Jul 22nd, 2004, 07:16 PM
#9
Thread Starter
New Member
Thank you everybody!!! I get it.
-
Jul 22nd, 2004, 09:24 PM
#10
PowerPoster
We have a guy at work that is creating a class, compiling it to a dll, then loading that dll in its own app domain running it using reflection, then unloading the dll after he is done.
This is so very much possible.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|