Auto-boot vb program from cd

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Roy Riddex

    Auto-boot vb program from cd

    Hi

    I'm wanting to create a cd-rom which boots automatically when it's inserted
    into the computer. What I hope to achieve is for a VB6 program to run
    automatically when the cd boots up. Can this be done? if yes, then how?
    Also, how do I link a command button click to the opening of files within
    the cd, i.e. word, excel and access files?

    Thanks


  • the Wiz

    #2
    Re: Auto-boot vb program from cd

    "Roy Riddex" <roy_riddexNOSP AM@blueyonder.c o.uk> wrote:
    [color=blue]
    >Hi
    >
    >I'm wanting to create a cd-rom which boots automatically when it's inserted
    >into the computer. What I hope to achieve is for a VB6 program to run
    >automaticall y when the cd boots up. Can this be done? if yes, then how?
    >Also, how do I link a command button click to the opening of files within
    >the cd, i.e. word, excel and access files?
    >
    >Thanks
    >[/color]

    The term is autorun, not autoboot - which is a totally different animal.
    Autorun requires that the CD device be set for autorun/play and that the CD have
    and autorun.ini file that specifies what program is to be run.

    The "gotcha's" with VB is that you'll have to include the run time file and, if
    you use any ocx's, you'll have to register them on the target PC.

    More about me: http://www.jecarter.com/
    VB3/VB6/NSBasic Palm/C/PowerBasic source code: http://www.jecarter.com/programs.html
    Drivers for Pablo graphics tablet and JamCam cameras: http://home.earthlink.net/~mwbt/
    johnecarter at@at mindspring dot.dot com. Fix the obvious to reply by email.

    Comment

    • Roy Riddex

      #3
      Re: Auto-boot vb program from cd


      "the Wiz" <look@message.b ody> wrote in message
      news:97s2rvkcji 237a4775lbej752 bifp2sen1@4ax.c om...[color=blue]
      > "Roy Riddex" <roy_riddexNOSP AM@blueyonder.c o.uk> wrote:
      >[color=green]
      > >Hi
      > >
      > >I'm wanting to create a cd-rom which boots automatically when it's[/color][/color]
      inserted[color=blue][color=green]
      > >into the computer. What I hope to achieve is for a VB6 program to run
      > >automaticall y when the cd boots up. Can this be done? if yes, then how?
      > >Also, how do I link a command button click to the opening of files within
      > >the cd, i.e. word, excel and access files?
      > >
      > >Thanks
      > >[/color]
      >
      > The term is autorun, not autoboot - which is a totally different animal.
      > Autorun requires that the CD device be set for autorun/play and that the[/color]
      CD have[color=blue]
      > and autorun.ini file that specifies what program is to be run.
      >
      > The "gotcha's" with VB is that you'll have to include the run time file[/color]
      and, if[color=blue]
      > you use any ocx's, you'll have to register them on the target PC.
      >[/color]
      I'm sorry but I'm a newbie and most of what you just said doesn't mean
      anything to me. You've said what needs to be done without telling me how to
      do it. I don't know what a run time file?? ocx's?? register them on target
      pc?? what do you mean?


      Comment

      • QuickHare

        #4
        Re: Auto-boot vb program from cd

        > > >I'm wanting to create a cd-rom which boots automatically when it's[color=blue]
        > inserted[color=green][color=darkred]
        > > >into the computer. What I hope to achieve is for a VB6 program to run
        > > >automaticall y when the cd boots up. Can this be done? if yes, then how?
        > > >Also, how do I link a command button click to the opening of files[/color][/color][/color]
        within[color=blue][color=green][color=darkred]
        > > >the cd, i.e. word, excel and access files?[/color][/color][/color]
        The term is Autorun. It means to run a program from a CD when it is inserted
        into a Windows-based computer. This feature only works on Windows 95
        upwards.

        The way you do it is by putting the program on the CD as you normally would.
        This program needs a file to run, which may or may not be present on the
        computer you Autorun it on. However, this can be worked around by putting
        the "Run-time files" on the CD, in the same folder as the program
        (hopefully, not in a folder, but on the disc). For Visual Basic 4 programs,
        it MSVB4032.DLL, for Visual Basic 5 it MSVBVM50.DLL and Visual Basic 6 its
        MSVBVM60.DLL, any of which should be in your Windows folder on your
        hard-drive (typically C:\Windows or C:\Winnt - do a search if you don't
        know).
        Any extra features (controls) your program uses needs extra files which
        complicate things, so make it simple!
        Finally, this CD is useless without one final file, called "AUTORUN.IN F".
        This file tells Windows how it should Autorun the CD. It should contain the
        following lines:
        [autorun]
        open = program.exe
        icon = iconfile.ico
        The icon line doesn't have to be there. It's if you have a specific icon for
        the CD. Also, program.exe should be the name of your program on the disc,
        including any folders it's in on the CD. (eg "myapp.exe" ,
        "program\myapp. exe", etc)

        Once you have these files ready, burn the Autorun.inf file to the root of
        the CD (ie, not in any folder) and the program file and "run-time files" in
        the same folder, which is the folder written in Autorun.inf.

        Hope this now makes sense. It's easier as you get used to doing it.

        --
        QuickHare
        Remove the NOT HERE to email direct.


        Comment

        • the Wiz

          #5
          Re: Auto-boot vb program from cd

          "Roy Riddex" <roy_riddexNOSP AM@blueyonder.c o.uk> wrote:
          [color=blue]
          >
          >"the Wiz" <look@message.b ody> wrote in message
          >news:97s2rvkcj i237a4775lbej75 2bifp2sen1@4ax. com...[color=green]
          >> "Roy Riddex" <roy_riddexNOSP AM@blueyonder.c o.uk> wrote:
          >>[color=darkred]
          >> >Hi
          >> >
          >> >I'm wanting to create a cd-rom which boots automatically when it's[/color][/color]
          >inserted[color=green][color=darkred]
          >> >into the computer. What I hope to achieve is for a VB6 program to run
          >> >automaticall y when the cd boots up. Can this be done? if yes, then how?
          >> >Also, how do I link a command button click to the opening of files within
          >> >the cd, i.e. word, excel and access files?
          >> >
          >> >Thanks
          >> >[/color]
          >>
          >> The term is autorun, not autoboot - which is a totally different animal.
          >> Autorun requires that the CD device be set for autorun/play and that the[/color]
          >CD have[color=green]
          >> and autorun.ini file that specifies what program is to be run.
          >>
          >> The "gotcha's" with VB is that you'll have to include the run time file[/color]
          >and, if[color=green]
          >> you use any ocx's, you'll have to register them on the target PC.
          >>[/color]
          >I'm sorry but I'm a newbie and most of what you just said doesn't mean
          >anything to me. You've said what needs to be done without telling me how to
          >do it. I don't know what a run time file?? ocx's?? register them on target
          >pc?? what do you mean?
          >[/color]

          I think you just admitted to never reading any of the VB documentation ;-)

          VB does not create stand-alone executable programs. They require the VB run
          time file for support (this a .dll file that contains the code that supports the
          most common VB controls).

          VB also uses add-in controls (ocx files) such as the common dialog control. If
          you use this control in your program, you must include it in the distribution
          files.

          The OCX files must be registered with Windows so it can find them when they are
          referenced by a VB program. This is usually done with the regsvr32 program.

          If this is all still Greek to you, you need to get a good book on VB6
          programming. The "Integrated Project" course at the university used this one:
          Visual Basic 6 Programming
          Author: Jeffrey J. Tsay
          ISBN: 0-13-026199-8
          amazon.com has it for $69.33



          More about me: http://www.jecarter.com/
          VB3/VB6/NSBasic Palm/C/PowerBasic source code: http://www.jecarter.com/programs.html
          Drivers for Pablo graphics tablet and JamCam cameras: http://home.earthlink.net/~mwbt/
          johnecarter at@at mindspring dot.dot com. Fix the obvious to reply by email.

          Comment

          • Roy Riddex

            #6
            Re: Auto-boot vb program from cd

            >I think you just admitted to never reading any of the VB documentation ;-)

            lol, my version of VB6 was supplied by my college. It's on a student
            license, but the help library is on a different license which my college is
            unable to distribute. So when I'm programming at home all I have for
            reference is a beginners guide to VB6.
            [color=blue]
            >VB does not create stand-alone executable programs[/color]

            I haven't tried it yet but what happens when you select the option 'Make
            project.exe'?
            One last question. If I manage to complete the CD, will it be a stand alone
            cd that should run on any pc whether it has VB installed or not?




            Comment

            • J French

              #7
              Re: Auto-boot vb program from cd

              On Thu, 13 Nov 2003 10:20:23 -0000, "Roy Riddex"
              <roy_riddexNOSP AM@blueyonder.c o.uk> wrote:
              [color=blue][color=green]
              >>I think you just admitted to never reading any of the VB documentation ;-)[/color]
              >
              >lol, my version of VB6 was supplied by my college. It's on a student
              >license, but the help library is on a different license which my college is
              >unable to distribute. So when I'm programming at home all I have for
              >reference is a beginners guide to VB6.[/color]
              You really do need the Help Files
              - even if it means being devious
              - without them you are crippled
              - it amazes me that MS expect 'Academics' to work without them[color=blue]
              >[color=green]
              >>VB does not create stand-alone executable programs[/color]
              >
              >I haven't tried it yet but what happens when you select the option 'Make
              >project.exe' ?[/color]
              It should make an EXE
              That EXE *MUST* have MSVBVM60.DLL on the machine it runs on
              - ie: stick that on the CD with your EXE[color=blue]
              >One last question. If I manage to complete the CD, will it be a stand alone
              >cd that should run on any pc whether it has VB installed or not?[/color]

              If you do not use any OCXes whatsoever, then provided the EXE can find
              MSVBVM60.DLL the EXE is to all intents and purposes 'standalone'

              However, since you are very new to VB, you have probably used all
              sorts of interesting (and totally unnecessary) 'additional' controls.

              You can find out by using Notepad on your project's .VBP file
              (back it up first)

              If you *have* to distribute OCXes, then you need to produce an Install
              Pack
              - eg: a Setup system for your App

              Which is a PITA - and probably defeats the purpose of your system

              However, with a little care you *can* produce a 'standalone' CD that
              requires no installation, and runs cleanly from AutoRun.inf when the
              CD is inserted

              I know, I've been sending out just such a system for years

              HTH

              BTW, Rick Rothstein posted this link for VB Help/Reference online

              Watch for wrapping:



              Here it is as a TinyUrl :-




              [color=blue]
              >
              >[/color]

              Comment

              • Roy Riddex

                #8
                Re: Auto-boot vb program from cd

                [color=blue]
                > If you do not use any OCXes whatsoever, then provided the EXE can find
                > MSVBVM60.DLL the EXE is to all intents and purposes 'standalone'
                >
                > However, since you are very new to VB, you have probably used all
                > sorts of interesting (and totally unnecessary) 'additional' controls.
                >[/color]
                I'm still a little unsure about ocx's. All my program does is provide links
                to other files on the CD via several command buttons on one form. Is this
                basic enough to work as a stand alone?


                Comment

                • J French

                  #9
                  Re: Auto-boot vb program from cd

                  On Thu, 13 Nov 2003 22:41:45 -0000, "Roy Riddex"
                  <roy_riddexNOSP AM@blueyonder.c o.uk> wrote:
                  [color=blue]
                  >[color=green]
                  >> If you do not use any OCXes whatsoever, then provided the EXE can find
                  >> MSVBVM60.DLL the EXE is to all intents and purposes 'standalone'
                  >>
                  >> However, since you are very new to VB, you have probably used all
                  >> sorts of interesting (and totally unnecessary) 'additional' controls.
                  >>[/color]
                  >I'm still a little unsure about ocx's. All my program does is provide links
                  >to other files on the CD via several command buttons on one form. Is this
                  >basic enough to work as a stand alone?[/color]

                  If you are just using the 'basic' controls, then yes, that will be Ok

                  However, to save you agony, I suggest that you post your .VBP file
                  here, and we'll look over it

                  - when I first started with VB I added all sorts of things to the
                  project, to see what they did, and even though unused, they stayed
                  there. There are ways of removing them, but the safest thing is to
                  look at the references in the .VBP


                  Comment

                  • Roy Riddex

                    #10
                    Re: Auto-boot vb program from cd

                    > If you are just using the 'basic' controls, then yes, that will be Ok[color=blue]
                    >
                    > However, to save you agony, I suggest that you post your .VBP file
                    > here, and we'll look over it
                    >
                    > - when I first started with VB I added all sorts of things to the
                    > project, to see what they did, and even though unused, they stayed
                    > there. There are ways of removing them, but the safest thing is to
                    > look at the references in the .VBP
                    >[/color]
                    Thanks for the advice. My program isn't finished yet because the command
                    buttons aren't aimed at anything just yet. Only after I finalise the other
                    files to be on the disk can I finish off my VB program. It wont be for a few
                    weeks but if I have any probs I'll post the program for you to have a look
                    at.
                    Thanks again.


                    Comment

                    • J French

                      #11
                      Re: Auto-boot vb program from cd

                      On Fri, 14 Nov 2003 16:26:15 -0000, "Roy Riddex"
                      <roy_riddexNOSP AM@blueyonder.c o.uk> wrote:
                      [color=blue][color=green]
                      >> If you are just using the 'basic' controls, then yes, that will be Ok
                      >>
                      >> However, to save you agony, I suggest that you post your .VBP file
                      >> here, and we'll look over it
                      >>
                      >> - when I first started with VB I added all sorts of things to the
                      >> project, to see what they did, and even though unused, they stayed
                      >> there. There are ways of removing them, but the safest thing is to
                      >> look at the references in the .VBP
                      >>[/color]
                      >Thanks for the advice. My program isn't finished yet because the command
                      >buttons aren't aimed at anything just yet. Only after I finalise the other
                      >files to be on the disk can I finish off my VB program. It wont be for a few
                      >weeks but if I have any probs I'll post the program for you to have a look
                      >at.
                      >Thanks again.[/color]

                      No Problem

                      Comment

                      • Roy Riddex

                        #12
                        Re: Auto-boot vb program from cd

                        Grrr. I've been trying to use my VB book to learn how to open files but
                        still I have problems....
                        Here's my code for opening files through VB6:

                        Option Explicit
                        Dim Helpfile As String

                        Private Sub Form_Load()
                        Helpfile = App.Path & "\HelpFile. doc"
                        End Sub

                        Private Sub cmdHelp_Click()
                        Open Helpfile For Append As #1
                        End Sub

                        I've also tried typing out the complete path in the form load event but
                        still wont work. I hit the command button once but nothing happens so I hit
                        it again and I get a message saying the file is already open. I don't want
                        VB to do anything with the file or the data within the file, only to open it
                        (which I assume will then open MS Word in turn). To be honest, I aint sure
                        what 'Append as #1' does because the book doesn't make much sense to me.
                        It's probably a simple thing but omg it's really starting to annoy me, any
                        help would be greatly appreciated.


                        Comment

                        • Miles

                          #13
                          Re: Auto-boot vb program from cd



                          Roy Riddex wrote:[color=blue]
                          > Grrr. I've been trying to use my VB book to learn how to open files but
                          > still I have problems....
                          > Here's my code for opening files through VB6:
                          >
                          > Option Explicit
                          > Dim Helpfile As String
                          >
                          > Private Sub Form_Load()
                          > Helpfile = App.Path & "\HelpFile. doc"
                          > End Sub
                          >
                          > Private Sub cmdHelp_Click()
                          > Open Helpfile For Append As #1
                          > End Sub
                          >[/color]

                          Your open statement opens a file for output, not input. Any write
                          commands will add to the end (append) to an existing file or create a
                          new file if it doesn't already exist.

                          There are many ways to open a word document. One way is to use
                          shellexecute.

                          A better way is to use VB6's word reference. Within the VB6 editor
                          enable a reference to the word libary. Once thats done one way to open
                          a document would be as follows:

                          Dim ObJWod as Word.Applicatio n
                          Set ObjWord = New Word.Applicatio n
                          ObjWord.Documen ts.Open (strFilename)

                          Word is probably not the best way to make a help file though. Since it
                          displays an entire document as is not context sensitive. I use the
                          older windows .hlp files. You'll need a help editor and microsofts help
                          compiler (free) though. Current methods use html help files but I do
                          not like them. Much slower than the older .hlp files. Either way that
                          would make them context sensitive, able to index, search etc.


                          Comment

                          • J French

                            #14
                            Re: Auto-boot vb program from cd

                            On Sun, 16 Nov 2003 23:47:38 -0000, "Roy Riddex"
                            <roy_riddexNOSP AM@blueyonder.c o.uk> wrote:
                            [color=blue]
                            >Grrr. I've been trying to use my VB book to learn how to open files but
                            >still I have problems....
                            >Here's my code for opening files through VB6:
                            >
                            >Option Explicit
                            >Dim Helpfile As String
                            >
                            >Private Sub Form_Load()
                            > Helpfile = App.Path & "\HelpFile. doc"
                            >End Sub
                            >
                            >Private Sub cmdHelp_Click()
                            > Open Helpfile For Append As #1
                            >End Sub[/color]

                            Miles is quite right about the Append stuff

                            The real question is, however, *exactly* what you want to do

                            My guess is read the file into a Textbox in order to display it
                            - however I could be wrong

                            Comment

                            • Roy Riddex

                              #15
                              Re: Auto-boot vb program from cd

                              >>A better way is to use VB6's word reference. Within the VB6 editor
                              enable a reference to the word libary"

                              I haven't used this feature before, what is the VB6 editor?
                              [color=blue][color=green]
                              >>Word is probably not the best way to make a help file though. Since it
                              >>displays an entire document as is not context sensitive. I use the
                              >>older windows .hlp files. You'll need a help editor and microsofts help
                              >>compiler (free) though. Current methods use html help files but I do
                              >>not like them. Much slower than the older .hlp files. Either way that
                              >>would make them context sensitive, able to index, search etc.[/color][/color]

                              Thanks for the advice about help files. My word document is 2 pages max for
                              a small college project so I'll stick with using MS Word as the whole thing
                              seems to be getting more and more complicated.
                              [color=blue][color=green]
                              >>The real question is, however, *exactly* what you want to do
                              >>My guess is read the file into a Textbox in order to display it
                              >>- however I could be wrong[/color][/color]

                              As I said, I don't want VB to do anything with the file other than to act as
                              a shortcut to the file.
                              Here goes, I have a simple form which I hope to autorun when a cd is
                              inserted into the drive. All I want the form to do is provide links (via
                              command buttons) to allow a user to view the files. I need to be able to
                              provide links to word, access, excel and powerpoint files. I am completely
                              new to VB6 (aint programmed for over 10 years since school on bbc micro) and
                              I assumed having links to other files would be easy but so far it's been a
                              nightmare.
                              Can someone please tell me in simple terms how to link the pressing of a
                              command button to the opening of word and the opening of a document, or the
                              opening of powerpoint and the opening of a powerpoint file etc....



                              Comment

                              Working...