VBScript doesn't run InstallShieldWizard in Windows 8
i prepared a VBScript to do so, but commands like Tab or Enter doesn't effect in the Intaller.
Running same commands out side the Installer - the commands work.
is there some unique command to do so that the keys will work in the installer?
My script:
Set WshShell = WScript.CreateObject("WScript.Shell")
dim timetowait
timetowait = 1000
dim longwait
longwait = 3000
'open installer
WshShell.Run ("""Location\Setup.exe""")
WScript.Sleep longwait
WshShell.SendKeys "{TAB}"
WScript.Sleep timetowait
WshShell.SendKeys "{ENTER}"
WScript.Sleep longwait
Thank you for you help
Good day :)
Answers (4)
This script will work perfectly when you run it outside the installation package. But if you try to use it as a custom action, you will end up with the following error message: "Error 1720: A script required for this install to complete could not be run."
This happens because Windows Installer does not support WScript objects directly.
Set WshShell = WScript.CreateObject("WScript.Shell")
dim timetowait
timetowait = 1000
dim longwait
longwait = 3000
'open installer
WshShell.Run ("""Location\Setup.exe""")
WScript.Sleep longwait
WshShell.SendKeys "{TAB}"
WScript.Sleep timetowait
WshShell.SendKeys "{ENTER}"
WScript.Sleep longwait
Comments:
-
>Windows Installer does not support WScript objects directly.<BR>
Hmmm...Consider your use of language here. WI *does* support WScript objects - how else would 'WScript.Shell' objects get created? - but it does *not* support use of the Windows Scripting Host directives, as I believe I had explained earlier. - anonymous_9363 9 years ago-
A workaround would be not to use the WScript object inside your scripts. For instance, you can use the "CreateObject" function directly. Here is an example:
Set objFSO = CreateObject("WScript.Shell") - jagadeish 9 years ago-
Gosh! That's *so* unlike what I already said 2 days ago... - anonymous_9363 9 years ago
Set WshShell = WScript.CreateObject("WScript.Shell")
to this
Set WshShell = CreateObject("WScript.Shell")
Talking of re-packaging, are you sure that the set-up EXE doesn't extract and execute an MSI?
Funny when you read these things and get a different take on it. It sounds to me like he (she) is trying to launch the exe with a VBS, a small wager on the session isolation preventing the key strokes being passed through.
So, its an exe? Not confirmed if it extracts to an MSI (check taskmgr) if it is a proper real exe, with the installshield wizard, why dont you try the 'Unique command' of creating an answer file for the exe??
Setup.exe -r (when you have finished it will create a setup.ISS file in the windows folder) then use the -s switch to tell it all the magic answers (key strokes).
Please let us know if its just an exe. If you are only sending an enter key, you could probably just run it silently anyway.
Good luck
Comments:
-
Hey, first of all thank you very much for the answer. it's an exe file which openes in installershield. i dont want to run it silently, i need the GUI screenshots.
i tried the tips here
Set objFSO = CreateObject("WScript.Shell")
and
Set WshShell = CreateObject("WScript.Shell")
but the keys (tab / enter) still dont reach the installer. if you have some more ideas, i'll be very very happy
thank you :)
Julia - NoLogin 9 years ago
In windows 7 this script works just fine (and also in Windows 8 just not in the InstallerShield
Thank you so much for the anwers and the thougth! - NoLogin 9 years ago
Are you running it all from an elevated command prompt. Would it not be easier to user the built in PSR??
There was another tool, I have forgotten the name but for some reason keep thinking of butterfly, you configure it to take a screen shot on each mouse click. - Badger 9 years ago