views:

63

answers:

2

Hello

I am useing InstallShield Limited Edition for Visual Studio 2010 to create an installer, and I am trying to add an executable custom action.

My custom action in an exe that is installed to the install dir. The custom action needs to use another file that is located in the install dir as well.

How do I get the path to the install dir to my exe? I tried to pess [INSTALLDIR] as an argument but it translates to "C:\Program" instead of the correct dir ("C:\Progam Files\MyCompany\MyProduct"). I tried [TARGETDIR] but it translate to E:\ (wrong as well).

Any Ideas?

A: 

Found the problem.

using [INSTALLDIR] is currect. the problem is with powershell. reading C:\Program Files... as C:\Program.

the Issue is discussed here:

http://www.leeholmes.com/blog/2006/05/05/running-powershell-scripts-from-cmd-exe/

Eyal
I would have suggested making sure you put quotes around [INSTALLDIR] in your command line, e.g. "[INSTALLDIR]MyExe.exe", but if you'd still hit the powershell problem, that won't help.
Michael Urman
A: 

EXE custom actions are very limited. If I was using InstallShield LE, I'd create a C# WiX/DTF Custom Action and consume it in a WiX Merge Module and then consume that merge module in your InstallShield LE project. This gives you very powerful solution.

Christopher Painter