deploymentwindows-installerlaunch-condition

How can you access the TargetPlatform property in a Launch Condition?


I'm trying to access the TargetPlatform property value (which you can set in a Deployment project) from the condition within a "Launch Condition".

Basically I'm trying to tell the application not to install itself as a 32bit app if a 64bit version of Office is installed on that computer. Therefore I need to somehow get the application's bitness and put it in a launch condition.

I can get the bitness of Office from the registry, but I don't know how to access the TargetPlatform from the installer.

Thanks!


Solution

  • Here are two link:

    From the above link you can deduce that you can't target both platforms from a MSI installer. You will need to have two installers. Depending on how the installer is built, x86 or x64, will depend the way the installer interprets some constants that tell where to isntall the files - Program Files, or Program Files (x86).

    You can't change the TargetPlatform of the installer at runtime.

    What you can do maybe is to have two installers packed into a third one and based on the Office version installed that you say you can obtain run either sub-installer x86 or sub-installer x64, that will actually install the application files.

    If MSI installer is not the outmost requirement I would go for NSIS. If not at least package the to MSI installers into an NSIS one. It is incredibly easy. NSIS is way cooler than MSI, talking from experience.