Hi,
i was wondering if anyone knows how to get a VB 2008 project to run a .exe from withinside it???
say i wanted a muti installer...with the installer packages embedded inside it....is it possible to call tghe .exe by clicking a button?
i hope you understand what im saying.
How to run a .exe from inside a VB 2008 project?a little help here please?
16 Replies - 25679 Views - Last Post: 22 August 2011 - 04:41 AM
Replies To: How to run a .exe from inside a VB 2008 project?
#2
Re: How to run a .exe from inside a VB 2008 project?
Posted 20 October 2008 - 06:37 AM
Take a look at this article on Bootstrapping with VB.NET. Though this article is written for VB 2005 I believe it works the same way for 2008
#3
Re: How to run a .exe from inside a VB 2008 project?
Posted 22 October 2008 - 09:00 AM
this didn't help sorry
#4
Re: How to run a .exe from inside a VB 2008 project?
Posted 22 October 2008 - 04:40 PM
I am not following your OP to well, at first I thought you just wanted to know how to start a process, then it sounded like you wanted the setup program to allow the user to select which MSI file to install during the setup, however I am more leaning towards you wanting to embed msi files within an exe then have that application execute them when the user clicks a button within the application.
Maybe try to clarify your requirements a bit more. And if it is the later what are you really trying to accomplish.
Maybe try to clarify your requirements a bit more. And if it is the later what are you really trying to accomplish.
This post has been edited by magicmonkey: 22 October 2008 - 04:41 PM
#5
Re: How to run a .exe from inside a VB 2008 project?
Posted 22 October 2008 - 05:41 PM
'will run an executable file called myfile.exe
Process.Start("c:\myTestFolder\myfile.exe")
Works for me.
Process.Start("c:\myTestFolder\myfile.exe")
Works for me.
#6
Re: How to run a .exe from inside a VB 2008 project?
Posted 23 October 2008 - 03:48 AM
Ok... i am trying to embed a .msi file
and i want that so when a user clicks "Install" it opens up the embeded .msi file
i hope this makes more sense
and i want that so when a user clicks "Install" it opens up the embeded .msi file
i hope this makes more sense
#7
Re: How to run a .exe from inside a VB 2008 project?
Posted 23 October 2008 - 05:59 AM
let me guess.u want to add it to the recources but don't know how to open them?
u can add it to the recources but i don't know how to use it,at least don't know yet
u can add it to the recources but i don't know how to use it,at least don't know yet
#8
Re: How to run a .exe from inside a VB 2008 project?
Posted 23 October 2008 - 07:56 AM
I'm not sure if I would want to embed a MSI file, there must be a better solution. However... Open up the project properties window, select the resources tab, expand add resource and select Add Existing File..., select you MSI file(s). They are now embedded as resources. Now in your click event to install...
Dim SetupPath As String = Application.StartupPath & "\Setup.msi"
Using sCreateMSIFile As New FileStream(SetupPath, FileMode.Create)
sCreateMSIFile.Write(My.Resources.Setup, 0, My.Resources.Setup.Length)
End Using
Process.Start(SetupPath)
#9
Re: How to run a .exe from inside a VB 2008 project?
Posted 23 October 2008 - 08:14 AM
#10
Re: How to run a .exe from inside a VB 2008 project?
Posted 23 October 2008 - 03:58 PM
yh but I'd rather learn the code since it'll help me in later life when i get to collage
i haven't had the chance to test the code yet but i'll tell you if it works as soon as i can ok.
i haven't had the chance to test the code yet but i'll tell you if it works as soon as i can ok.
#11
Re: How to run a .exe from inside a VB 2008 project?
Posted 23 October 2008 - 06:08 PM
You would be surprised how few people use VS for creating their installation packages
#12
Re: How to run a .exe from inside a VB 2008 project?
Posted 24 October 2008 - 01:50 PM
yh well i like the programming part .. better that the step by step setup installer like inno
#13
Re: How to run a .exe from inside a VB 2008 project?
Posted 21 April 2011 - 09:50 AM
magicmonkey you really are magic
this is perfect Just what I was Looking for great work and coding thanks your are the best
this is perfect Just what I was Looking for great work and coding thanks your are the best
#14
Re: How to run a .exe from inside a VB 2008 project?
Posted 21 April 2011 - 01:22 PM
Take a look at this if you want to extract and run a .msi file:
And to use it:
Finally to delete the temporary file:
InstPrc is of course the process of the .msi installer.
Hope it helps!
Private Shared Function Extract(ByVal Path As String, ByVal RunIn As String) As Process
My.Computer.FileSystem.WriteAllBytes(My.Resources.Installer)
Dim Inf As New ProcessStartInfo
Inf.FileName = Path
Inf.WorkingDirectory = RunIn
Dim Prc As Process = Process.Start(Inf)
Return Prc
End Function
And to use it:
Dim InstPrc As Process = Extract(My.Computer.FileSystem.CurrentDirectory & "\Installer.msi", My.Computer.FileSystem.SpecialDirectories.MyDocuments)
Finally to delete the temporary file:
My.Computer.FileSystem.DeleteFile(My.Computer.FileSystem.CurrentDirectory & "\Installer.msi")
InstPrc is of course the process of the .msi installer.
Hope it helps!
#15
Re: How to run a .exe from inside a VB 2008 project?
Posted 21 August 2011 - 09:08 PM
DCB, on 22 October 2008 - 05:41 PM, said:
'will run an executable file called myfile.exe
Process.Start("c:\myTestFolder\myfile.exe")
Works for me.
Process.Start("c:\myTestFolder\myfile.exe")
Works for me.
Hi DCB,
I know this is an old post but I would still appreciate your help.
I am doing a VB project and have added a .exe file to the project. On the Project Properties page -> Publish -> Application Files, the .exe file I added to the project is shown there. The problem is when I put the Process.Start(C:MyFileFolder\myfile.exe) hard code path to the file on my button click event it works ok, however I want a way to use a generic path that will be recognized on another machine after publishing.
I also tried this Process.Start("c:\|DataDirectory|\myfile.exe"), but I got a error message that "The system cannot find the file specified".
Any assistance will be appreciated.
Regards,
Rehtnapc
|
|

New Topic/Question
Reply




MultiQuote







|