-
Hi folks,
I got this weird question and want to ask what you think of it. When you install a software, it has all these screen forms where you just click on Next to go on to the next screen and proceed installing. Is it possible in VB to program a code or record a macro such that it will just say yes to all the questions, like accepting all defaults so that the user doesn't click the NEXT button or YES button, it just proceeds to the installation process right away?
Does that mean you should have access to the source code of the installation process? What happens if the software is using Install Shield? Would this be possible at all or not?
Thanks!
-
Shore is. :)
1 way you can do it is through SendKeys, look at the code example in the VB help.
-
Hi Mr. Shickadance,
Thanks for the idea. Now I get what you mean. I looked at the example in MSDN, and this is the code for their sample.
Code:
Dim ReturnValue, I
ReturnValue = Shell("CALC.EXE", 1) ' Run Calculator.
AppActivate ReturnValue ' Activate the Calculator.
For I = 1 To 100 ' Set up counting loop.
SendKeys I & "{+}", True ' Send keystrokes to Calculator
Next I ' to add each value of I.
SendKeys "=", True ' Get grand total.
SendKeys "%{F4}", True ' Send ALT+F4 to close Calculator.
This runs the calculator.exe and adds 1+1+2+2....n+n... This is a cool example and it helps to understand what Sendkey function is really doing. But how do you manipulate the NEXT button in your setup.exe of the application? It's not as easy as numbers in the calculator. Help!
-
You should be able to send Tabs and Return. So, you have to know how many tabs you need per form.
-
Some install programs have command line parameters that can be used so that you can do exactly that, an unattended installation. Not sure where you could find out if your install program has it or not
-
and some buttons have captions pre-fixed with the '&' sybmol (the accelerator) and that means you use ALT + the following key.
Like ALT +F for the file menu
so you could still sendkeys
DocZaf
{;->