[RESOLVED] About Autorun [Next level]
Ok, I know now how to make CD autorun a certain file.
VB Code:
[autorun]
open=myapp.exe
icon=myicon.ico
Now, the next level I want to know is that, how do I make a program in VB6 that runs a certain file in the CD. Say for example, I want to run SetupMenu.exe located in the CD? This SetupMenu.exe is the menu of the files that needed to be installed from the CD. I want to do this because last year (december) I made a BINGO program in VB6 that, and packaged it. I used MS Agent control and i wanted to include the installer of the files needed to run ms agent properly, which is included in cd under "MS Agent" folder. How do I do this? Thank you in advance. (Be back later, I have school. :o )
Happy New Year to all!~~~
-Lex :wave:
Re: About Autorun [Next level]
If the VB program is going to be in the main folder and the SetupMenu.exe is going to be in another folder
D:\ CD Drive
---SetUpMenu Folder
------SetupMenu.exe
---You VB6 Program
Then you can use shell to open the program
VB Code:
Shell App.Path & "\Directory to the other Exe\ExeName.exe"
Re: About Autorun [Next level]
Remember that a VB6 program will not execute on computers running Windows 2000 or older due to missing runtime libraries. I think that the VB6 runtime libraries were only distributed from Win XP and later... ;)
What will happen if the user has Win 2000 or older, he will get an error when inserting the CD.
Re: About Autorun [Next level]
You can add the runtime files to the CD in the same location as the exe and it will run your VB 6 program from CD.
Re: About Autorun [Next level]
:blush: Sorry, I didn't think of that one!!! :thumb:
Re: About Autorun [Next level]
If you add the redistributable VB 6 runtime files then you are within licensing rules. :)
Re: About Autorun [Next level]
ok i will try these. thanks for the help, be back for updates :)
Re: About Autorun [Next level]
question? what do i include in the code if i want to just browse the CD contents?
VB Code:
Private Sub cmdButton_Click(Index As Integer)
Select Case Index
Case 0 'bingo main
Shell App.Path & "\Bingo.Files\CpE.Bingo\Setup.exe"
Case 1 'robby
Shell App.Path & "\Bingo.Files\MS.Agent\Robby.exe"
Case 2 'tts engine
Shell App.Path & "\Bingo.Files\MS.Agent\tv_enua.exe"
Case 3 'sapi 4.0
Shell App.Path & "\Bingo.Files\MS.Agent\spchapi.exe"
Case 4 'browse cd
[color=red]????[/color]
End Sub
Re: About Autorun [Next level]
ok, i just found out the solution to my problem, i just wanted some explanation about the code.
VB Code:
...
Case 4 'browse CD
CurrentDirectory = Left(App.Path, 3)
Shell "explorer " & CurrentDirectory, vbMaximizedFocus
...
what are these for? especially the "Left(App.Path, 3)" and the "explorer " part. What are the other 'stuff' aside from "explorer " that i can call? thanks~~~
Re: About Autorun [Next level]
CurrentDirectory = Left(App.Path, 3)
Its getting the first 3 characters of the path which will be the drive letter of the CDROM drive that your ap is located on if its on a CD.
Then the Shell line is starting an instance of Explorer set to the path of the CDROM root drive. It will open maximized to the location of the app.
Re: About Autorun [Next level]
ok now i get it. i am learning a lot from you guys~~ thank you very much.. this thread is now RESOLVED~~~ :)