views:

193

answers:

1

1. I am using WiX for creating installer and would like to implement the following behaviour: If a user launches msi installer for the product and the product already installed, then wizard works similar to pure (first time) installation with exception of some things (e.g. license aggrement screen is omitted). The wizard should allow for example to change installation folder, select whether to place desktop shortcut,... I tried to do:

<Publish Event="ReinstallMode" Value="amus"><![CDATA[INSTALL_MODE = "Change"]]></Publish>
<Publish Event="Reinstall" Value="ALL"><![CDATA[INSTALL_MODE = "Change"]]></Publish>

But after installation completes: the product is in the same folder, where it was installed first time; desktop icon in the same state as it was after first time install. MSDN says: "Do not attempt to change the target directory path if some components that use the path are already installed for the current user or for a different user". Is there a way to re-install in another forlder and add/remove desktop icon in re-install?

2. Is this normal to use the same KeyPath for some components? For example the same registry values for DeskTop and Programs menu shortcuts? MSDN says: "Two components cannot share the same key path value". But compiling and verifying goes OK. And I did not discover problems using the same keypaths.

A: 
  1. I'm not sure I understood your requirements correctly, but it seems the Major Upgrades cover the functionality you need.

  2. Take a look at this ancient ;-), but still valuable blog entry by Rob Mensching. The KeyPath concept is clearly explained on an example there.

Hope this helps.

Yan Sklyarenko
Thanks1.> 1.I'm not sure I understood your requirements correctly...It is possible because of my "specific" English:)I'll try to rephrase.
VitalyVal
Suppose we install myprog.msi for the first time. The installer present to us a wizard. The wizard displays a license agreement, prompt to specify installation directory, prompt to specify whether to add desktop shortcut, etc. After the wizard finished we have our application successfully installed. Now we launch THE SAME myprog.msi again. I'd like after the launching, almost the same wizard would work (but without LA,...), but we could specify another installation folder, another option for desktop shortcut etc.. So it seems Upgrades is not suit in my case.
VitalyVal
2. Thanks again. I'l read the blog entry.
VitalyVal
Ah, I see now. It looks like you'd like to have multiple instances of your application installed. It is not a trivial thing. Take a look at this article(s): http://msdn.microsoft.com/en-us/library/aa369523(VS.85).aspx. You'll have to get familiar with the concept of instance transforms. It is natively supported by WiX via InstanceTransforms element: http://wix.sourceforge.net/manual-wix3/wix_xsd_instancetransforms.htm. Pay special attention to the terms "file data" and "non-file data" - you'll have to keep the last isolated. Hope this is more appropriate answer to your question #1.
Yan Sklyarenko
Thanks again. No, I do not want multiple instances. I'l try to explain again. Suppose first launch of msi installed the app in the "C:\MyApp1" folder. During the second launch of the same msi, if a user select to install in the "C:\MyApp2" folder, then after the installation completes the user have the app installed ONLY in the "C:\MyApp2" folder - the folder "C:\MyApp1" must be removed, registry values must be preserved, shortcurs must reference to new location,.... It seems we can see such behaviour in some popular (non-Windows Installer based) installing systems.
VitalyVal
Telling the truth, I'm not sure how to accomplish this in Windows Installer... however, it would be great to know the intention behind this requirement. Why do you need this behavior? Maybe, if you explain the reason, the people here will have other ideas?
Yan Sklyarenko
Indeed this is not a critical requirement at this time. Simply I have a couple of "manual" installers for other products, which allows perform re-installation in another folder. And I'd like to implement the same functionality for new application with Windows Installer.As for practical usage of such installer's feature: once, ages ago, I re-installed large software packages on another logical drive because of deficiency of free drive space:).
VitalyVal