Jamman Posted April 24, 2014 Share Posted April 24, 2014 Hello, I've been trying to get to grips with Autoit and have been having fun with it but I have run into a problem installing an .exe on a basic user account, I figured that a 'RunAs' function would be the answer to give me admin credentials on the install and have I have been trying some of the examples on the forum but for some reason my code won't work, I'm pretty sure this is user error on my part but if someone could help out that would be great! expandcollapse popupGlobal $sUserName = "USERNAME" Global $sPassword = "PASSWORD" Global $sDomain = "DOMAIN" RunAsWait ($sUserName, $sDomain, $sPassword, 0, "UNC PATH TO INSTALL.EXE") WinWaitActive("CSCInstaller - InstallShield Wizard", "Welcome to the InstallShield") Send("{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "United Kingdom") Send("{TAB}{TAB}{TAB}{TAB}{SPACE}{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "TERMS AND CONDITIONS") Send("{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "Tree1") Send("{DOWN}{RIGHT}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{DOWN}{SPACE}{LEFT}{LEFT}{DOWN}{SPACE}{TAB}{TAB}{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "1 Span") Send("{UP}{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "BREVe3 LICENCE AGREEMENT") Send("{UP}{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "@10003;1;255,0,255") Send("{TAB}{TAB}{SPACE}") WinWaitActive("CSCInstaller - InstallShield Wizard", "CSC Licensing Server") Send("servername1") Send("{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "Setup Type") Send("{UP}{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "Select folder where setup will install files.") Send("{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "Leaving the installation files on your computer will ensure that the product CD is not required if you need to repair or update your installation") Send("{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "CSC Update Service") Send("{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "Check for Updates") Send("{Down}{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "Installation Log") Send("{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "Start Copying Files") Send("{ENTER}") WinWaitActive("CSCInstaller - InstallShield Wizard", "InstallShield Wizard Complete") Send("{ENTER}") Link to comment Share on other sites More sharing options...
orbs Posted April 24, 2014 Share Posted April 24, 2014 hello Jamman, welcome to AutoIt and to the forum! you are using RunAsWait() which will not let the script continue to next line until the called application is closed. try RunAs() instead. regardless, try to find if your installer has command-line switches to automate the install, or if there is an MSI package for it. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
Jamman Posted April 25, 2014 Author Share Posted April 25, 2014 hello Jamman, welcome to AutoIt and to the forum! you are using RunAsWait() which will not let the script continue to next line until the called application is closed. try RunAs() instead. regardless, try to find if your installer has command-line switches to automate the install, or if there is an MSI package for it. Hi Orbs, Thanks for the welcome, yes I tried to create and .iss file from the installshield installer but it doesn't seem to create one, I guess something the author must have blocked, anyway I shall try your suggestion! msi's a lot easier! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now