Jump to content

Software Installation If statement


Recommended Posts

Hi 

This might be a daft question as AutoIT is new to me and I'm still finding my feet.

I'm trying to install a piece of software that installs more than one application during the installation. I've managed to create a script that installs the software. The vendor creates an uninstall script that just uninstalls the main application. If the application is reinstalled or the other applications already exist the script no longer works as the installation takes a different path and tries to uninstall one of the drivers by default. I was trying to use an IF statement along with the winactive + text to try and identify if the "prereq" was or wasn't already installed. Is this possible to do it like this or is there a better way to do this? 
This is the offending window 

image.png.01a62bf1d53b28ab92362d699b99c88d.png

and this is the part of the script that I was trying  but I don't think it is  correctly detecting the string part 

Run(@ScriptDir & '\TU-S9_PL2303_Prolific_DriverInstaller_v1.12.0.exe')
IF String(WinActive ("PL2303 USB-to-Serial Driver Installer Program", "Remove all installed features")) Then
    Send ("{TAB 2}{ENTER}")
    Send("Y")
    Send("{ENTER}")
Else
    ; run new driver install wizard screen

Send("{ENTER}")
    EndIf

Link to comment
Share on other sites

Hi Jos

Thanks for coming back to me, whilst the PL2303 drivers itself can be packaged and deployed silently (which it currently is via sccm) the main application cant be ran silently, hence why I was using  AutoIT.  The main clinical application ( which by its nature prevents me from doing too much to it) has been write in such a way that rather than ignoring the fact it's already installed  triggers the msi  of the PL2303 to run a repair/modify/uninstall.

Link to comment
Share on other sites

  • Developers

So, can't you run the MSI before the installer and get it to deinstall the old version ( with /x I believe) ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Normally I'd check if the software was installed, just run RegRead for DisplayName in the following location (you need to know the {Guid} or you have to use RegEnumKey)

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{Guid}

HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{Guid}

If found then you can just use Msiexec.exe /x {Guid} /QN /NoRestart to uninstall silently.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...