views:

768

answers:

2

I'm creating installer using InstallShield 2010 (basic MSI) that is having two features.

First feature consists of:

  • main .NET application compiled as x86,
  • some native x86 third party dlls which are used by main application (x64 versions are unavailable).

Second feature contains single component which is an extension for MS Reporting Services compiled as AnyCPU.

During UI sequence I'm using InstallScript custom action to enumerate all available Reporting Services instances from both x86 and x64 registry trees.

The user is prompted to select on which instance he wants to deploy our extension.

Based on selected instance I'm quering registry for actual location of Reporting Services in file system which is usually something like "C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services" and storing this value in a MSI Property.

Then by using Set Directory action I'm setting destination directory of a component (our extension) to the value of that MSI Property.

Everything is installing perfectly fine unless you've trying to install it for x64 Reporting Services in that case extension files are installed to wrong location. Even thou MSI Property is set to correct path "C:\Program Files\MicroSoft..." (I've checked msi log) it looks like system is automatically redirecting to "Program Files (x86)".

Is there any possible solution to overcome this issue?

+1  A: 

If you need to install to the 64-bit ProgramFiles folder, use a 64-bit MSI.

sascha
A: 

Finally solved this issue myself without creating 64bit MSI by using InstallScript custom actions.

First custom action to install:

  • Manually copy required files to desired location (InstallScript can access x64 Program Files)
  • Save this location in registry as a key component for this feature to use during uninstall

Second custom action to uninstall:

  • Read installed location from registry (do not use System Search to get this value due to it'll be auto translated by WindowsInstaller to "ProgramFiles (x86)")
  • Delete files
Shuric