PDA

View Full Version : Custom Action Launch Exe



TadhgOC
02-27-2002, 11:41 AM
Hi,
I'm trying to Launch an executable that I have installed to the Destination Computer
to Program Files\My Company\My App\MyExe.exe

The installation has been set up with a different MyExe.exe for each launguage so I
cannot choose the Launch an Executable with the option Installed with the application.

Below is an outline of what I think is close to what I should do. As the exe is always
called the same name irrespective of language
I just need to point to the install directory and target MyExe.exe

What I've tried to do is launch the application when the Finish Button is clicked
at the end of a successful installation.

My appologies if this is way off the mark but I've only been looking at this application(ISWI)
for a few days.

I've found that if I hard code PATHTOMYEXE as C:\Program Files\My Company\My App\MyExe.exe
it works. This is not sufficient as if the user selects a custom installation folder it won't
work. Also I assume Program Files is translated in OSs running other Languages so it won't in
those instances.

Any help,suggestions will be greatly appreciated.


I created a New Property under the Property Manager
Name Value
PATHTOMYEXE [INSTALLDIR]MyExe.exe

I created a custom Action with the following settings
Name: LaunchMyExe
Type: Launch an executable
Location: Stored in the Property table
Source: PATHTOMYEXE
Target:

Wait for action to finish - Unchecked
Ignore custom action return code - Checked
In-Script Execution - Immediate Execution
Execution Scheduling - Always Execute

Under User Interface, SetupCompleteSuccess, Behaviour, Control Name, OK, Pushbutton I added
a new Do Action with LaunchMyExe as the Argument


Thanks,
Tadhg.

Axxeman
02-27-2002, 05:48 PM
This looks OK to me. Did you try it?
If so, what were the results?

TadhgOC
02-28-2002, 04:40 AM
Hi,
Yes I have tried it and many close varitions of this to no avail.
As I outlind if I hard code the path it works. However with the path set as [INSTALLDIR] nothing happens. The executable does not launch, there are no error messages or anything unusual. I'm completely stumped!!!
Thanks for taking the time to look at it anyway.

Johannes John
02-28-2002, 07:31 AM
Hello Tadhg,

which CA type you are using? ( CA type 50 )?

Regards!
Johannes

TadhgOC
02-28-2002, 07:51 AM
Hi Johannes,
The custom action type is 242. I didn't set this. I presume it was populated by the Custom Action Wizard,
Any ideas?
Tadhg.

Johannes John
02-28-2002, 08:44 AM
Hello Tadhg,

I don't know how your wizard has created the 242, but it has something todo with 34 ( launch exe from directory... ). I only know 226 ( I don't what the 16 ( bit 5 ) is the reason for )...

But 34 ->:
Type: 226 or 242 what shells...
Source: e.g. Systemfolder but an entry from the Directory Table not a property.
Target: Yourexe.exe

E.g. I've an CA:
Type: 226
Source: Systemfolder ( without [] )
Traget: notepad "[SourceDir]readme.txt"

IMHO use an entry from the directory table - not a property.
Or use CA type 50.

Have a look at "Summary List of All Custom Action Types" in the SDK.

Reagrds!
Johannes

TadhgOC
02-28-2002, 11:21 AM
Thanks very much for you help and suggestions Johannes.

I tried it with CA Type 50 but it didn't work.

I had tried the Directory table before to no avail. I tried it again to be doubly sure but it didn't work either.

Here are the settings I used.

I created a custom Action with the following settings
Name: LaunchMyExe
Type: Launch an executable
Location: Stored in the Directory table
Source: INSTALLDIR (no brackets)
Target: MyExe.exe

Wait for action to finish - Unchecked
Ignore custom action return code - Checked
In-Script Execution - Immediate Execution
Execution Scheduling - Always Execute

Under User Interface, SetupCompleteSuccess, Behaviour, Control Name, OK, Pushbutton I added
a new Do Action with LaunchMyExe as the Argument
I moved this action to first in the list. (I tried it with it last in the list and it didn't work either)

These settings generated a custom action type of 226



Any ideas, suggestions greatly welcomed.

Thanks,
Tadhg

PhilWilson
02-28-2002, 01:07 PM
I don't think you can make this work during the UI because the files haven't been installed on the system yet. I can't be sure from your description, but it sounds like you're still in the UI stage.

I have an install that pretty much does what you want. It launches an executable installed with the product, but it's a deferred CA. It's a deferred CA because in general an immediate CA ("in script") happens while the script for the execution is being built, not when the files are actually on the system. Mine is sequenced just before InstallFinalize in the execute sequence.

Johannes John
03-01-2002, 02:37 AM
Hello Tadhg,

I've tested a "Installed with the product" and the prog was running, when pressing the OK button.

(Meanwhile I know what's 242 -> ...property ...)

Regards!
Johannes