strensnik Posted October 9, 2014 Posted October 9, 2014 (edited) I have a large program to install (AmericasArmy.exe - 1.2GB). During the istall you need to choose "students' version so it cannot be silently installed. I created the following script but when executed, nothing sees to happen. My best guess is the problem lies when the exe is launched it extracts and msi file to the users appdata path (C:UsersUSERNAMEAppDataLocalTemp{3596E9F0-BF7A-4797-A243-CDC13C49D75AAmerica's Army Education.msi}). FYI: the msi cannot be copied and run separately. It says you must launch the exe. Do I need to address the MSI extraction piece or is there something else wrong with my script? Here is the script: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=Army.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Run("setup.exe") WinWaitActive("America's Army Education - InstallShield Wizard") Send("!n") WinWaitActive("America's Army Education - InstallShield Wizard", "Setup Type") ControlClick("America's Army Education - InstallShield Wizard","","[CLASS:Button; INSTANCE:2; TEXT:Student Installation]") Send("!n") WinWaitActive("America's Army Education - InstallShield Wizard", "Setup has finished") Send("{ENTER}") Here is the output: >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:tempAArmy.au3" /UserParams +>14:50:36 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_81/ CPU:X64 OS:X64 Environment(Language:0409) +> SciTEDir => C:Program Files (x86)AutoIt3SciTE UserDir => C:UsersUSERNAMEAppDataLocalAutoIt v3SciTEAutoIt3Wrapper SCITE_USERHOME => C:UsersUSERNAMEAppDataLocalAutoIt v3SciTE >Running AU3Check (3.3.12.0) from:C:Program Files (x86)AutoIt3 input:C:tempAArmy.au3 +>14:50:36 AU3Check ended.rc:0 >Running:(3.3.12.0):C:Program Files (x86)AutoIt3autoit3.exe "C:tempAArmy.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop Edited October 9, 2014 by strensnik
AdamUL Posted October 9, 2014 Posted October 9, 2014 You will not be able to extract the MSI, and have it work correctly, at least in my experience. Since it is InstallShield, look at recording the GUI actions to an answer file with the /r options, and then use the /s and /f1 option for specifying the answer file. Here is a link to the command line options for InstallShield. Adam
Moderators JLogan3o13 Posted October 9, 2014 Moderators Posted October 9, 2014 If you are getting the "You must run this from the Setup.exe" it is a switch that is set inside the MSI itself. The condition is "ISSETUPDRIVEN". You can use an open source tool such as Orca to open the MSI and change this, or (more appropriate) use a tool to create a transform (MST) to set this value for you. In either instance, you have to be careful as to the reasoning behind running it from the setup.exe. Sometimes they package it that way as there are checks for .Net version or VC++ in the setup, that then do not have to be included in the MSI. But if they are doing many different activities through the setup file, it could legitimately cause the install to fail if it runs straight from the MSI. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
strensnik Posted October 10, 2014 Author Posted October 10, 2014 I'm not ready to give up on scripting this install yet. My latest script gets one step further. It extracts the MSI but does not accept the next command (line6) #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=Army4.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ShellExecute("setup.exe") WinWaitActive("[CLASS:Static; INSTANCE:4]") Send("!n") WinWaitActive("America's Army Education - InstallShield Wizard", "Setup Type") ControlClick("America's Army Education - InstallShield Wizard","","[CLASS:Button; INSTANCE:2; TEXT:Student Installation]") Send("!n") WinWaitActive("America's Army Education - InstallShield Wizard", "Setup has finished") Send("{ENTER}")
AdamUL Posted October 10, 2014 Posted October 10, 2014 I don't see why would would want to automate the GUI, when you do not need to. On a test box, open the command prompt as admin. Change the directory to the path were the install file is located. Enter the following command to create an answer file. The "C:Temp" folder must exist, or use a different path. Setup.exe /r /f1"C:\Temp\Setup.iss" Click through the GUI selecting the options, and entering values, that you want, and install the application. Now that you have an answer file, Setup.iss, you can FileInstall it with your script. The command to silently install from an answer file, if the Setup.iss file is stored in "C:Temp" is Setup.exe /s /f1"C:\Temp\Setup.iss" You can specify a different path if you would like. 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