Command line options in custom actions - Advanced Installer Community
stevericketts
Posts: 10
Joined: Sun Feb 12, 2006 2:50 pm

Command line options in custom actions

I would like to install Windows Media Encoder with the rest of my software. I thought I could do it by specifying an in-line script like:

set oShell=createObject("Wscript.shell"): oShell.run "[APPDIR]WMEncoder /Q"

...but it errors out. I've tried combinations of:

oShell.run "[APPDIR]WMEncoder /Q"
oShell.run [APPDIR]WMEncoder /Q
oShell.run [APPDIR]\WMEncoder /Q
oShell.run [APPDIR]"WMEncoder /Q"
oShell.run [APPDIR]"\WMEncoder /Q"

The only way I can get it to work is:

oShell.run "c:\progra~1\CADE\exe\WMEncoder /Q"

Which would be fine unless they change the application directory. Any thoughts on how to deal with this?

Thanks,

Steve
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi Steve,

The problem is that the inline script does not accept formatted strings. The way to access the APPDIR property is by using the Session object:

Code: Select all

set oShell=createObject("Wscript.shell"): oShell.run + session.property("APPDIR") + "WMEncoder /Q"
Hope this helps.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

Instead of using a script, you could use a Property Set with Formatted Custom Action followed by a Property Source Custom Action, scheduled on the "InstallFinalize" stage.

Make the following settings for the Property Set with Formatted Custom Action:
- Property Name : WM_ENC
- Formatted Text: [#WMEncoder] (select the file from your package)

As for the Property Source Custom Action:
- Property Name : WM_ENC
- Command Line : /Q
- Execution Condition: (Not Installed)

Hope this helps.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”