0

I have a DLL that I need to install in a specific folder based on which OS I'm installing on.

For XP it is installed in system32, while on Win7 it is installed in SysWow64.

The solution is C# and I am using a deployment project.

In the deployment project, using the file system editor I added both system32 and SysWow64 with the DLL inside both.

At the folder level I am using the condition field to create the folder/dll or not.

For System32 I have the condition [CDATA[VersionNT = 501]]

For SysWow64 I have the condition [CDATA[VersionNT = 601]]

I have found that the DLL will only be inserted on XP systems, but the SysWow64 folder and DLL will be created on both Operating Systems.

I have tried different variations but I can't seem to find where I am going wrong.

I got the condition information from this thread How to check the system is Windows 7 or Windows Server 2008 R2 in Wix Installer?

Image of Deployment Project and Condition

Community
  • 1
  • 1
wmayes
  • 15
  • 1
  • 1
  • 6
  • 1
    It's rare for the location to be selected based on the OS *version* rather than the *bitness* of the OS. Since SysWow64 only exists on 64-bit OSes. – Damien_The_Unbeliever Jun 06 '14 at 14:06
  • Hmm, do you try the same install method under the vs2010 setup project too? (instead of wix) – huncyrus Jun 06 '14 at 14:11
  • What do you mean? I am using the setup project. I was under the impression that the condition field is the same as a WIX condition. – wmayes Jun 06 '14 at 14:15
  • The `<![CDATA[` and `]]>` bits in that WiX answer are an artefact of the fact that this condition (as with everything else in Wix) is being stored in an XML file. The actual condition being tested is just `Installed OR VersionNT >= 601` – Damien_The_Unbeliever Jun 06 '14 at 14:31
  • I tried doing it based on the bitness with VersionNT64 and Not VersionNT64 but I got the same results. – wmayes Jun 06 '14 at 14:33
  • As well I have tried it without the <![CDATA[ and ]]>. – wmayes Jun 06 '14 at 14:39
  • 2
    Please post your answer as an answer. You can access the rollback feature from the "edited ..." link to restore the question post to just the question. – Tom Blodget Jun 07 '14 at 14:49

1 Answers1

0

Sorry for the delay, I had to wait 8 hours before I could answer my own question.

The root problem was a silly mistake.

I was rebuilding the solution each time after making changes to the deployment project. I should have been right clicking the deployment project and selecting to build that. Thank you for your help.

I dropped the WIX <!CDATA[ ] parts in the condition field as [Damien_The_Unbeliever][1] said, as well as added the condition to the DLL instead of just the folder.

wmayes
  • 15
  • 1
  • 1
  • 6