سؤال

I'm using WIX 3.8 and I've written a 32-bit console application that I need to rollout to 32 and 64 bit machines - there are a number of combinations of target machine type

Q1 - Is there a template that covers a all areas such as

x86/x64
Windows XP Vs Vista/7/8 (security model - admin Vs non-admin)
perMachine (HKLM) Vs perUser (HKCU)

I've taken advice on the third point - I'm only going to release a perMachine installer however as I'm writing to the registry (HKLM) the installer is confused where things are being written to HKLM (note I can write OK to HKCU but is this because the installer is executed by default as non-Admin on my Windows 8 machine) - how for example can I generalise - I've tried

....
<Package...InstallScope="perMachine" />
...
<Feature Id='MainFeature' Level='1'>
  <Component Directory='ApplicationFolder' Win64='yes'>
    <Condition>VersionNT64</Condition>
    <RegistryValue Root='HKLM' Key='SOFTWARE\xxxx\InstallProperties' Name='PidKey64' Value='[PIDKEY]' Type='string' />
    <RemoveFolder Id='CleanupPidKey64' On='uninstall' />
  </Component>
  <Component Directory='ApplicationFolder'>
    <RegistryValue Root='HKLM' Key='SOFTWARE\xxxx\InstallProperties' Name='PidKey' Value='[PIDKEY]' Type='string' />
    <RemoveFolder Id='CleanupPidKey' On='uninstall' />
  </Component>
</Feature>
...

But the above fails (This package contains 64 bit component '...' but the Template Summary Property does not contain Intel64 or x64) because I don't have

Platform="x64"

in the Package tag.

Q2 - However if I have a package tag with the x64 attribute isn't the installer only for x64 machines and hence catering for x86 in the same installer is redundant.

Also the above gets a registry entry - there is also a save

<Property Id="PIDKEY">
  <RegistrySearch Id="SavePidKey" Root="HKLM"
                Key="SOFTWARE\xxxx\InstallProperties"
                Name="PidKey" Type="raw" />
</Property>

Q3 - Does the save need a similar treatment ?

هل كانت مفيدة؟

المحلول

Windows Installer doesn't support the concept of "Any CPU". MSI's are platform architecture specific. You need an x86 MSI and an x64 MSI. There are tricks around this (google Hybrid Installer) but you hit limitations here and there and end up writing custom actions that are not desirable.

If the console app is .NET compiled for Any CPU, I'd just treat it as 32bit software and install to ProgramFilesFolder (x86) and 32bit registry. It'll be installed as a 32bit app but it'll actually run as a 64bit process no problem. Just in your app code when you read the registry be sure to read from the 32bit hive to get your pid key.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top