3
votes

I've got a legacy application that's installed directly to the user's c: drive, in a directory (like c:\MyApp). Nasty stuff. Problem is, the user can specify to have a second installation on a second drive (like e:\MyApp), and they can have two different versions of the application installed at once in either directory. They can also decide to install the app elsewhere in the directory tree, but those are the two most common locations.

I did not write this scheme. It makes baby Jesus cry, as far as I'm concerned.

I have to write an installer to add a module to this scheme, and the user needs to be able to select which installation they want to install the module on. I thought I'd try this in WiX.

How do I do this?

I was going to do a directory search like

<Property Id="MyAppInstallationSearch">
  <DirectorySearch Id="MyAppDirectory" Path="C:\MyApp">
  </DirectorySearch>
</Property>

and then:

<Directory Id="TARGETDIR" Name="MyAppInstallationSearch">
    <Directory Id="INSTALLLOCATION" Name="AdditionalTools">
    </Directory>
</Directory>

to have an installation location.

So how do I:

  1. Make that search be relative, not absolute? (the documentation specifies that this can be done, I just don't see how).

  2. If the user has multiple locations, give them a choice of which installation to use?

2
Did the original install(s) write anything to the registry? Searching the entire disk (there's a depth setting on the dir search iirc) could take a long time. What was the original install done using (installshield, etc)? - user53794
good question, I don't know. I know that the previous installer was installshield, but I believe it was from a version bought in 98 or 99. - mmr
How do u identify that a particular dir say C:\MyApp has your application installed? What OS is being used? - NileshChauhan
The OS is any windows installation since xp sp2; the installer itself is way older, so I suppose a win2k or 98 could be supported, but I don't believe that will be an issue. - mmr

2 Answers

1
votes
  1. It will be relative meaning, AdditionalTools will be under the folder found by MyAppInstallationSearch.
  2. This will involve creating UI, which is not an easy thing in Wix, there are products that can create Wix output or WixEdit. You will need to search the directory on all possible places and show the user radio buttons (each bounded to a search results) to selected where to install the the new prodcut.
0
votes

I had to implement the same thing and I used an external UI handler to completly customize the installation process. I also display a wizard page where the user can select the version he wants to upgrade from. But be aware that this isn't something you can do within a day or two.

I don't know which programming language you use, but if you want to use .NET you can the Development Tools Foundation included with Wix3. The libraries can be found in the SDK folder of your Wix installation (you'll mainly need Microsoft.Deployment.WindowsInstaller.dll), documentation is in the DTF.chm in the doc directory. You'll also need a bootstrapper to install the .NET framework.

You could also wait until Wix 3.5, which will include Burn, a boostrapper and external UI handler you can easily customize.

HTH