Sign in to follow this  
Followers 0
OSPMatt

Application installer has problems creating folders if being run by AutoIt

9 posts in this topic

New user to AutoIt here, and I'm having an issue with an application that I'm using AuotIt to install. Everything seems fine, until it begins the actual extraction of the programs files and creation of it's folder structure inside of C:\Program Files. At first it wasn't able to create it's top level directory and would fail right after starting the install with a file with the name of the directory being left in program files, which was 5Kb in size and had a blank shortcut icon, with no way to open it. I was able to partially work around this by creating that directory before launching the installer (DirCreate ("C:\SomeDir")), but now the installer fails later on in the install routine when trying to create a subdirectory inside of SomeDir. I don't understand why, because it is able to create other subdirectories inside of the folder.

If I run the installer manually without AutoIt it completes without any issues, so it's got to have something to do with AutoIt that is causing it to fail. Script is below, thanks in advance.

FileInstall("C:\Software\AAA.exe", @TempDir & "\AAA.exe", 1)

FileInstall("C:\Software\BBB.ini", @TempDir & "\BBB", 1)

FileInstall("C:\Software\CCC.mex", @TempDir & "\CCC.mex", 1)

DirCreate("C:\SomeDir")

Run (@TempDir & "\AAA.exe")

WinWaitActive("Introduction")

Send("{ENTER}")

WinWaitActive("License Agreement")

Send("!a")

Send("{ENTER}")

WinWaitActive(" Registration Information")

Send("XXXX-XXX-XXXX-XXXX-XXX")

Send("{ENTER}")

WinWaitActive("Start Installation")

Send("{ENTER}")

WinWaitActive("Install")

Send("{RIGHT}")

Send("{ENTER}")

FileMove(@TempDir & "BBB.ini", "C:\SomeDir", 1)

FileMove(@TempDir & "\AAA.mex", "C:\SomeDir\Data Files", 1)

FileDelete(@TempDir & "\CCC.exe")

FileDelete(@TempDir & "\BBB.ini")

FileDelete(@TempDir & "\AAA.mex")

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

First place to look ....is it being run by an account with administrator rights. Try compiling and then using RunAs to see if that's the issue

if that is the problem use RunAs()

Edited by shornw

[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Share this post


Link to post
Share on other sites

Sorry, I should have mentioned. I'm running the compiled exe while logged in as the local administrator account.

Share this post


Link to post
Share on other sites

Hi, OSPMatt. What is the application you are trying to install? Have you looked into whether the installer will allow you to set command line switches to select the Features that you want? This would undoubtedly be a lot less headache than trying to automate the various button clicks. If you'd like to post the software, we can attempt to assist you with its installation.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

From the help file for FileMove:

The destination directory must already exist, except using with flag value '8'.

For instance the combined flag '9' (1 + 8) overwrites the target file and prechecks for the destination directory structure and if it doesn't exist creates it automatically.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

The application is a specialty application we use called Virtual Partner. Normally I always try and set these up as unattended installs using the installer switches, but this one is packaged with WISE installer. To my knowledge, WISE does not support any silent or unattended switches.

Share this post


Link to post
Share on other sites

I seem to have been able to overcome this issue by adding a dircreate command to the script that creates the entire folder structure before executing the installer. I'm now running in to trouble with the portion of the script here:

WinWaitActive("Install")

Send("{RIGHT}")

Send("{ENTER}")

It seems that the script ends before it gets to that point, the Install window opens and I can verify with Window Info that it can see it, but the key commands are never sent. It should press right and enter to cancel the reboot request, but it never happens. If I cancel it manually the rest of the file move operations don't complete either. I also noticed there is no longer an autoit icon in the system tray by the time I get to that point.

The application can take a long time to install (~10 minutes) so perhaps it is timing out before reaching the Install window? I did not specify a timeout, is there one by default?

Share this post


Link to post
Share on other sites

Is there any visible text in that last window you could use to make sure that the window is the right window to send the commands to?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Yeah, I was able to get it sorted out by adding the visible text along with the window title. Program installs exactly as intended now. Thanks for the help.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0