2
votes

I'm using InstallShield 2013 (Basic MSI Project) to create installation package for my product. Product requires DirectX End-User-Runtime to be installed, so I created custom prerequisite for DirectX in my InstallShield solution.

I don't want install DirectX End-User-Runtime every time I install my product, so I want to add a condition for DirectX in Prerequisite Editor. My product is a 64-bit application and it requires some directX files in C:\Windows\System32 folder (At least I know that it won't work without D3DCompiler_43.dll and D3DX9_43.dll).

So, I'm adding conditions for my prerequisite:

Install DirectX End-User-Runtime if files [WindowsFolder]system32\D3DCompiler_43.dll and [WindowsFolder]system32\D3DX9_43.dll are missed on target box.

I tested my installation package on two 64-bit Win7 boxes. DirectX Prerequisite condition works fine on the first box - it installs DirectX only if both D3DCompiler_43.dll and D3DX9_43.dll are missed in C:\Windows\System32. But problem appears when I install the same package on the second 64-bit box: for some reasons prerequisite condition doesn't work properly there - it tries to find D3DCompiler_43.dll and D3DX9_43.dll not in C:Windows\System32 but in C:Windows\SysWOW64 folder. Can someone explain why it looks in SysWOW64 even if I hardcode path to C:\Windows\System32?

And one more question - probably someone knows a better way how to check if DirectX End-User-Runtime is installed on target box? I found similar topic here check registry for DirectX End-User Runtime, but I cannot understand how and where in Prerequisite Editor can I use LoadLibrary("d3dx9_43.dll") function...

1
I would guess that redirecting a hard-coded System32 path is due to app compat. Until 64-bit was available, apps could hard-code the System32 path and work just fine. On a 64-bit system, however, they would be pointing to the wrong directory. Redirecting to SysWOW64 fixes it.MooseBoys

1 Answers

0
votes

In InstallShield 2013, there are 2 types of prerequisites:
- Setup Prerequisites install before the main install
- Feature Prerequisites install only if that feature is selected for installation.

You can't call a DLL in a Setup Prerequisite, because a setup prerequisite runs before your MSI, and therefore before any of your custom actions.

If you create a Feature Prerequisite, you can set a custom action to call a DLL (such as d3dx9_43.dll that you mentioned). I am not familiar with this DLL, so I can't tell you what your custom action would look like. You can turn on or off this feature based on the result of your DLL call.