sarcus25
Programmer
- Apr 14, 2005
- 27
Hi I am trying to create a program that automatically runs a setup program (Install Shield 10.0). I have tried running the setup automatically using an .iss file but it doesn't work. I read somewhere that their is because of the way the programmers put the setup package together. Tried using send keys to Send the keystrokes to the app and I can only get past the inital screen. When it goes to the license Screen I should be able to send "Alt + Y" to accept the agreement but it does nothing. If I do it manually though it works. Any ideas? Thanks in advance. My code is below.
Code:
'Create a new instance of the process.
Dim myProcess As New Process()
myProcess.StartInfo.FileName = ProgramToRun
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
myProcess.EnableRaisingEvents = True
'Add a fuction to to things once the program has exited.
AddHandler myProcess.Exited, AddressOf Me.SendKeysTestExited
myProcess.Start()
'Wait 5 Seconds for the setup file to load.
myProcess.WaitForInputIdle(5000)
'Hitting The Next button
SendKeys.Send("%n")
Thread.Sleep(3000)
'This is accepting the license agreement.(doesn't work)
SendKeys.Send("%y")
Thread.Sleep(3000)
SendKeys.Send("ENTER")
SendKeys.Send("DOWN") 'Set it to not reboot.
SendKeys.Send("TAB")
SendKeys.Send("ENTER")
MsgBox("Macro Run")