2

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?

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
Eyal
  • 55
  • 1
  • 6
  • Be careful when writing custom actions for installs. There is a very long back story on when you should or should not write these and how to mitigate the risks that ensue. – Christopher Painter Sep 20 '10 at 14:07

2 Answers2

0

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
  • 55
  • 1
  • 6
  • 1
    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 Sep 20 '10 at 13:33
0

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
  • 54,556
  • 6
  • 63
  • 100