mthama
Posts: 15
Joined: Mon Feb 10, 2014 1:49 pm

Custom action (auto launch) failing

Hello to all,
I think that this is not an issue, but a mistake/mismatch by me: I'm not being able to create a custom action that automatically runs my application after installation. We want a behavior where user can't choose to run or not (it will be runned everytime user installs the product at first time). My point is that i'm not sure how to complete the custom action options (I've choosed the "Launch File"). I've completed the options as follow (literally, with no additional characters):
========================
File to launch: myapp.exe
Command line: "Software\[Manufacturer]\[ProductName]" "[LogonUser]"
Working Directory:
[ ] Hide program's window
[x] Runs as administrator
[x] Use 64-bit Launcher

Execution Time
(o) Immediatelly
( ) ...
( ) ...
( ) ...

Execution Options
[ ] ...
[x] Wait for custom action to finish before proceeding
[x] Fail installation if custom action returns an error
=======================

Can someone please guide me how to fill these options, in a manner that I can auto-launch our application?
Sorry if this is a previsouly posted question, and thanks in advance.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom action (auto launch) failing

Hello,

In order to achieve that you can add the predefined Launch file custom action without sequence from the Custom Actions page. Please note that the File to Launch field is of Formatted data type so you can simply add the [#myapp.exe]. This property will be expanded to something like: installationFolder\myapp.exe

Then, in the Dialogs page, you can add these custom action to be executed as a published events on the Finish button from the ExitDialog dialog. Here's an article with related information for hints and guidance: How do I execute a custom action when a button is pushed?. Also, you can take a look on the Launch language-based file when installation finish which debates a similar issue.

Also, I've attached a sample which implement a similar scenario. At the end of the installation process, when the user press the Finish button from the ExitDialog a txt file will be launched.

Please let us know if that helped.

Best regards,
Dan
Attachments
LaunchFileSample.zip
(2.73 KiB) Downloaded 368 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mthama
Posts: 15
Joined: Mon Feb 10, 2014 1:49 pm

Re: Custom action (auto launch) failing

Hi Dan,
I'd like to thank you very much! Based in your attached sample, I just have found where I was mistaking:
1. There's a "#" character at the executable's name, as a reference to it. I was filling it with a string-like sentence;
2. I placed the trigger event of the custom action at the dialog finish actions, not in the button published events.
Fixing these issues, I become able to auto-launch my application, in the our desired way.
I praise and recommend this forum, for being very fast when it comes to replying. Thank you.

Return to “Common Problems”