Tanooki Posted April 10, 2014 Posted April 10, 2014 (edited) I've been working on setting up a script to auto install Office 2013, something that should be rather simple. However, once I get to the EULA, I'm unable to send keystrokes, ControlClick, or MouseClick. I've searched and searched for any info on this. I keep finding scripts that work on 2010 and below, but I haven't seen any for installing 2013. Is the Install splash screen protected from scripts, like the UAC? I thought maybe it was just my code. In the past I've always used AutoHotKey, so I modified it to work with that. It gave the same result of not working once it got to the EULA. I'm using Windows 8.1. I'm trying to install Office 2013 Pro Plus from an iso on a network share. The iso I'm using is a volume licenses. Here is my code atm. I have most of it set up the way I do for testing. $result = FileExists("\\Share location\SW_DVD5_Office_Professional_Plus_2013_W32_English_MLF_X18-55138.iso") If $result Then Msgbox(0,"","File exists, Click OK to install") ;Mounts the ISO by using cmd RunWait(@ComSpec & ' /C ' & "Explorer.exe \\Share location\SW_DVD5_Office_Professional_Plus_2013_W32_English_MLF_X18-55138.iso", @TempDir, @SW_HIDE) Sleep(1000) ;Runs the setup from the mounted drive Run(@ComSpec & ' /C ' & "E:\setup.exe") WinWaitActive("Microsoft Office 2013") ;Close cmd WinClose("C:\Windows\system32\cmd.exe") Sleep(5000) ;close File Explorer WinClose("[CLASS:CabinetWClass]") Sleep(4000) WinActivate("Microsoft Office Professional Plus 2013") Sleep(2000) Send("!a") Sleep(1000) Send("!c") Else MsgBox(0,"","File doesn't exist") EndIf Edited April 10, 2014 by Tanooki
Solution jguinch Posted April 10, 2014 Solution Posted April 10, 2014 Try setup.exe /admin to create a response file instead : Microsoft has made this option for that Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Tanooki Posted April 10, 2014 Author Posted April 10, 2014 Try setup.exe /admin to create a response file instead : Microsoft has made this option for that Thank you so much! I'll give that a try and reconfigure my code.
Tanooki Posted April 11, 2014 Author Posted April 11, 2014 Well I gave using the response file a shot, but I'm unable to use it properly. Also, I now am pretty sure I know why my script wasn't working in the first place... I have UAC disabled within control panel. I took a break from working on this script, and started working on an install for Cisco AnyConnect. Again, yet another simple installation. Here's the code I've got so far, although it is not of any relevance because the issue is not related to the code. MsgBox(0, "", "Click ok to install") RunWait(@ComSpec & ' /C ' & "\\NetworkPath\AnyConnect\anyconnect-win-3.1.04072-pre-deploy-k9.msi", @TempDir, @SW_HIDE) WinWaitActive("[CLASS:MsiDialogCloseClass]", "Welcome to Cisco", 10) ControlClick("Cisco AnyConnect Secure Mobility Client Setup", "&Next >", "[CLASS:Button; INSTANCE:1", "Primary", 1, 28, 10) This gave the same issue as trying to run my script on the Office Installation Splash screen. This has led me to believe, even though my UAC is disabled on my 8.1 install, it is still somehow running for installations. Could this be a group policy setting?
jguinch Posted April 11, 2014 Posted April 11, 2014 I really think that you are going in the wrong direction with your GUI interactions. Deploying a MSI application can be done (mostly) by a simple command like msiexec /i "serversharepackage.msi" /qn This is my own point of view, I will let you judge for yourself.. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Tanooki Posted April 11, 2014 Author Posted April 11, 2014 I'm not a net admin. My privileges fall more into the Power User group. I do like the OCT option, but I only have access to the mountable iso. I'm not able to put the Update.msp into the update folder because of this. Or maybe there's something I'm completely missing, which I'm sure there is. Although, after researching, I found the location of the UAC setting in the registry I needed. I just disabled it, and was able to run my AnyConnect script so far.
jguinch Posted April 11, 2014 Posted April 11, 2014 The msp file generated by OCT is not necessary stored in the same place than the setup. The Power User group is a joke since Windows Vista, so what would you install with ? I am not criticizing, I'm rather surprised that you manage to install programs But now, It is outside the scope of the AutoIt forum, (sorry) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Tanooki Posted April 11, 2014 Author Posted April 11, 2014 I'm going to continue reading on up properly using the OCT. I must of misread how to use it. I'm going to mark this as solved since I did find the registry fix I need, and the issue didn't pertain to AutoIt... Thanks Windows 8 for making me hate you even more. Also, thanks for the info Juinch, you've helped further my knowledge in the vast IT world.
AdamUL Posted April 11, 2014 Posted April 11, 2014 I would not disable UAC completely, just set the ConsentPromptBehaviorAdmin key to 0. This will disable to the UAC prompt for Admins. I wrote a >UAC UDF that could help with that. As for installing Office with a MSP file, try replacing your Run command and GUI interactions with this below. The MSP file is in the same directory as the script. RunWait('"E:\setup.exe" /adminfile Setup.MSP /config "E:\ProPlus.WW\config.xml"', @ScriptDir) Adam
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