Page 1 of 1

Launching an executable file from IA setup

Posted: Fri Aug 15, 2008 4:56 am
by wileywilly
I wish to install a setup but first I need to call the uninstaller for the existing setup (which was built in Wise)
Currently I unistall the Wise setup by launching the Wise uninstaller - is it possible to call and run the Wise uninstaller setup (executable) from within IA script.
I tried to use the Run Program command but this works only with *.exe files included in the setup rather than *.exe files already existing in the system.

Is it possible to launch and run an *.exe file already existing on a system by using the IA script?

Posted: Wed Aug 20, 2008 7:22 am
by andyhore
Try looking at this article from IA:

http://www.installaware.com/blog/?p=16

Andy.

Posted: Wed Aug 20, 2008 7:34 am
by wileywilly
Yes, I have had a look at the blog - but as i said, this file i want to run is already installed/existing on the PC
I need to call this file and run it using the IA setup rather than double clicking on it to run it manually.

The example given on the blog works ok but only for files/setups included within the IA setup WHEN building the setup.

I appreciate your suggestion...any more?

Posted: Thu Aug 21, 2008 8:57 am
by jimo
If you know or can determine somehow (from the registry or otherwise) the above refenced artice will work fine. Just use a variable for the program to run.

Posted: Thu Aug 28, 2008 1:16 am
by wileywilly
Jim,

I have tried your suggestion and managed to read the the wise installer exe file path from the registry

However, I have not been able to launch the setup - the Run Program command doesnt accept variables

The MSI command for Install/Uninstall gives an error message - BTW, do i give an .msi path or .exe path for this command?

Posted: Thu Aug 28, 2008 4:44 am
by Damocles
I do pretty much the same thing, though only when the user decides to install into the same directory.

i use:
Run Program $targetdir$\\unwise.exe $targetdir$\\INSTALL.LOG (WAIT)

Posted: Thu Aug 28, 2008 6:55 am
by wileywilly
Yes, this will work ok but its not suitable for my case

You see, this executable file(the wise setup i want to uninstall) is already installed and I do not have setup file itself - it was built and deployed by a different person to many different PCs

I manually uninstall the wise setups before installing the IA based setups.

I would like to have a scenario where the IA setup (which am currently building) will be able to read the path/location of the installed wise setups and launch them (of course, to uninstall).

If anyone has tried this please share!

Posted: Thu Aug 28, 2008 8:11 am
by Damocles
I'm not sure i understand what you mean...

Wise (as far as i know) places his uninstall link in:
HKLM(orHKCU)\\software\\windows\\currentversion\\uninstall\\$TITLE$

(so it appears in the Add-Remove Program Panel.

When you read this registry entry, there should be smth like:

Name:UninstallString
value: $targetdir$\\UNWISE.EXE $targetdir$\\INSTALL.LOG

So, if i understand it correctly, you would first

=>Check Registry Key HKLM\\software\\windows\\currentversion\\uninstall\\$TITLE$\\UninstallString into TARGET

then split $TARGET$ up into $UNWISEDIR$(smth like TARGETDIR\\unwise.exe) and LOGDIR(=$targetdir$\\install.log)
maybe convert path to longfilename and

Run Program $TARGET$ (WAIT)

(using the logfile causes an error on vista (for me at least, couldn't be opened or smth alike)
The program you run (the unwise.exe) does not have to be included in your setup. It only has to be present in the location you are looking for.

Posted: Thu Aug 28, 2008 9:02 am
by wileywilly
We are together so far until this point:
Run Program $TARGET$ (WAIT)
when i reach this point, the command pops up a dialog box prompting for a file location.
Unless am mistaken, i cannot put in a variable - it has to be a path which points to a location on my pc.

The READ REGISTRY and PARSE commands
Read Registry Key HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\My Server Setup\\\\UninstallString into UNWISE

Parse String $UNWISE$ into Variables UNWISE_EXE and UNWISE_LOG (Split at first occurrence of pattern)
Am using the IA 7 Studio

Posted: Thu Aug 28, 2008 9:30 am
by Damocles
Is he looking for the exe file to execute, or the logfile of the program to uninstall?

If it's the logfile, place it into the command line box(in IA), though i fear you might have problems on vista. If it really is the exe file(i really can't imagine that, since i call several exe files on the target machine (like xcopy and such) ... no idea.

Perhaps you have to transform the path to a long name first. (convert path)

If that doesn't help, i hope IA support can help you better. Submit a ticket.

Solved Run Program problem

Posted: Mon Sep 01, 2008 1:59 am
by wileywilly
Damocles,
I think you were right all along...

I was just not putting in the variables in the right places but after rereading your post I finally made it work:
i use:
Run Program $targetdir$\\unwise.exe $targetdir$\\INSTALL.LOG (WAIT)
So far with tests am doing all is well - just need to make a live test now.
Thank you.