cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DashNY2
Level 3

Executing EXE before file copy

Hi there,

I've written an EXE in .NET that I want to execute before files are copied/installed, e.g. right when user launches my MSI.

The problem is that the EXE has a DLL it's dependent on. I've created a custom action as "new->EXE->Stored in Binary table" and pointed to my Exe. However, the execution fails at runtime with FileNotFoundException because the referenced DLL doesn't exist in the same directory during installation.

Any ideas?

Thanks.
Labels (1)
0 Kudos
(2) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Can you set them up as a support files, and reference the exe in [SUPPORTDIR]\ instead of the binary table?
0 Kudos
ChristopheOce
Level 7

Hi both,

i've solve the same problem i think :
i have a exe Net 1.1 who have need a dll for to works and who have launch at the installation !

for to resolve this problem, i've add the exe and the net dll in my package and in my project i have writte a custom action.
This custom action is execute in the interface when a user click next.

for to have the path where i can find my exe and my dll i use this :


cchbValueBuffer = 512;
nResult = MsiGetProperty(hMSI, "SOURCEDIR", szPathSupport, cchValueBuf);
//MessageBox(szPathSupport, INFORMATION);

//Path to find the file
szPathCompletDll = szPathSupport+"programfiles\\****\\****\\****.dll";
//MessageBox("Path complet :" + szPathCompletDll, INFORMATION );


I hope this simple code will help you

Have nice day with installshield 🙂
Christophe
0 Kudos