RCraver
Posts: 2
Joined: Wed Nov 02, 2005 8:25 pm

Custom Actions

I am currently evaluating this product and so far it has surprised me with its ease of use and functionality. Keep up the good work!

The question:

I have a project that installs third party software and some inhouse scripts. I would like to check if third party software is already installed and if so remove it-I was planning on using UNWISE.exe in the directory. I have created a search for the file (UNWISE.exe).

I would like to have a custom action fire when the search is true, and then I would like run the UNWISE.exe file in the directory. The condition from what I understand should be something like:

SEARCH

I would then like to run the UNWISE.exe from the directory, from what I understand this is stored in the property. I am not sure where this action should be placed in InstallExecuteSequence, I have tried an error type message in different locations with no success.


Any help is greatly appreciated...
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

If the search is successful the the resulted search property will contain the path to the file otherwise it will be empty.

In order to launch that exe you could use a "Propery Source" type of custom action. In the "Property Name" field enter the name of the resulted search property. As source type use Executable(*.exe). You can set this custom action to be executed after the "AppSearch" standard action.

However, it could be a problem with this approach. There could be other applications on the target machine that have UNWISE.exe in the directory. In this case, there is the possibility to uninstall the wrong application.


All the best,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
RCraver
Posts: 2
Joined: Wed Nov 02, 2005 8:25 pm

Command Line Parameters

Ciprian,


Thanks this worked well...

I do however have another question...is it possible to pass command line parameters to a file that is found through a search.

Let me explain...

The Search is successful in finding the UNWISE.exe, I receive an error that the INSTALL.LOG file cannot be found. I think this is becuase the MSI does not run the file in the directory in which it is found. I can remedy this by using a command line parameter that should look like this:


c:\progra~1\app\UNWISE.exe c:\progra~1\app\Install.LOG

I created a search for the log, and changed the condition to:

UNWISE AND LOG

I would like to use a custom action to call the file with the log as a parameter. Being able to use command line parameters would not only solve this problem, but also many others I might come across.

Thanks again for you assistance...
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

Yes, it is possible to pass a command line parameter to the EXE file.

All you have to do is specify the command line option in the "Command Line" field. This field is of formatted type. Use the [Edit...] button to insert a reference to a file, folder or property.

All the best,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”