CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2011
    Posts
    4

    Question Help referencing embedded programs...

    Hey there guys. So here's my issue.

    I work for a university and we are switching antiviruses. We want to uninstall the old one and install the new one silently. We have a .vbe file that successfully uninstalls the old antivirus silently, and we have the .exe file that installs the new antivirus. What we need to figure out is how to bundle both of these files into one program and have the program run them.

    Sounds simple enough to me, but my co-worker and I can't figure out how to reference the programs to have them run. To be honest we're not even entirely sure if we've placed them properly inside the program to begin with. It'd be nice if someone could shed some light on the proper procedure in how to do this.

    I'm a hardware engineer and my co-worker is a network engineer, so we're by no means programming experts, but we have written a few scripts and programs here and there so we know enough to get by.

    We're using Visual C# 2010 Express... .Net 4.0.30319.

    Thanks for any help!

  2. #2
    Join Date
    Dec 2007
    Posts
    234

    Re: Help referencing embedded programs...

    Search MSDN Online for Process.Start ... http://msdn.microsoft.com/en-us/libr...ess.start.aspx
    You can pass it the path and filename of your apps to run. So you would need two calls. The first for the vbe to do the uninstall and a second to run the exe for the new install.

    -tg
    * I don't respond to private requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help - how to remove eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to???
    * On Error Resume Next is error ignoring, not error handling(tm). * Use Offensive Programming, not Defensive Programming.
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN
    MVP '06-'10

  3. #3
    Join Date
    Jan 2011
    Posts
    4

    Re: Help referencing embedded programs...

    Thanks for the reply, but my issue is about knowing the file path of the programs. We're wanting to embed them INTO the program. So the filepath wont be anything like "c:\users\...." We're trying to bundle the exe and the .vbe into the program so that we don't have to send out the files seperately.

    What we're trying to avoid here is having the program access the files over the network, and also avoid putting everything on cds and distributing them. We're wanting to just make this program, have it all bundled into itself and then place that on our website.

  4. #4
    Join Date
    Dec 2007
    Posts
    234

    Re: Help referencing embedded programs...

    You can add them as a resource... but at that point, they are just binary bits as far as the application is concerned. But that really isn't a problem. Disclaimer: I've never physically done this myself, but I've seen others do this with some success. Once you've added them as a resource, in order to run them, you'll need to extract them and write their bits out. Once you've written them out - essentially restoring the files to disc - then you can use the process.start method to run the application. And since you wrote out the files, you know where they are.

    Make sense?
    -tg
    * I don't respond to private requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help - how to remove eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to???
    * On Error Resume Next is error ignoring, not error handling(tm). * Use Offensive Programming, not Defensive Programming.
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN
    MVP '06-'10

  5. #5
    Join Date
    Jan 2011
    Posts
    4

    Re: Help referencing embedded programs...

    Alright, i think i see where you're going with that. We'll give it a go. I'll get back here with our results. Thanks for the insight!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured